44template <
typename DataType>
45typename boost::call_traits<DataType>::value_type
ConstMatrix<
46 DataType>::operator()(
unsigned int row,
unsigned int column)
const
49 std::string(
"Row ") + std::to_string(row) +
50 std::string(
" requested in a matrix with a maximum of ") +
51 std::to_string(GetRows()) + std::string(
" rows"));
53 std::string(
"Column ") + std::to_string(column) +
54 std::string(
" requested in a matrix with a maximum of ") +
55 std::to_string(GetColumns()) + std::string(
" columns"));
56 return v_GetValue(row, column);
59template <
typename DataType>
62 return v_GetStorageSize();
67 return GetTransposedRows(GetTransposeFlag());
70template <
typename DataType>
83template <
typename DataType>
86 return GetTransposedColumns(GetTransposeFlag());
89template <
typename DataType>
102template <
typename DataType>
110 if (m_transpose ==
'N')
121template <
typename DataType>
124 return v_GetTransposeFlag();
127template <
typename DataType>
130 unsigned int numRows,
unsigned int numColumns,
const char transpose,
131 unsigned int numSubDiags,
unsigned int numSuperDiags)
133 if (transpose ==
'T')
159 numRows, numColumns, row, col, numSubDiags, numSuperDiags);
164 ASSERTL1(numSubDiags == numSuperDiags,
165 std::string(
"Number of sub- and superdiagonals should ") +
166 std::string(
"be equal for a symmetric banded matrix"));
182 return std::numeric_limits<unsigned int>::max();
185template <
typename DataType>
188 unsigned int subDiags,
unsigned int superDiags)
212 rows, columns, subDiags, superDiags);
218 std::string(
"Number of sub- and superdiagonals should ") +
219 std::string(
"be equal for a symmetric banded matrix"));
221 rows, columns, superDiags);
238template <
typename DataType>
241 : m_size(), m_transpose(
'N'), m_storageType(policy)
247template <
typename DataType>
249 : m_size(), m_transpose(rhs.m_transpose), m_storageType(rhs.m_storageType)
255template <
typename DataType>
259 m_size[0] = rhs.
m_size[0];
260 m_size[1] = rhs.
m_size[1];
266template <
typename DataType>
273template <
typename DataType>
276 m_transpose = newValue;
283template <
typename DataType>
293template <
typename DataType>
295 unsigned int row,
unsigned int column,
296 typename boost::call_traits<DataType>::const_reference
d)
299 std::string(
"Row ") + std::to_string(row) +
300 std::string(
" requested in a matrix with a maximum of ") +
301 std::to_string(this->GetRows()) + std::string(
" rows"));
302 ASSERTL2(column < this->GetColumns(),
303 std::string(
"Column ") + std::to_string(column) +
304 std::string(
" requested in a matrix with a maximum of ") +
305 std::to_string(this->GetColumns()) + std::string(
" columns"));
306 v_SetValue(row, column,
d);
309template <
typename DataType>
316template <
typename DataType>
322template <
typename DataType>
329template <
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)
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)