Ocean
Ocean::StaticMatrix< T, tRows, tColumns > Class Template Reference

This class implements a matrix with static dimensions. More...

Public Types

typedef T Type
 Definition of the matrix element type. More...
 

Public Member Functions

 StaticMatrix ()
 Creates a new matrix object without initializing the matrix elements. More...
 
 StaticMatrix (const T &value)
 Creates a new matrix object and sets all elements to one unique value. More...
 
 StaticMatrix (const bool toIdentity)
 Creates a new matrix and initializes the elements of the matrix so that we receive an identity matrix or a zero matrix. More...
 
 StaticMatrix (const T *values)
 Creates a new matrix element and initialized the matrix elements by a given data buffer with row aligned elements. More...
 
 StaticMatrix (const T *values, const bool valuesRowAligned)
 Creates a new matrix element and initialized the matrix elements by a given data buffer. More...
 
const T * row (const size_t index) const
 Returns a pointer to a specified row. More...
 
T * row (const size_t index)
 Returns a pointer to a specified row. More...
 
template<size_t tIndex>
const T * row () const
 Returns a pointer to a specified row. More...
 
template<size_t tIndex>
T * row ()
 Returns a pointer to a specified row. More...
 
template<size_t tRow, size_t tColumn>
const T & element () const
 Returns a pointer to a specified element. More...
 
template<size_t tRow, size_t tColumn>
T & element ()
 Returns a pointer to a specified element. More...
 
const T * data () const
 Returns the pointer to the internal element buffer. More...
 
T * data ()
 Returns the pointer to the internal element buffer. More...
 
bool isNull () const
 Returns whether all elements of this matrix are zero. More...
 
bool isIdentity () const
 Returns whether this matrix is an identity matrix. More...
 
bool isEqual (const StaticMatrix< T, tRows, tColumns > &matrix, const T eps=NumericT< T >::eps()) const
 Returns whether two matrices are almost identical up to a specified epsilon. More...
 
bool isSymmetric (const T eps=NumericT< T >::eps()) const
 Returns whether this matrix is symmetric (and whether this matrix is a square matrix). More...
 
void toNull ()
 Sets the matrix to a zero matrix. More...
 
void setData (const T *values, const bool valuesRowAligned)
 Sets the elements of this matrix by copying the values from a given buffer. More...
 
bool solveCholesky (const StaticMatrix< T, tRows, 1 > &vectorB, StaticMatrix< T, tRows, 1 > &vectorX) const
 Solves the given linear system by application of the cholesky distribution. More...
 
void add (StaticMatrix< T, tRows, tColumns > &target) const
 Adds this matrix to a given matrix. More...
 
void addTransposed (StaticMatrix< T, tColumns, tRows > &target) const
 Adds this matrix transposed to a given matrix. More...
 
template<size_t tColumns2>
void multiply (const StaticMatrix< T, tColumns, tColumns2 > &matrix, StaticMatrix< T, tRows, tColumns2 > &result) const
 Multiplies this matrix with a second matrix and assigns the results to a matrix. More...
 
template<size_t tColumns2>
void multiply (const StaticMatrix< T, tColumns, tColumns2 > &matrix, T *result) const
 Multiplies this matrix with a second matrix and assigns the results to a given buffer. More...
 
template<size_t tColumns2>
void multiply (const StaticMatrix< T, tColumns, tColumns2 > &matrix, const size_t rowOffset, T *result) const
 Multiplies this matrix with a second matrix and assigns the results to a given buffer. More...
 
StaticMatrix< T, tColumns, tColumns > multiplyWithTransposedLeft () const
 Multiplies this matrix (right) with the transposed matrix (left). More...
 
void multiplyWithTransposedLeft (StaticMatrix< T, tColumns, tColumns > &result) const
 Multiplies this matrix (right) with the transposed matrix (left) and stores the result in a provided matrix. More...
 
StaticMatrix< T, tRows, tRows > multiplyWithTransposedRight () const
 Multiplies this matrix (left) with the transposed matrix (right). More...
 
void multiplyWithTransposedRight (StaticMatrix< T, tRows, tRows > &result) const
 Multiplies this matrix (left) with the transposed matrix (right) and stores the result in a provided matrix. More...
 
void multiplyWithTransposedLeftAndAdd (StaticMatrix< T, tColumns, tColumns > &target) const
 Multiplies this matrix (right) with the transposed matrix (left) and adds the resulting matrix to a given matrix. More...
 
void multiplyWithTransposedRightAndAdd (StaticMatrix< T, tRows, tRows > &target) const
 Multiplies this matrix (left) with the transposed matrix (right) and adds the resulting matrix to a given matrix. More...
 
StaticMatrix< T, tColumns, tRows > transposed () const
 Returns the transposed matrix of this matrix. More...
 
void transposed (StaticMatrix< T, tColumns, tRows > &result) const
 Transposes this matrix. More...
 
StaticMatrix< T, tRows, tColumns > operator+ (const StaticMatrix< T, tRows, tColumns > &matrix) const
 Adds a given matrix to this matrix. More...
 
StaticMatrix< T, tRows, tColumns > & operator+= (const StaticMatrix< T, tRows, tColumns > &matrix)
 Adds a given matrix to this matrix. More...
 
StaticMatrix< T, tRows, tColumns > operator- (const StaticMatrix< T, tRows, tColumns > &matrix) const
 Subtracts a given matrix from this matrix. More...
 
StaticMatrix< T, tRows, tColumns > & operator-= (const StaticMatrix< T, tRows, tColumns > &matrix)
 Subtracts a given matrix from this matrix. More...
 
template<size_t tColumns2>
StaticMatrix< T, tRows, tColumns2 > operator* (const StaticMatrix< T, tColumns, tColumns2 > &matrix) const
 Multiplies this matrix with a second matrix objects and returns the result. More...
 
StaticMatrix< T, tRows, tColumns > operator* (const T &value) const
 Multiplies this matrix with a scalar value element-wise and returns the new matrix. More...
 
StaticMatrix< T, tRows, tColumns > & operator*= (const T &value)
 Multiplies this matrix with a scalar value element-wise. More...
 
operator() (const size_t row, const size_t column) const
 Returns a specified element of this matrix object. More...
 
T & operator() (const size_t row, const size_t column)
 Returns a specified element of this matrix object. More...
 
operator[] (const size_t index) const
 Returns a specified element of this matrix object. More...
 
T & operator[] (const size_t index)
 Returns a specified element of this matrix object. More...
 
OCEAN_FORCE_INLINE StaticMatrix< double, 4, 1 > operator* (const StaticMatrix< double, 4, 1 > &vector) const
 
OCEAN_FORCE_INLINE StaticMatrix< double, 4, 1 > operator* (const StaticMatrix< double, 4, 1 > &vector) const
 
OCEAN_FORCE_INLINE StaticMatrix< float, 4, 1 > operator* (const StaticMatrix< float, 4, 1 > &vector) const
 

Static Public Member Functions

static size_t rows ()
 Returns the number of rows this matrix holds. More...
 
static size_t columns ()
 Returns the number of columsn this matrix holds. More...
 
static size_t elements ()
 Returns the number of elements this matrix stores. More...
 

Private Attributes

matrixValues [tRows *tColumns]
 Matrix elements. More...
 

Detailed Description

template<typename T, size_t tRows, size_t tColumns>
class Ocean::StaticMatrix< T, tRows, tColumns >

This class implements a matrix with static dimensions.

In contrast to a dynamic matrix the size of this matrix cannot be changed because the dimension is defined as template parameter.
The elements inside the matrix are stored in a row aligned order.
A StaticMatrix<double, 2, 4> would hold 2 rows and 4 columns.

The indices of the internal elements would be:
| 0 1 2 3 |
| 4 5 6 7 |
Template Parameters
TData type of the matrix elements
tRowsNumber of rows the matrix holds
tColumnsNumber of columns this matrix holds
See also
Matrix, MatrixD, MatrixF, Matrix, SparseMatrix.

Member Typedef Documentation

◆ Type

template<typename T , size_t tRows, size_t tColumns>
typedef T Ocean::StaticMatrix< T, tRows, tColumns >::Type

Definition of the matrix element type.

Constructor & Destructor Documentation

◆ StaticMatrix() [1/5]

template<typename T , size_t tRows, size_t tColumns>
Ocean::StaticMatrix< T, tRows, tColumns >::StaticMatrix
inline

Creates a new matrix object without initializing the matrix elements.

◆ StaticMatrix() [2/5]

template<typename T , size_t tRows, size_t tColumns>
Ocean::StaticMatrix< T, tRows, tColumns >::StaticMatrix ( const T &  value)
inlineexplicit

Creates a new matrix object and sets all elements to one unique value.

Parameters
valueThe value used to initialize each elements of the new matrix

◆ StaticMatrix() [3/5]

template<typename T , size_t tRows, size_t tColumns>
Ocean::StaticMatrix< T, tRows, tColumns >::StaticMatrix ( const bool  toIdentity)
explicit

Creates a new matrix and initializes the elements of the matrix so that we receive an identity matrix or a zero matrix.

Parameters
toIdentityTrue, to initialize the matrix as identity matrix; False, to initialize the matrix as zero matrix

◆ StaticMatrix() [4/5]

template<typename T , size_t tRows, size_t tColumns>
Ocean::StaticMatrix< T, tRows, tColumns >::StaticMatrix ( const T *  values)
explicit

Creates a new matrix element and initialized the matrix elements by a given data buffer with row aligned elements.

Beware: The given buffer must be large enough.

Parameters
valuesValues to be copied to the matrix element buffer

◆ StaticMatrix() [5/5]

template<typename T , size_t tRows, size_t tColumns>
Ocean::StaticMatrix< T, tRows, tColumns >::StaticMatrix ( const T *  values,
const bool  valuesRowAligned 
)

Creates a new matrix element and initialized the matrix elements by a given data buffer.

Beware: The given buffer must be large enough.

Parameters
valuesValues to be copied to the matrix element buffer
valuesRowAlignedTrue, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order

Member Function Documentation

◆ add()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::add ( StaticMatrix< T, tRows, tColumns > &  target) const

Adds this matrix to a given matrix.

Thus, this function calculates: result += thisMatrix.

Parameters
targetThe matrix to which this matrix will be added

◆ addTransposed()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::addTransposed ( StaticMatrix< T, tColumns, tRows > &  target) const

Adds this matrix transposed to a given matrix.

Thus, this function calculates: result += thisMatrix.transposed().

Parameters
targetThe matrix to which this (transposed) matrix will be added

◆ columns()

template<typename T , size_t tRows, size_t tColumns>
size_t Ocean::StaticMatrix< T, tRows, tColumns >::columns
inlinestatic

Returns the number of columsn this matrix holds.

Returns
Matrix columns
See also
rows().

◆ data() [1/2]

template<typename T , size_t tRows, size_t tColumns>
T * Ocean::StaticMatrix< T, tRows, tColumns >::data
inline

Returns the pointer to the internal element buffer.

Returns
Matrix element buffer

◆ data() [2/2]

template<typename T , size_t tRows, size_t tColumns>
const T * Ocean::StaticMatrix< T, tRows, tColumns >::data
inline

Returns the pointer to the internal element buffer.

Returns
Matrix element buffer

◆ element() [1/2]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tRow, size_t tColumn>
T & Ocean::StaticMatrix< T, tRows, tColumns >::element
inline

Returns a pointer to a specified element.

Returns
The specified element
Template Parameters
tRowThe index of the row, with range [0, rows())
tColumnThe index of the column, with range [0, columns())

◆ element() [2/2]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tRow, size_t tColumn>
const T & Ocean::StaticMatrix< T, tRows, tColumns >::element
inline

Returns a pointer to a specified element.

Returns
The specified element
Template Parameters
tRowThe index of the row, with range [0, rows())
tColumnThe index of the column, with range [0, columns())

◆ elements()

template<typename T , size_t tRows, size_t tColumns>
size_t Ocean::StaticMatrix< T, tRows, tColumns >::elements
inlinestatic

Returns the number of elements this matrix stores.

Returns
Number of matrix elements

◆ isEqual()

template<typename T , size_t tRows, size_t tColumns>
bool Ocean::StaticMatrix< T, tRows, tColumns >::isEqual ( const StaticMatrix< T, tRows, tColumns > &  matrix,
const T  eps = NumericT<T>::eps() 
) const

Returns whether two matrices are almost identical up to a specified epsilon.

Parameters
matrixSecond matrix that will be checked
epsThe epsilon threshold to be used, with range [0, infinity)
Returns
True, if so

◆ isIdentity()

template<typename T , size_t tRows, size_t tColumns>
bool Ocean::StaticMatrix< T, tRows, tColumns >::isIdentity

Returns whether this matrix is an identity matrix.

Returns
True, if so

◆ isNull()

template<typename T , size_t tRows, size_t tColumns>
bool Ocean::StaticMatrix< T, tRows, tColumns >::isNull

Returns whether all elements of this matrix are zero.

Returns
True, if so

◆ isSymmetric()

template<typename T , size_t tRows, size_t tColumns>
bool Ocean::StaticMatrix< T, tRows, tColumns >::isSymmetric ( const T  eps = NumericT<T>::eps()) const

Returns whether this matrix is symmetric (and whether this matrix is a square matrix).

Beware: An empty matrix (without any rows or colums) is symmetric.

Parameters
epsThe epsilon threshold to be used, with range [0, infinity)
Returns
True, if so

◆ multiply() [1/3]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tColumns2>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiply ( const StaticMatrix< T, tColumns, tColumns2 > &  matrix,
const size_t  rowOffset,
T *  result 
) const
inline

Multiplies this matrix with a second matrix and assigns the results to a given buffer.

The given buffer is interpreted as if the given pointer points to the first element of a resulting matrix object.
However, after one row of the target buffer has been computed the given pointer is shifted by a given offset value.
Thus, the multiplication product may be assigned into a matrix even larger than the product matrix itself.

Parameters
matrixSecond matrix to multiply this matrix with
rowOffsetNumber of element the target pointer will be shifted after one row of the multiplication matrix has been created before the next row will be assigned
resultTarget buffer receiving the matrix result

◆ multiply() [2/3]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tColumns2>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiply ( const StaticMatrix< T, tColumns, tColumns2 > &  matrix,
StaticMatrix< T, tRows, tColumns2 > &  result 
) const
inline

Multiplies this matrix with a second matrix and assigns the results to a matrix.

This function calculates: result = this * matrix.

Parameters
matrixSecond matrix to multiply this matrix with
resultResulting multiplication matrix

◆ multiply() [3/3]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tColumns2>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiply ( const StaticMatrix< T, tColumns, tColumns2 > &  matrix,
T *  result 
) const
inline

Multiplies this matrix with a second matrix and assigns the results to a given buffer.

The given buffer is interpreted as if the given pointer points to the first element of a resulting matrix object.

Parameters
matrixSecond matrix to multiply this matrix with
resultTarget buffer receiving the matrix result

◆ multiplyWithTransposedLeft() [1/2]

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tColumns, tColumns > Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedLeft
inline

Multiplies this matrix (right) with the transposed matrix (left).

Thus, this function returns matrix.transposed() * matrix.

Returns
The multiplication result

◆ multiplyWithTransposedLeft() [2/2]

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedLeft ( StaticMatrix< T, tColumns, tColumns > &  result) const
inline

Multiplies this matrix (right) with the transposed matrix (left) and stores the result in a provided matrix.

Thus, this function calculates: result = matrix.transposed() * matrix.

Parameters
resultThe resulting matrix

◆ multiplyWithTransposedLeftAndAdd()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedLeftAndAdd ( StaticMatrix< T, tColumns, tColumns > &  target) const
inline

Multiplies this matrix (right) with the transposed matrix (left) and adds the resulting matrix to a given matrix.

Thus, this function calculates target += matrix.transposed() * matrix.

Parameters
targetThe matrix to which the result will be added

◆ multiplyWithTransposedRight() [1/2]

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tRows > Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedRight
inline

Multiplies this matrix (left) with the transposed matrix (right).

Thus, this function returns matrix * matrix.transposed().

Returns
The multiplication result

◆ multiplyWithTransposedRight() [2/2]

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedRight ( StaticMatrix< T, tRows, tRows > &  result) const
inline

Multiplies this matrix (left) with the transposed matrix (right) and stores the result in a provided matrix.

Thus, this function calculates: result = matrix * matrix.transposed().

Parameters
resultThe resulting matrix

◆ multiplyWithTransposedRightAndAdd()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::multiplyWithTransposedRightAndAdd ( StaticMatrix< T, tRows, tRows > &  target) const
inline

Multiplies this matrix (left) with the transposed matrix (right) and adds the resulting matrix to a given matrix.

Thus, this function calculates target += matrix * matrix.transposed().

Parameters
targetThe matrix to which the result will be added

◆ operator()() [1/2]

template<typename T , size_t tRows, size_t tColumns>
T & Ocean::StaticMatrix< T, tRows, tColumns >::operator() ( const size_t  row,
const size_t  column 
)
inline

Returns a specified element of this matrix object.


Parameters
rowRow of the element to be returned, with range [0, rows())
columnColumn of the element to be returned, with range [0, columns())
Returns
Specified matrix element

◆ operator()() [2/2]

template<typename T , size_t tRows, size_t tColumns>
T Ocean::StaticMatrix< T, tRows, tColumns >::operator() ( const size_t  row,
const size_t  column 
) const
inline

Returns a specified element of this matrix object.


Parameters
rowRow of the element to be returned, with range [0, rows())
columnColumn of the element to be returned, with range [0, columns())
Returns
Specified matrix element

◆ operator*() [1/5]

OCEAN_FORCE_INLINE StaticMatrix< double, 4, 1 > Ocean::StaticMatrix< double, 4, 4 >::operator* ( const StaticMatrix< double, 4, 1 > &  vector) const

◆ operator*() [2/5]

OCEAN_FORCE_INLINE StaticMatrix< double, 4, 1 > Ocean::StaticMatrix< double, 4, 4 >::operator* ( const StaticMatrix< double, 4, 1 > &  vector) const

◆ operator*() [3/5]

OCEAN_FORCE_INLINE StaticMatrix< float, 4, 1 > Ocean::StaticMatrix< float, 4, 4 >::operator* ( const StaticMatrix< float, 4, 1 > &  vector) const

◆ operator*() [4/5]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tColumns2>
StaticMatrix< T, tRows, tColumns2 > Ocean::StaticMatrix< T, tRows, tColumns >::operator* ( const StaticMatrix< T, tColumns, tColumns2 > &  matrix) const
inline

Multiplies this matrix with a second matrix objects and returns the result.

Parameters
matrixMatrix to be multiplied with this matrix
Returns
New resulting product matrix

◆ operator*() [5/5]

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > Ocean::StaticMatrix< T, tRows, tColumns >::operator* ( const T &  value) const
inline

Multiplies this matrix with a scalar value element-wise and returns the new matrix.

Parameters
valueScalar value to multiply each element with
Returns
Resulting new matrix

◆ operator*=()

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > & Ocean::StaticMatrix< T, tRows, tColumns >::operator*= ( const T &  value)
inline

Multiplies this matrix with a scalar value element-wise.

Parameters
valueScalar value to multiply each element with
Returns
Reference to this (multiplied) matrix

◆ operator+()

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > Ocean::StaticMatrix< T, tRows, tColumns >::operator+ ( const StaticMatrix< T, tRows, tColumns > &  matrix) const
inline

Adds a given matrix to this matrix.

Parameters
matrixMatrix to be added to this matrix
Returns
The resulting sum matrix

◆ operator+=()

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > & Ocean::StaticMatrix< T, tRows, tColumns >::operator+= ( const StaticMatrix< T, tRows, tColumns > &  matrix)
inline

Adds a given matrix to this matrix.

Parameters
matrixMatrix to be added to this matrix
Returns
Reference to this (modified) matrix

◆ operator-()

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > Ocean::StaticMatrix< T, tRows, tColumns >::operator- ( const StaticMatrix< T, tRows, tColumns > &  matrix) const
inline

Subtracts a given matrix from this matrix.

Parameters
matrixMatrix to be subtracted from this matrix
Returns
The resulting matrix

◆ operator-=()

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tRows, tColumns > & Ocean::StaticMatrix< T, tRows, tColumns >::operator-= ( const StaticMatrix< T, tRows, tColumns > &  matrix)
inline

Subtracts a given matrix from this matrix.

Parameters
matrixMatrix to be subtracted from this matrix
Returns
Reference to this (modified) matrix

◆ operator[]() [1/2]

template<typename T , size_t tRows, size_t tColumns>
T & Ocean::StaticMatrix< T, tRows, tColumns >::operator[] ( const size_t  index)
inline

Returns a specified element of this matrix object.


The element index must be defined regarding to the row aligned element order of this matrix.

Parameters
indexIndex of the matrix element to return, with range [0, rows() * columns())
Returns
Specified matrix element

◆ operator[]() [2/2]

template<typename T , size_t tRows, size_t tColumns>
T Ocean::StaticMatrix< T, tRows, tColumns >::operator[] ( const size_t  index) const
inline

Returns a specified element of this matrix object.


The element index must be defined regarding to the row aligned element order of this matrix.

Parameters
indexIndex of the matrix element to return, with range [0, rows() * columns())
Returns
Specified matrix element

◆ row() [1/4]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tIndex>
T * Ocean::StaticMatrix< T, tRows, tColumns >::row
inline

Returns a pointer to a specified row.

Returns
The pointer to the first element in the specified row of the matrix
Template Parameters
tIndexThe index of the row, with range [0, rows())

◆ row() [2/4]

template<typename T , size_t tRows, size_t tColumns>
template<size_t tIndex>
const T * Ocean::StaticMatrix< T, tRows, tColumns >::row
inline

Returns a pointer to a specified row.

Returns
The pointer to the first element in the specified row of the matrix
Template Parameters
tIndexThe index of the row, with range [0, rows())

◆ row() [3/4]

template<typename T , size_t tRows, size_t tColumns>
T * Ocean::StaticMatrix< T, tRows, tColumns >::row ( const size_t  index)
inline

Returns a pointer to a specified row.

Parameters
indexThe index of the row, with range [0, rows())
Returns
The pointer to the first element in the specified row of the matrix

◆ row() [4/4]

template<typename T , size_t tRows, size_t tColumns>
const T * Ocean::StaticMatrix< T, tRows, tColumns >::row ( const size_t  index) const
inline

Returns a pointer to a specified row.

Parameters
indexThe index of the row, with range [0, rows())
Returns
The pointer to the first element in the specified row of the matrix

◆ rows()

template<typename T , size_t tRows, size_t tColumns>
size_t Ocean::StaticMatrix< T, tRows, tColumns >::rows
inlinestatic

Returns the number of rows this matrix holds.

Returns
Matrix rows
See also
columns().

◆ setData()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::setData ( const T *  values,
const bool  valuesRowAligned 
)
inline

Sets the elements of this matrix by copying the values from a given buffer.

Parameters
valuesThe elements to set, ensure that enough values are provided
valuesRowAlignedTrue, if the given values are stored in a row aligned order; False, if the values are stored in a column aligned order

◆ solveCholesky()

template<typename T , size_t tRows, size_t tColumns>
bool Ocean::StaticMatrix< T, tRows, tColumns >::solveCholesky ( const StaticMatrix< T, tRows, 1 > &  vectorB,
StaticMatrix< T, tRows, 1 > &  vectorX 
) const

Solves the given linear system by application of the cholesky distribution.

M * x = b, with M and b known.
This matrix is M and M must be a symmetric positive-definite matrix, the given vector is b and the result will be x.

Parameters
vectorBVector defining the linear system, with size tRows x 1
vectorXSolution vector receiving the solution if existing, ensure that the number of elements is equal to tRows x 1
Returns
True, if succeeded
See also
isSymmetric().

◆ toNull()

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::toNull
inline

Sets the matrix to a zero matrix.

See also
isNull();

◆ transposed() [1/2]

template<typename T , size_t tRows, size_t tColumns>
StaticMatrix< T, tColumns, tRows > Ocean::StaticMatrix< T, tRows, tColumns >::transposed
inline

Returns the transposed matrix of this matrix.

Returns
The transposed matrix

◆ transposed() [2/2]

template<typename T , size_t tRows, size_t tColumns>
void Ocean::StaticMatrix< T, tRows, tColumns >::transposed ( StaticMatrix< T, tColumns, tRows > &  result) const
inline

Transposes this matrix.

Parameters
resultThe resulting transposed matrix

Field Documentation

◆ matrixValues

template<typename T , size_t tRows, size_t tColumns>
T Ocean::StaticMatrix< T, tRows, tColumns >::matrixValues[tRows *tColumns]
private

Matrix elements.


The documentation for this class was generated from the following file: