|
IFEM
90A354
|
Four-dimensional rectangular matrix with some algebraic operations. More...
#include <matrixnd.h>


Public Member Functions | |
| matrix4d () | |
| Constructor creating an empty matrix. | |
| matrix4d (vector< T > &vec) | |
| Constructor using an external vector for matrix element storage. | |
| matrix4d (size_t n_1, size_t n_2, size_t n_3, size_t n_4) | |
| Constructor creating a matrix of dimension \(n_1 \times n_2 \times n_3 \times n_4\). | |
| matrix4d (const matrix4d< T > &mat) | |
| Copy constructor. | |
| virtual | ~matrix4d () |
| Empty destructor. | |
| void | resize (size_t n_1, size_t n_2, size_t n_3, size_t n_4, bool forceClear=false) |
| Resize the matrix to dimension \(n_1 \times n_2 \times n_3 \times n_4\). More... | |
| matrix4d< T > & | operator= (const matrix4d< T > &A) |
| Assignment operator. | |
| T & | operator() (size_t i1, size_t i2, size_t i3, size_t i4) |
| Index-1 based element access. More... | |
| const T & | operator() (size_t i1, size_t i2, size_t i3, size_t i4) const |
| Index-1 based element access. More... | |
| matrix4d< T > & | operator+= (const matrix4d< T > &X) |
| Add the given matrix X to *this. | |
| matrix4d< T > & | operator-= (const matrix4d< T > &X) |
| Subtract the given matrix X from *this. | |
| matrix4d< T > & | add (const matrix4d< T > &X, T alfa=T(1)) |
| Add the given matrix X scaled by alfa to *this. | |
| matrix4d< T > & | multiply (T c) |
| Multiplication of this matrix by a scalar c. | |
| vector< T > | getColumn (size_t i2, size_t i3, size_t i4) const |
| Extract a column from the matrix. | |
| void | fillColumn (size_t i2, size_t i3, size_t i4, const std::vector< T > &data) |
| Fill a column of the matrix. | |
Public Member Functions inherited from utl::matrixBase< T > | |
| size_t | dim (short int d=1) const |
| Query dimensions. | |
| size_t | size () const |
| Query total matrix size. | |
| bool | empty () const |
| Check if the matrix is empty. | |
| bool | zero (T tol=T(0)) const |
| Check if the matrix elements are all zero. | |
| const vector< T > & | toVec () const |
| Type casting to a one-dimensional utl::vector, for access. | |
| operator const std::vector< T > & () const | |
| Type casting to a one-dimensional std::vector, for access. | |
| operator std::vector< T > & () | |
| Type casting to a one-dimensional vector, for update. | |
| T * | ptr (size_t c=0) |
| Access through pointer. | |
| const T * | ptr (size_t c=0) const |
| Reference through pointer. | |
| std::vector< T >::iterator | begin () |
| Iterator to the start of the matrix elements. | |
| std::vector< T >::iterator | end () |
| Iterator to the end of the matrix elements. | |
| void | clear () |
| Clears the matrix and sets its dimension to zero. | |
| void | fill (T s) |
| Fill the matrix with a scalar value. | |
| void | fill (const T *values, size_t n=0) |
| Fill the matrix with data from an array. | |
| matrixBase< T > & | add (const matrixBase< T > &A, const T &alfa) |
| Add the given matrix A scaled by alfa to *this. | |
| matrixBase< T > & | multiply (const T &c) |
| Multiplication of this matrix by a scalar c. | |
| T | norm2 (int inc=1) const |
| Return the Euclidean norm of the matrix. More... | |
| T | asum (int inc=1) const |
| Return the sum of the absolute value of the matrix elements. More... | |
| T | sum (int inc=1) const |
| Return the sum of the matrix elements. More... | |
Protected Member Functions | |
| virtual void | clearIfNrowChanged (size_t n1, size_t n2, size_t n3) |
| Clears the content if any of the first three dimensions changed. | |
Protected Member Functions inherited from utl::matrixBase< T > | |
| matrixBase () | |
| The constructor is protected to allow sub-class instances only. | |
| matrixBase (vector< T > &vec) | |
| Constructor using an external vector for matrix element storage. | |
| matrixBase (size_t n_1, size_t n_2, size_t n_3=1, size_t n_4=1) | |
| Constructor creating a matrix of dimension \(n_1 \times n_2 \times n_3 \times n_4\). | |
| matrixBase (const matrixBase< T > &mat, bool copyContent=true) | |
| Copy constructor. More... | |
| void | redim (size_t n_1, size_t n_2, size_t n_3, size_t n_4, bool forceClear) |
| Resize the matrix to dimension \(n_1 \times n_2 \times n_3 \times n_4\). More... | |
Additional Inherited Members | |
Protected Attributes inherited from utl::matrixBase< T > | |
| size_t | n [4] |
| Dimension of the matrix. | |
| vector< T > & | elem |
| Actual matrix elements, stored column by column. | |
Four-dimensional rectangular matrix with some algebraic operations.
|
inline |
Index-1 based element access.
Assuming column-wise storage as in Fortran.
|
inline |
Index-1 based element access.
Assuming column-wise storage as in Fortran.
|
inline |
Resize the matrix to dimension \(n_1 \times n_2 \times n_3 \times n_4\).
Will erase the previous content, but only if both the total matrix size, and n_1, n_2 or n_3 in the matrix are changed. It is therefore possible to add or remove a given number of elements in the fourth dimension of the matrix without loosing the contents of the first three dimensions. If forceClear is true, the old matrix content is always erased.
References utl::matrixBase< T >::redim().
Referenced by SplineUtils::extractBasis(), ASMs1D::extractBasis(), and utl::Hessian2().