40template <
typename DataType>
41typename boost::call_traits<DataType>::value_type ConstMatrix<
42 DataType>::operator()(
unsigned int row,
unsigned int column)
const
45 std::string(
"Row ") + std::to_string(row) +
46 std::string(
" requested in a matrix with a maximum of ") +
47 std::to_string(GetRows()) + std::string(
" rows"));
49 std::string(
"Column ") + std::to_string(column) +
50 std::string(
" requested in a matrix with a maximum of ") +
51 std::to_string(GetColumns()) + std::string(
" columns"));
52 return v_GetValue(row, column);
55template <
typename DataType>
58 return v_GetStorageSize();
63 return GetTransposedRows(GetTransposeFlag());
66template <
typename DataType>
69 return (transpose ==
'N') ? m_size[0] : m_size[1];
72template <
typename DataType>
75 return GetTransposedColumns(GetTransposeFlag());
78template <
typename DataType>
81 return (transpose ==
'N') ? m_size[1] : m_size[0];
84template <
typename DataType>
92 if (m_transpose ==
'N')
103template <
typename DataType>
106 return v_GetTransposeFlag();
109template <
typename DataType>
112 unsigned int numRows,
unsigned int numColumns,
const char transpose,
113 unsigned int numSubDiags,
unsigned int numSuperDiags)
115 if (transpose ==
'T')
141 numRows, numColumns, row, col, numSubDiags, numSuperDiags);
146 ASSERTL1(numSubDiags == numSuperDiags,
147 std::string(
"Number of sub- and superdiagonals should ") +
148 std::string(
"be equal for a symmetric banded matrix"));
164 return std::numeric_limits<unsigned int>::max();
167template <
typename DataType>
170 unsigned int subDiags,
unsigned int superDiags)
194 rows, columns, subDiags, superDiags);
200 std::string(
"Number of sub- and superdiagonals should ") +
201 std::string(
"be equal for a symmetric banded matrix"));
203 rows, columns, superDiags);
220template <
typename DataType>
223 : m_size(), m_transpose(
'N'), m_storageType(policy)
229template <
typename DataType>
231 : m_size(), m_transpose(rhs.m_transpose), m_storageType(rhs.m_storageType)
237template <
typename DataType>
241 m_size[0] = rhs.
m_size[0];
242 m_size[1] = rhs.
m_size[1];
248template <
typename DataType>
255template <
typename DataType>
258 m_transpose = newValue;
265template <
typename DataType>
275template <
typename DataType>
277 unsigned int row,
unsigned int column,
278 typename boost::call_traits<DataType>::const_reference
d)
281 std::string(
"Row ") + std::to_string(row) +
282 std::string(
" requested in a matrix with a maximum of ") +
283 std::to_string(this->GetRows()) + std::string(
" rows"));
284 ASSERTL2(column < this->GetColumns(),
285 std::string(
"Column ") + std::to_string(column) +
286 std::string(
" requested in a matrix with a maximum of ") +
287 std::to_string(this->GetColumns()) + std::string(
" columns"));
288 v_SetValue(row, column,
d);
291template <
typename DataType>
298template <
typename DataType>
304template <
typename DataType>
311template <
typename DataType>
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode....
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed to...
#define LIB_UTILITIES_EXPORT
void SetTransposeFlag(char newValue)
ConstMatrix< DataType > & operator=(const ConstMatrix< DataType > &rhs)
unsigned int GetStorageSize() const
ConstMatrix(unsigned int rows, unsigned int columns, MatrixStorage policy=eFULL)
static unsigned int CalculateIndex(MatrixStorage type, unsigned int row, unsigned int col, unsigned int numRows, unsigned int numColumns, const char transpose='N', unsigned int numSubDiags=0, unsigned int numSuperDiags=0)
unsigned int GetTransposedColumns(char transpose) const
virtual char v_GetTransposeFlag() const
unsigned int GetRows() const
virtual void v_Transpose()
MatrixStorage m_storageType
unsigned int GetTransposedRows(char transpose) const
void Resize(unsigned int rows, unsigned int columns)
Resets the rows and columns in the array. This method does not update the data storage to match the n...
static unsigned int GetRequiredStorageSize(MatrixStorage type, unsigned int rows, unsigned int columns, unsigned int subDiags=0, unsigned int superDiags=0)
char GetTransposeFlag() const
unsigned int GetColumns() const
const unsigned int * GetSize() const
void SetValue(unsigned int row, unsigned int column, typename boost::call_traits< DataType >::const_reference d)
Matrix< DataType > & operator=(const Matrix< DataType > &rhs)
Matrix(unsigned int rows, unsigned int columns, MatrixStorage policy=eFULL)
std::vector< double > d(NPUPPER *NPUPPER)
@ eLOWER_TRIANGULAR_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC_BANDED
@ ePOSITIVE_DEFINITE_SYMMETRIC
@ eUPPER_TRIANGULAR_BANDED
static unsigned int CalculateIndex(unsigned int totalRows, unsigned int totalColumns, unsigned int row, unsigned int column, unsigned int sub, unsigned int super)
static unsigned int GetRequiredStorageSize(unsigned int totalRows, unsigned int totalColumns, unsigned int subDiags, unsigned int superDiags)
Calculates and returns the storage size required.
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
static unsigned int CalculateIndex(unsigned int row, unsigned int col)
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
static unsigned int CalculateIndex(unsigned int totalRows, unsigned int totalColumns, unsigned int curRow, unsigned int curColumn)
static unsigned int CalculateIndex(unsigned int totalColumns, unsigned int curRow, unsigned int curColumn)
static unsigned int CalculateIndex(unsigned int curRow, unsigned int curColumn, unsigned int nSuperDiags)
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns, unsigned int nSubSuperDiags)
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
static unsigned int CalculateIndex(unsigned int curRow, unsigned int curColumn)
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
static unsigned int CalculateIndex(unsigned int curRow, unsigned int curColumn)