35#ifndef NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLOCK_MATRIX_HPP
36#define NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLOCK_MATRIX_HPP
48template <
typename DataType,
typename InnerMatrixType>
51 typename NekMatrix<DataType, InnerMatrixType>::NumberType>
66 template <
typename MatrixType>
class iterator_base
74 : m_matrix(m), m_curRow(curRow), m_curColumn(curCol)
79 : m_matrix(m), m_curRow(
std::numeric_limits<unsigned int>::max()),
80 m_curColumn(
std::numeric_limits<unsigned int>::max())
85 : m_matrix(rhs.m_matrix), m_curRow(rhs.m_curRow),
86 m_curColumn(rhs.m_curColumn)
92 if (m_curRow != std::numeric_limits<unsigned int>::max())
94 std::tie(m_curRow, m_curColumn) = StoragePolicy::Advance(
95 m_matrix.GetRows(), m_matrix.GetColumns(), m_curRow,
102 return m_matrix(m_curRow, m_curColumn);
107 return m_curRow == rhs.m_curRow && m_curColumn == rhs.m_curColumn;
112 return !(*
this == rhs);
117 const iterator_base<MatrixType> &rhs);
131 unsigned int numberOfBlockColumns,
132 unsigned int rowsPerBlock,
133 unsigned int columnsPerBlock,
137 unsigned int numberOfBlockColumns,
138 const unsigned int *rowsPerBlock,
139 const unsigned int *columnsPerBlock,
143 unsigned int numberOfBlockRows,
unsigned int numberOfBlockColumns,
158 unsigned int row,
unsigned int column)
const;
161 unsigned int row,
unsigned int column)
const;
164 unsigned int row,
unsigned int column)
const;
167 unsigned int row,
unsigned int column);
170 std::shared_ptr<InnerType> &m);
173 unsigned int col)
const;
182 unsigned int blockRow)
const;
185 unsigned int blockCol)
const;
200 const std::shared_ptr<ThisType> &rhs);
204 typename boost::call_traits<NumberType>::value_type v_GetValue(
205 unsigned int row,
unsigned int column)
const override;
213 unsigned int block,
unsigned int totalBlocks,
217 const unsigned int *columnsPerBlock);
229template <
typename DataType,
typename InnerMatrixType>
232 BlockMatrixTag>::m_zeroElement(0);
234template <
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)
iterator_base< MatrixType > & operator=(const iterator_base< MatrixType > &rhs)
MatrixType::InnerType IteratorInnerType
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
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)