40 template <
typename DataType>
41 typename 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);
55 template <
typename DataType>
58 return v_GetStorageSize();
63 return GetTransposedRows(GetTransposeFlag());
66 template <
typename DataType>
79 template <
typename DataType>
82 return GetTransposedColumns(GetTransposeFlag());
85 template <
typename DataType>
98 template <
typename DataType>
106 if (m_transpose ==
'N')
117 template <
typename DataType>
120 return v_GetTransposeFlag();
123 template <
typename DataType>
126 unsigned int numRows,
unsigned int numColumns,
const char transpose,
127 unsigned int numSubDiags,
unsigned int numSuperDiags)
129 if (transpose ==
'T')
155 numRows, numColumns, row, col, numSubDiags, numSuperDiags);
160 ASSERTL1(numSubDiags == numSuperDiags,
161 std::string(
"Number of sub- and superdiagonals should ") +
162 std::string(
"be equal for a symmetric banded matrix"));
178 return std::numeric_limits<unsigned int>::max();
181 template <
typename DataType>
184 unsigned int subDiags,
unsigned int superDiags)
208 rows, columns, subDiags, superDiags);
214 std::string(
"Number of sub- and superdiagonals should ") +
215 std::string(
"be equal for a symmetric banded matrix"));
217 rows, columns, superDiags);
234 template <
typename DataType>
237 : m_size(), m_transpose(
'N'), m_storageType(policy)
243 template <
typename DataType>
245 : m_size(), m_transpose(rhs.m_transpose), m_storageType(rhs.m_storageType)
251 template <
typename DataType>
255 m_size[0] = rhs.
m_size[0];
256 m_size[1] = rhs.
m_size[1];
262 template <
typename DataType>
269 template <
typename DataType>
272 m_transpose = newValue;
279 template <
typename DataType>
289 template <
typename DataType>
291 unsigned int row,
unsigned int column,
292 typename boost::call_traits<DataType>::const_reference d)
295 std::string(
"Row ") + std::to_string(row) +
296 std::string(
" requested in a matrix with a maximum of ") +
297 std::to_string(this->GetRows()) + std::string(
" rows"));
298 ASSERTL2(column < this->GetColumns(),
299 std::string(
"Column ") + std::to_string(column) +
300 std::string(
" requested in a matrix with a maximum of ") +
301 std::to_string(this->GetColumns()) + std::string(
" columns"));
302 v_SetValue(row, column, d);
305 template <
typename DataType>
312 template <
typename DataType>
318 template <
typename DataType>
325 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)
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)