37 template<
typename DataType>
40 template<
typename DataType>
43 ASSERTL2(row < GetRows(), std::string(
"Row ") + boost::lexical_cast<std::string>(row) +
44 std::string(
" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(GetRows()) +
45 std::string(
" rows"));
46 ASSERTL2(column < GetColumns(), std::string(
"Column ") + boost::lexical_cast<std::string>(column) +
47 std::string(
" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(GetColumns()) +
48 std::string(
" columns"));
49 return v_GetValue(row, column);
52 template<
typename DataType>
55 return v_GetStorageSize();
58 template<
typename DataType>
61 return GetTransposedRows(GetTransposeFlag());
64 template<
typename DataType>
67 if( transpose ==
'N' )
77 template<
typename DataType>
80 return GetTransposedColumns(GetTransposeFlag());
83 template<
typename DataType>
86 if( transpose ==
'N' )
96 template<
typename DataType>
99 template<
typename DataType>
102 if( m_transpose ==
'N' )
113 template<
typename DataType>
116 return v_GetTransposeFlag();
119 template<
typename DataType>
121 unsigned int row,
unsigned int col,
122 unsigned int numRows,
unsigned int numColumns,
const char transpose,
123 unsigned int numSubDiags,
unsigned int numSuperDiags )
125 if(transpose ==
'T' )
149 row, col, numSubDiags, numSuperDiags);
154 ASSERTL1(numSubDiags==numSuperDiags,
155 std::string(
"Number of sub- and superdiagonals should ") +
156 std::string(
"be equal for a symmetric banded matrix"));
172 return std::numeric_limits<unsigned int>::max();
175 template<
typename DataType>
177 unsigned int columns,
unsigned int subDiags,
unsigned int superDiags)
199 subDiags, superDiags);
205 std::string(
"Number of sub- and superdiagonals should ") +
206 std::string(
"be equal for a symmetric banded matrix"));
225 template<
typename DataType>
230 m_storageType(policy)
236 template<
typename DataType>
239 m_transpose(rhs.m_transpose),
240 m_storageType(rhs.m_storageType)
246 template<
typename DataType>
249 m_size[0] = rhs.
m_size[0];
250 m_size[1] = rhs.
m_size[1];
252 m_storageType = m_storageType;
257 template<
typename DataType>
264 template<
typename DataType>
267 m_transpose = newValue;
270 template<
typename DataType>
273 template<
typename DataType>
277 template<
typename DataType>
280 template<
typename DataType>
283 ASSERTL2(row < this->GetRows(), std::string(
"Row ") + boost::lexical_cast<std::string>(row) +
284 std::string(
" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(this->GetRows()) +
285 std::string(
" rows"));
286 ASSERTL2(column < this->GetColumns(), std::string(
"Column ") + boost::lexical_cast<std::string>(column) +
287 std::string(
" requested in a matrix with a maximum of ") + boost::lexical_cast<std::string>(this->GetColumns()) +
288 std::string(
" columns"));
289 v_SetValue(row, column, d);
292 template<
typename DataType>
299 template<
typename DataType>
305 template<
typename DataType>
312 template<
typename DataType>
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mod...
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 CalculateIndex(unsigned int totalRows, unsigned int totalColumns, unsigned int row, unsigned int column, unsigned int sub, unsigned int super)
static unsigned int CalculateIndex(unsigned int curRow, unsigned int curColumn, unsigned int nSuperDiags)
static unsigned int CalculateIndex(unsigned int curRow, unsigned int curColumn)
const unsigned int * GetSize() const
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
Matrix(unsigned int rows, unsigned int columns, MatrixStorage policy=eFULL)
static unsigned int CalculateIndex(unsigned int totalColumns, unsigned int curRow, unsigned int curColumn)
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns)
char GetTransposeFlag() const
virtual void v_Transpose()
unsigned int GetColumns() const
ConstMatrix(unsigned int rows, unsigned int columns, MatrixStorage policy=eFULL)
unsigned int GetStorageSize() const
Matrix< DataType > & operator=(const Matrix< DataType > &rhs)
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)
#define LIB_UTILITIES_EXPORT
virtual char v_GetTransposeFlag() const
static unsigned int GetRequiredStorageSize(unsigned int rows, unsigned int columns, unsigned int nSubSuperDiags)
unsigned int GetTransposedColumns(char transpose) const
void SetTransposeFlag(char newValue)
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 row, unsigned int col)
unsigned int GetRows() const
ConstMatrix< DataType > & operator=(const ConstMatrix< DataType > &rhs)
#define ASSERTL2(condition, msg)
Assert Level 2 – Debugging which is used FULLDEBUG compilation mode. This level assert is designed t...
static unsigned int GetRequiredStorageSize(MatrixStorage type, unsigned int rows, unsigned int columns, unsigned int subDiags=0, unsigned int superDiags=0)
static unsigned int CalculateIndex(unsigned int totalRows, unsigned int totalColumns, unsigned int curRow, unsigned int curColumn)
void SetValue(unsigned int row, unsigned int column, typename boost::call_traits< DataType >::const_reference d)
boost::call_traits< DataType >::value_type operator()(unsigned int row, unsigned int column) const
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
unsigned int GetTransposedRows(char transpose) const
static unsigned int GetRequiredStorageSize(unsigned int totalRows, unsigned int totalColumns, unsigned int subDiags, unsigned int superDiags)
Calculates and returns the storage size required.