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>
226 #endif //NEKTAR_LIB_UTILITIES_LINEAR_ALGEBRA_BLOCK_MATRIX_HPP static NumberType m_zeroElement
Array< OneD, std::shared_ptr< InnerType > > m_data
bool operator!=(const iterator_base< MatrixType > &rhs)
InnerType::NumberType NumberType
FullMatrixFuncs StoragePolicy
iterator_base< ThisType > iterator
Array< OneD, unsigned int > m_rowSizes
#define LIB_UTILITIES_EXPORT
InnerType::ConstGetValueType ConstGetValueType
bool operator==(const iterator_base< MatrixType > &rhs)
NekMatrix< InnerMatrixType, BlockMatrixTag > Transpose(NekMatrix< InnerMatrixType, BlockMatrixTag > &rhs)
NekMatrix< DataType, InnerMatrixType > InnerType
unsigned int m_numberOfBlockRows
MatrixType::InnerType IteratorInnerType
std::shared_ptr< InnerType > m_nullBlockPtr
iterator_base(MatrixType &m)
NekMatrix< InnerType, BlockMatrixTag > ThisType
iterator_base(const iterator_base< MatrixType > &rhs)
Array< OneD, unsigned int > m_columnSizes
InnerType::GetValueType GetValueType
iterator_base< const ThisType > const_iterator
iterator_base(MatrixType &m, unsigned int curRow, unsigned int curCol)
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs
ConstMatrix< NumberType > BaseType
unsigned int m_storageSize
unsigned int m_numberOfBlockColumns