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>
53 typename NekMatrix<DataType, InnerMatrixType>::NumberType>
68 template <
typename MatrixType>
class iterator_base
76 : m_matrix(m), m_curRow(curRow), m_curColumn(curCol)
81 : m_matrix(m), m_curRow(std::numeric_limits<unsigned int>::max()),
82 m_curColumn(std::numeric_limits<unsigned int>::max())
87 : m_matrix(rhs.m_matrix), m_curRow(rhs.m_curRow),
88 m_curColumn(rhs.m_curColumn)
94 if (m_curRow != std::numeric_limits<unsigned int>::max())
96 std::tie(m_curRow, m_curColumn) = StoragePolicy::Advance(
97 m_matrix.GetRows(), m_matrix.GetColumns(), m_curRow,
104 return m_matrix(m_curRow, m_curColumn);
109 return m_curRow == rhs.m_curRow && m_curColumn == rhs.m_curColumn;
114 return !(*
this == rhs);
119 const iterator_base<MatrixType> &rhs);
133 unsigned int numberOfBlockColumns,
134 unsigned int rowsPerBlock,
135 unsigned int columnsPerBlock,
139 unsigned int numberOfBlockColumns,
140 const unsigned int *rowsPerBlock,
141 const unsigned int *columnsPerBlock,
145 unsigned int numberOfBlockRows,
unsigned int numberOfBlockColumns,
160 unsigned int row,
unsigned int column)
const;
163 unsigned int row,
unsigned int column)
const;
166 unsigned int row,
unsigned int column)
const;
169 unsigned int row,
unsigned int column);
172 std::shared_ptr<InnerType> &m);
175 unsigned int col)
const;
184 unsigned int blockRow)
const;
187 unsigned int blockCol)
const;
202 const std::shared_ptr<ThisType> &rhs);
206 typename boost::call_traits<NumberType>::value_type
207 v_GetValue(
unsigned int row,
unsigned int column)
const override;
215 unsigned int block,
unsigned int totalBlocks,
219 const unsigned int *columnsPerBlock);
231 template <
typename DataType,
typename InnerMatrixType>
234 BlockMatrixTag>::m_zeroElement(0);
236 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)