36 template<
typename DataType>
39 template<
typename DataType>
42 ASSERTL2(row < GetRows(), std::string(
"Row ") + std::to_string(row) +
43 std::string(
" requested in a matrix with a maximum of ") + std::to_string(GetRows()) +
44 std::string(
" rows"));
45 ASSERTL2(column < GetColumns(), std::string(
"Column ") + std::to_string(column) +
46 std::string(
" requested in a matrix with a maximum of ") + std::to_string(GetColumns()) +
47 std::string(
" columns"));
48 return v_GetValue(row, column);
51 template<
typename DataType>
54 return v_GetStorageSize();
57 template<
typename DataType>
60 return GetTransposedRows(GetTransposeFlag());
63 template<
typename DataType>
66 if( transpose ==
'N' )
76 template<
typename DataType>
79 return GetTransposedColumns(GetTransposeFlag());
82 template<
typename DataType>
85 if( transpose ==
'N' )
95 template<
typename DataType>
98 template<
typename DataType>
101 if( m_transpose ==
'N' )
112 template<
typename DataType>
115 return v_GetTransposeFlag();
118 template<
typename DataType>
120 unsigned int row,
unsigned int col,
121 unsigned int numRows,
unsigned int numColumns,
const char transpose,
122 unsigned int numSubDiags,
unsigned int numSuperDiags )
124 if(transpose ==
'T' )
148 row, col, numSubDiags, numSuperDiags);
153 ASSERTL1(numSubDiags==numSuperDiags,
154 std::string(
"Number of sub- and superdiagonals should ") +
155 std::string(
"be equal for a symmetric banded matrix"));
171 return std::numeric_limits<unsigned int>::max();
174 template<
typename DataType>
176 unsigned int columns,
unsigned int subDiags,
unsigned int superDiags)
198 subDiags, superDiags);
204 std::string(
"Number of sub- and superdiagonals should ") +
205 std::string(
"be equal for a symmetric banded matrix"));
224 template<
typename DataType>
229 m_storageType(policy)
235 template<
typename DataType>
238 m_transpose(rhs.m_transpose),
239 m_storageType(rhs.m_storageType)
245 template<
typename DataType>
248 m_size[0] = rhs.
m_size[0];
249 m_size[1] = rhs.
m_size[1];
256 template<
typename DataType>
263 template<
typename DataType>
266 m_transpose = newValue;
269 template<
typename DataType>
272 template<
typename DataType>
276 template<
typename DataType>
279 template<
typename DataType>
282 ASSERTL2(row < this->GetRows(), std::string(
"Row ") + std::to_string(row) +
283 std::string(
" requested in a matrix with a maximum of ") + std::to_string(this->GetRows()) +
284 std::string(
" rows"));
285 ASSERTL2(column < this->GetColumns(), std::string(
"Column ") + std::to_string(column) +
286 std::string(
" requested in a matrix with a maximum of ") + std::to_string(this->GetColumns()) +
287 std::string(
" columns"));
288 v_SetValue(row, column, d);
291 template<
typename DataType>
298 template<
typename DataType>
304 template<
typename DataType>
311 template<
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)
boost::call_traits< DataType >::value_type operator()(unsigned int row, unsigned int column) const
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)
The above copyright notice and this permission notice shall be included.
@ 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)