35 #ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLOCK_MATRIX_HPP
36 #define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLOCK_MATRIX_HPP
50 template<
typename DataType,
typename InnerMatrixType>
66 template<
typename MatrixType>
83 m_curRow(std::numeric_limits<unsigned int>::max()),
84 m_curColumn(std::numeric_limits<unsigned int>::max())
89 m_matrix(rhs.m_matrix),
90 m_curRow(rhs.m_curRow),
91 m_curColumn(rhs.m_curColumn)
97 if( m_curRow != std::numeric_limits<unsigned int>::max() )
99 std::tie(m_curRow, m_curColumn) = StoragePolicy::Advance(
100 m_matrix.GetRows(), m_matrix.GetColumns(), m_curRow, m_curColumn);
106 return m_matrix(m_curRow, m_curColumn);
111 return m_curRow == rhs.m_curRow && m_curColumn == rhs.m_curColumn;
116 return !(*
this == rhs);
120 iterator_base<MatrixType>&
operator=(
const iterator_base<MatrixType>& rhs);
135 unsigned int rowsPerBlock,
unsigned int columnsPerBlock,
139 const unsigned int* rowsPerBlock,
const unsigned int* columnsPerBlock,
154 LIB_UTILITIES_EXPORT unsigned int CalculateBlockIndex(
unsigned int row,
unsigned int column)
const;
158 LIB_UTILITIES_EXPORT std::shared_ptr<const InnerType> GetBlock(
unsigned int row,
unsigned int column)
const;
160 LIB_UTILITIES_EXPORT std::shared_ptr<InnerType>& GetBlock(
unsigned int row,
unsigned int column);
162 LIB_UTILITIES_EXPORT void SetBlock(
unsigned int row,
unsigned int column, std::shared_ptr<InnerType>& m);
193 LIB_UTILITIES_EXPORT void Initialize(
const unsigned int* rowsPerBlock,
const unsigned int* columnsPerBlock);
195 LIB_UTILITIES_EXPORT virtual typename boost::call_traits<NumberType>::value_type v_GetValue(
unsigned int row,
unsigned int column)
const;
211 template<
typename DataType,
typename InnerMatrixType>
215 template<
typename InnerMatrixType>
#define LIB_UTILITIES_EXPORT
FullMatrixFuncs StoragePolicy
bool operator!=(const iterator_base< MatrixType > &rhs)
iterator_base(MatrixType &m, unsigned int curRow, unsigned int curCol)
iterator_base(MatrixType &m)
bool operator==(const iterator_base< MatrixType > &rhs)
iterator_base(const iterator_base< MatrixType > &rhs)
MatrixType::InnerType IteratorInnerType
iterator_base< MatrixType > & operator=(const iterator_base< MatrixType > &rhs)
unsigned int m_numberOfBlockRows
ConstMatrix< NumberType > BaseType
Array< OneD, unsigned int > m_rowSizes
unsigned int m_numberOfBlockColumns
NekMatrix(const ThisType &rhs)
InnerType::GetValueType GetValueType
NekMatrix< InnerType, BlockMatrixTag > ThisType
static ThisType CreateWrapper(const ThisType &rhs)
Array< OneD, unsigned int > m_columnSizes
iterator_base< const ThisType > const_iterator
std::shared_ptr< InnerType > m_nullBlockPtr
iterator_base< ThisType > iterator
static std::shared_ptr< ThisType > CreateWrapper(const std::shared_ptr< ThisType > &rhs)
unsigned int m_storageSize
Array< OneD, std::shared_ptr< InnerType > > m_data
NekMatrix< DataType, InnerMatrixType > InnerType
InnerType::NumberType NumberType
InnerType::ConstGetValueType ConstGetValueType
static NumberType m_zeroElement
The above copyright notice and this permission notice shall be included.
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)