Generic class for matrix storage and operations The idea behind this matrix class is to have a simple matrix (and vector) class that has all it's storage on the stack and several of it's methods optimized. This class is intended for small size matrices that are used in things like objective calculations of other heavily repeated operations. It is not intended for use with dynamic sizes. In most cases the size should be known at compile time. In a few instances the size is not known (for example when there are different sets of shape functions activated by the user, this leads to runtime sizing of the tangent matrix in the subset-based optimization loop). In cases like these, functionality for dynamic sizing has been emulated by making a Matrix of MAX_MATRIX_DIM size and only uses a portion of that allocation.
More...
|
| Matrix (const size_t rows=Rows, const size_t cols=Cols) |
|
| Matrix (Matrix const &in) |
| copy constructor
|
|
| Matrix (std::initializer_list< std::initializer_list< Type > > list) |
| initializer list constructor
|
|
virtual | ~Matrix () |
| default destructor
|
|
size_t | rows () const |
| return the number of rows
|
|
size_t | storage_rows () const |
| return the stack storage number of rows
|
|
size_t | cols () const |
| return the number of columns
|
|
size_t | storage_cols () const |
| return the stack storage number of columns
|
|
size_t | size () const |
| return the number of columns
|
|
size_t | storage_size () const |
| return the stack storage number of columns
|
|
template<typename RType , size_t RRows, size_t RCols> |
void | validate_dimensions (const Matrix< RType, RRows, RCols > &rhs) const |
| validate the matrix dimensions of the rhs for copy, etc.
|
|
Type & | operator() (const size_t row, const size_t col) |
| access operator
|
|
const Type & | operator() (const size_t row, const size_t col) const |
| const access operator
|
|
Type & | operator() (const size_t index) |
| const access operator
|
|
const Type & | operator() (const size_t index) const |
| const access operator
|
|
const Type | operator[] (const size_t index) const |
| const access operator
|
|
Type * | data () |
| return a pointer to the storage of the matrix (for LAPACK calls)
|
|
void | put_value (const Type &value) |
| set all values of a matrix to given value
|
|
template<typename RType , size_t RRows, size_t RCols> |
void | copy (const Matrix< RType, RRows, RCols > &rhs) |
| copy another matrix of a different type
|
|
template<size_t RRows, size_t RCols> |
Matrix< Type, Rows, Cols > & | operator= (const Matrix< Type, RRows, RCols > &rhs) |
| assignment operator
|
|
template<size_t RRows, size_t RCols> |
Matrix< Type, Rows, Cols > | operator+ (const Matrix< Type, RRows, RCols > &rhs) const |
| add operator
|
|
template<size_t RRows, size_t RCols> |
Matrix< Type, Rows, Cols > | operator- (const Matrix< Type, RRows, RCols > &rhs) const |
| subtract operator
|
|
template<typename RType , size_t RRows, size_t RCols> |
Matrix< Type, Rows, RCols > | operator* (const Matrix< RType, RRows, RCols > &rhs) const |
| matrix times a matrix
|
|
Matrix< Type, Cols, Rows > | transpose () const |
| transpose of a matrix
|
|
scalar_t | norm () const |
| 2 norm of a matrix
|
|
scalar_t | max () const |
| largest value
|
|
scalar_t | min () const |
| smallest value
|
|
void | scale_by (const Type &value) |
| scale all values
|
|
bool | all_values_are_zero () const |
|
Matrix< scalar_t, Rows, Cols > | inv () |
| compute the inverse of a matrix and return as a new matrix
|
|
scalar_t | condition_number () |
|
|
template<size_t RRows, size_t RCols> |
bool | operator== (const Matrix< Type, Rows, Cols > &lhs, const Matrix< Type, RRows, RCols > &rhs) |
| comparison operator
|
|
template<size_t RRows, size_t RCols> |
bool | operator!= (const Matrix< Type, Rows, Cols > &lhs, const Matrix< Type, RRows, RCols > &rhs) |
| comparison operator
|
|
std::ostream & | operator<< (std::ostream &os, const Matrix< Type, Rows, Cols > &matrix) |
| overload the ostream operator to enable std::cout << matrix << std::endl;, etc.
|
|
template<typename Type, size_t Rows = 16, size_t Cols = Rows>
class DICe::Matrix< Type, Rows, Cols >
Generic class for matrix storage and operations The idea behind this matrix class is to have a simple matrix (and vector) class that has all it's storage on the stack and several of it's methods optimized. This class is intended for small size matrices that are used in things like objective calculations of other heavily repeated operations. It is not intended for use with dynamic sizes. In most cases the size should be known at compile time. In a few instances the size is not known (for example when there are different sets of shape functions activated by the user, this leads to runtime sizing of the tangent matrix in the subset-based optimization loop). In cases like these, functionality for dynamic sizing has been emulated by making a Matrix of MAX_MATRIX_DIM size and only uses a portion of that allocation.