ug4
Matrix

Classes

class  ug::MathMatrix< N, M, T >
 A class for fixed size, dense matrices. More...
 
class  ug::MathMatrix< 0, 0, T >
 
class  ug::MathMatrix< 0, N, T >
 
class  ug::MathMatrix< N, 0, T >
 
class  ug::MathSymmetricMatrix< N, T >
 A class for fixed size, dense matrices. More...
 

Typedefs

typedef std::size_t ug::MathSymmetricMatrix< N, T >::size_type
 
typedef T ug::MathSymmetricMatrix< N, T >::value_type
 

Functions

void ug::MathSymmetricMatrix< N, T >::assign (const MathSymmetricMatrix &v)
 
value_typeug::MathSymmetricMatrix< N, T >::entry (std::size_t row, std::size_t col)
 
const value_typeug::MathSymmetricMatrix< N, T >::entry (std::size_t row, std::size_t col) const
 
value_type ug::MathSymmetricMatrix< N, T >::fnorm ()
 
template<typename matrix_t >
void ug::MatAdd (matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
 Add a scalar to a matrix (componentwise) More...
 
template<typename matrix_t >
void ug::MatAdd (matrix_t &mOut, const matrix_t &m1, const matrix_t &m2)
 adds two matrices and stores the result in a third one More...
 
template<typename matrix_t >
matrix_t::value_type ug::MatContraction (const matrix_t &m1, const matrix_t &m2)
 
template<typename matrix_t >
matrix_t::value_type ug::MatDeviatorTrace (const matrix_t &m, matrix_t &dev)
 
template<typename matrix_t >
void ug::MatDiagSet (matrix_t &mInOut, typename matrix_t::value_type s)
 Set diagonal entries of a matrix to a scalar (other entries are not changed) More...
 
template<typename matrix_t >
void ug::MatDivide (matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
 Devide a matrix by a scalar (componentwise) More...
 
template<typename matrix_t >
matrix_t::value_type ug::MatFrobeniusNorm (matrix_t &m)
 
template<typename matrix_t >
matrix_t::value_type ug::MatFrobeniusNormSq (matrix_t &m)
 
template<typename matrix_t , typename vector_t >
void ug::MatHouseholder (matrix_t &mOut, const vector_t &orthoVec)
 
 ug::MathSymmetricMatrix< N, T >::MathSymmetricMatrix ()
 
 ug::MathSymmetricMatrix< N, T >::MathSymmetricMatrix (const MathSymmetricMatrix &v)
 
template<typename matrix_t >
void ug::MatIdentity (matrix_t &mOut)
 Fills the matrix with the identity matrix. More...
 
template<typename matrix_t >
matrix_t::value_type ug::MatInftyNorm (matrix_t &m)
 
template<typename matrix_t >
matrix_t::value_type ug::MatMaxNorm (matrix_t &m)
 
template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiply (MathMatrix< N, M, T > &mOut, const MathMatrix< N, L, T > &m1, const MathMatrix< L, M, T > &m2)
 multiply two matrices and stores the result in a third one More...
 
template<size_t N, size_t M, size_t L, size_t P, typename T >
void ug::MatMultiply (MathMatrix< N, M, T > &mOut, const MathMatrix< N, L, T > &m1, const MathMatrix< L, P, T > &m2, const MathMatrix< P, M, T > &m3)
 multiply three matrices and stores the result in a fourth one More...
 
template<typename matrix_t >
void ug::MatMultiply (matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
 Multiply a matrix by a scalar (componentwise) More...
 
template<size_t N, size_t M, typename T >
void ug::MatMultiplyMBMT (MathMatrix< N, N, T > &mOut, const MathMatrix< N, M, T > &m1, const MathMatrix< M, M, T > &m2)
 
template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyMBT (MathMatrix< N, M, T > &mOut, const MathMatrix< N, L, T > &m1, const MathMatrix< M, L, T > &m2)
 multiply a matrix with the transposed of a second one and stores the result in mOut More...
 
template<size_t N, size_t M, typename T >
void ug::MatMultiplyMMT (MathMatrix< M, M, T > &mOut, const MathMatrix< M, N, T > &m)
 multiply a matrix with its transposed and stores the result in a second one More...
 
template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyMTB (MathMatrix< N, M, T > &mOut, const MathMatrix< L, N, T > &m1, const MathMatrix< L, M, T > &m2)
 multiply the transposed of a matrix with a matrix and stores the result in mOut More...
 
template<size_t N, size_t M, typename T >
void ug::MatMultiplyMTBM (MathMatrix< N, N, T > &mOut, const MathMatrix< M, N, T > &m1, const MathMatrix< M, M, T > &m2)
 
template<size_t N, size_t M, typename T >
void ug::MatMultiplyMTM (MathMatrix< N, N, T > &mOut, const MathMatrix< M, N, T > &m)
 multiply a transposed matrix with itself and stores the result in a second one More...
 
template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyTransposed (MathMatrix< N, M, T > &mOut, const MathMatrix< L, N, T > &m1, const MathMatrix< M, L, T > &m2)
 multiply two transposed matrices and stores the result in a third one More...
 
template<typename matrix_t >
matrix_t::value_type ug::MatOneNorm (matrix_t &m)
 
template<typename matrix_t >
void ug::MatRotationX (matrix_t &mOut, typename matrix_t::value_type rads)
 Fills the matrix with a matrix that rotates around the x-axis in 3 dimensions. More...
 
template<typename matrix_t >
void ug::MatRotationY (matrix_t &mOut, typename matrix_t::value_type rads)
 Fills the matrix with a matrix that rotates around the y-axis in 3 dimensions. More...
 
template<typename matrix_t >
void ug::MatRotationYawPitchRoll (matrix_t &mOut, typename matrix_t::value_type yaw, typename matrix_t::value_type pitch, typename matrix_t::value_type roll)
 Creates a rotation matrix given yaw, pitch and roll in radiants. More...
 
template<typename matrix_t >
void ug::MatRotationZ (matrix_t &mOut, typename matrix_t::value_type rads)
 Fills the matrix with a matrix that rotates around the y-axis in 2 or 3 dimensions. More...
 
template<typename matrix_t >
void ug::MatScale (matrix_t &mOut, typename matrix_t::value_type s, const matrix_t &m)
 scales a matrix_t More...
 
template<typename matrix_t >
void ug::MatScaleAppend (matrix_t &mOut, typename matrix_t::value_type s, const matrix_t &m)
 scales a matrix_t and adds to result to a second matrix More...
 
template<typename matrix_t >
void ug::MatSet (matrix_t &mInOut, typename matrix_t::value_type s)
 Set each matrix entry to a scalar (componentwise) More...
 
template<typename matrix_t >
void ug::MatSubtract (matrix_t &mOut, const matrix_t &m, typename matrix_t::value_type s)
 Subtract a scalar from a matrix (componentwise) More...
 
template<typename matrix_t >
void ug::MatSubtract (matrix_t &mOut, const matrix_t &m1, const matrix_t &m2)
 subtracts m2 from m1 and stores the result in a mOut More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::MaxAbsEigenvalue (const MathMatrix< M, N, T > &m)
 Computes maximum eigenvalue of a (symmetric) matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::MinAbsEigenvalue (const MathMatrix< M, N, T > &m)
 Computes minimum eigenvalue of a (symmetric) matrix. More...
 
std::size_t ug::MathSymmetricMatrix< N, T >::num_cols () const
 
std::size_t ug::MathSymmetricMatrix< N, T >::num_rows () const
 
value_typeug::MathSymmetricMatrix< N, T >::operator() (std::size_t row, std::size_t col)
 
const value_typeug::MathSymmetricMatrix< N, T >::operator() (std::size_t row, std::size_t col) const
 
value_type ug::MathSymmetricMatrix< N, T >::operator* (const MathSymmetricMatrix &v) const
 Multiplies the matrix element-wise with another matrix and sums up the entries. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator*= (const value_type &val)
 Multiplies all elements of the matrix with the given value. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator+= (const MathSymmetricMatrix &B)
 Adds a matrix to 'this' one: \( A_{this} \leftarrow A_{this} + B\). More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator+= (const value_type &val)
 Adds the given value to all elements of the matrix. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator-= (const MathSymmetricMatrix &B)
 Subtracts a matrix from 'this' one: \( A_{this} \leftarrow A_{this} - B\). More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator-= (const value_type &val)
 Subtracts the given value from all elements of the matrix. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator/= (const value_type &val)
 Divides all elements of the matrix by the given value. More...
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathMatrix< 2, 3 > &m)
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathMatrix< 3, 2 > &m)
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathMatrix< 3, 3 > &m)
 
template<std::size_t N, std::size_t M>
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathMatrix< N, M > &m)
 Print MathMatrix<N,M> to standard output. More...
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathSymmetricMatrix< 2 > &m)
 
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathSymmetricMatrix< 3 > &m)
 
template<std::size_t N>
std::ostream & ug::operator<< (std::ostream &outStream, const ug::MathSymmetricMatrix< N > &m)
 Print MathSymmetricMatrix<N> to standard output. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator= (const MathSymmetricMatrix &v)
 Assigns the elements of the given matrix to this one. More...
 
MathSymmetricMatrixug::MathSymmetricMatrix< N, T >::operator= (const value_type &val)
 Assigns the given value to all elements of the matrix. More...
 
value_typeug::MathSymmetricMatrix< N, T >::operator[] (std::size_t index)
 
const value_typeug::MathSymmetricMatrix< N, T >::operator[] (std::size_t index) const
 
void ug::MathSymmetricMatrix< N, T >::scale_by_fnorm ()
 
template<size_t N, size_t M, typename T >
void ug::Transpose (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 transpose a matrix More...
 
template<typename matrix_t >
void ug::Transpose (matrix_t &m)
 transpose a matrix_t, override original matrix_t More...
 

Variables

static const std::size_t ug::MathSymmetricMatrix< N, T >::ColSize = N
 
value_type ug::MathSymmetricMatrix< N, T >::m_data [m_size]
 
static const size_t ug::MathSymmetricMatrix< N, T >::m_size = (size_t)((N*N+N)/2)
 
static const std::size_t ug::MathSymmetricMatrix< N, T >::RowSize = N
 
template<size_t N, typename T >
MathMatrix< N, N, T >::value_type ug::Determinant (const MathMatrix< N, N, T > &m)
 Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Determinant (const MathMatrix< 1, 1, T > &m)
 Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Determinant (const MathMatrix< 2, 2, T > &m)
 Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Determinant (const MathMatrix< 3, 3, T > &m)
 Determinant of a matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::GramDeterminant (const MathMatrix< N, M, T > &m)
 Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::GramDeterminant (const MathMatrix< 1, 1, T > &m)
 Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::GramDeterminant (const MathMatrix< 2, 2, T > &m)
 Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::GramDeterminant (const MathMatrix< 3, 3, T > &m)
 Gram Determinant of a matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::SqrtGramDeterminant (const MathMatrix< N, M, T > &m)
 Square root of Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::SqrtGramDeterminant (const MathMatrix< 1, 1, T > &m)
 Square root of Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::SqrtGramDeterminant (const MathMatrix< 2, 2, T > &m)
 Square root of Gram Determinant of a matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::SqrtGramDeterminant (const MathMatrix< 3, 3, T > &m)
 Square root of Gram Determinant of a matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::Inverse (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 Inverse of a matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Inverse (MathMatrix< 1, 1, T > &mOut, const MathMatrix< 1, 1, T > &m)
 Inverse of a matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Inverse (MathMatrix< 2, 2, T > &mOut, const MathMatrix< 2, 2, T > &m)
 Inverse of a matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Inverse (MathMatrix< 3, 3, T > &mOut, const MathMatrix< 3, 3, T > &m)
 Inverse of a matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::InverseTransposed (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix) More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::InverseTransposed (MathMatrix< 1, 1, T > &mOut, const MathMatrix< 1, 1, T > &m)
 Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix) More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::InverseTransposed (MathMatrix< 2, 2, T > &mOut, const MathMatrix< 2, 2, T > &m)
 Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix) More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::InverseTransposed (MathMatrix< 3, 3, T > &mOut, const MathMatrix< 3, 3, T > &m)
 Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix) More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::RightInverse (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 Right-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::RightInverse (MathMatrix< 1, 1 > &mOut, const MathMatrix< 1, 1 > &m)
 Right-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::RightInverse (MathMatrix< 2, 2 > &mOut, const MathMatrix< 2, 2 > &m)
 Right-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::RightInverse (MathMatrix< 3, 3 > &mOut, const MathMatrix< 3, 3 > &m)
 Right-Inverse of a Matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::LeftInverse (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 Left-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::LeftInverse (MathMatrix< 1, 1 > &mOut, const MathMatrix< 1, 1 > &m)
 Left-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::LeftInverse (MathMatrix< 2, 2 > &mOut, const MathMatrix< 2, 2 > &m)
 Left-Inverse of a Matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::LeftInverse (MathMatrix< 3, 3 > &mOut, const MathMatrix< 3, 3 > &m)
 Left-Inverse of a Matrix. More...
 
template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::GeneralizedInverse (MathMatrix< N, M, T > &mOut, const MathMatrix< M, N, T > &m)
 
template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Trace (const MathMatrix< 1, 1, T > &m)
 Trace of a Matrix. More...
 
template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Trace (const MathMatrix< 2, 2, T > &m)
 Trace of a Matrix. More...
 
template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Trace (const MathMatrix< 3, 3, T > &m)
 Trace of a Matrix. More...
 

Detailed Description

Typedef Documentation

◆ size_type

template<std::size_t N, typename T = number>
typedef std::size_t ug::MathSymmetricMatrix< N, T >::size_type

◆ value_type

template<std::size_t N, typename T = number>
typedef T ug::MathSymmetricMatrix< N, T >::value_type

Function Documentation

◆ assign()

template<std::size_t N, typename T = number>
void ug::MathSymmetricMatrix< N, T >::assign ( const MathSymmetricMatrix< N, T > &  v)
inlineprotected

◆ Determinant() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Determinant ( const MathMatrix< 1, 1, T > &  m)
inline

Determinant of a matrix.

Returns the Determinate of a matrix.

Parameters
mMatrix
Returns
determinant of matrix

◆ Determinant() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Determinant ( const MathMatrix< 2, 2, T > &  m)
inline

Determinant of a matrix.

Returns the Determinate of a matrix.

Parameters
mMatrix
Returns
determinant of matrix

◆ Determinant() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Determinant ( const MathMatrix< 3, 3, T > &  m)
inline

Determinant of a matrix.

Returns the Determinate of a matrix.

Parameters
mMatrix
Returns
determinant of matrix

◆ Determinant() [4/4]

template<size_t N, typename T >
MathMatrix< N, N, T >::value_type ug::Determinant ( const MathMatrix< N, N, T > &  m)
inline

Determinant of a matrix.

Returns the Determinate of a matrix.

Parameters
mMatrix
Returns
determinant of matrix

References UG_THROW.

Referenced by ug::GramDeterminant(), ug::Inverse(), ug::InverseTransposed(), ug::RayRayIntersection2d(), and ug::SqrtGramDeterminant().

◆ entry() [1/2]

template<std::size_t N, typename T = number>
value_type& ug::MathSymmetricMatrix< N, T >::entry ( std::size_t  row,
std::size_t  col 
)
inline

◆ entry() [2/2]

template<std::size_t N, typename T = number>
const value_type& ug::MathSymmetricMatrix< N, T >::entry ( std::size_t  row,
std::size_t  col 
) const
inline

◆ fnorm()

template<std::size_t N, typename T = number>
value_type ug::MathSymmetricMatrix< N, T >::fnorm ( )
inline

◆ GeneralizedInverse()

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::GeneralizedInverse ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

Computes the pseudo-Inverse of a MxN Matrix (N!=M) and returns the square root of the gram determinate or the inverse of a matrix (M=N) and returns the determinante.

For M<N, Right-Inverse of Matrix For M>N, Left-Inverse of Matrix For M=N, Inverse of Matrix

Parameters
mOut(pseundo)-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix or determinate

References ug::Inverse(), ug::LeftInverse(), and ug::RightInverse().

◆ GramDeterminant() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::GramDeterminant ( const MathMatrix< 1, 1, T > &  m)
inline

Gram Determinant of a matrix.

Returns Gram Determinant of a matrix, i.e. \( \det(M M^T) \).

Parameters
mMatrix
Returns
gram determinant of matrix

References ug::Determinant().

◆ GramDeterminant() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::GramDeterminant ( const MathMatrix< 2, 2, T > &  m)
inline

Gram Determinant of a matrix.

Returns Gram Determinant of a matrix, i.e. \( \det(M M^T) \).

Parameters
mMatrix
Returns
gram determinant of matrix

References ug::Determinant().

◆ GramDeterminant() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::GramDeterminant ( const MathMatrix< 3, 3, T > &  m)
inline

Gram Determinant of a matrix.

Returns Gram Determinant of a matrix, i.e. \( \det(M M^T) \).

Parameters
mMatrix
Returns
gram determinant of matrix

References ug::Determinant().

◆ GramDeterminant() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::GramDeterminant ( const MathMatrix< N, M, T > &  m)
inline

Gram Determinant of a matrix.

Returns Gram Determinant of a matrix, i.e. \( \det(M M^T) \).

Parameters
mMatrix
Returns
gram determinant of matrix

References ug::Determinant(), ug::MatMultiplyMMT(), and ug::MatMultiplyMTM().

Referenced by ug::SqrtGramDeterminant().

◆ Inverse() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Inverse ( MathMatrix< 1, 1, T > &  mOut,
const MathMatrix< 1, 1, T > &  m 
)
inline

Inverse of a matrix.

Computes the inverse of a matrix and returns the determinante.

Parameters
mOutInverse of Matrix
mMatrix
Returns
Determinate of Matrix

References UG_ASSERT.

◆ Inverse() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Inverse ( MathMatrix< 2, 2, T > &  mOut,
const MathMatrix< 2, 2, T > &  m 
)
inline

Inverse of a matrix.

Computes the inverse of a matrix and returns the determinante.

Parameters
mOutInverse of Matrix
mMatrix
Returns
Determinate of Matrix

References ug::Determinant(), and UG_ASSERT.

◆ Inverse() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Inverse ( MathMatrix< 3, 3, T > &  mOut,
const MathMatrix< 3, 3, T > &  m 
)
inline

Inverse of a matrix.

Computes the inverse of a matrix and returns the determinante.

Parameters
mOutInverse of Matrix
mMatrix
Returns
Determinate of Matrix

References ug::Determinant(), and UG_ASSERT.

◆ Inverse() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::Inverse ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

Inverse of a matrix.

Computes the inverse of a matrix and returns the determinante.

Parameters
mOutInverse of Matrix
mMatrix
Returns
Determinate of Matrix

References UG_THROW.

Referenced by ug::GradientDataExport< dim >::eval_and_deriv(), ug::ExplicitGridFunctionGradient< TGridFunction >::evaluate(), ug::GeneralizedInverse(), ug::IntegralNormalComponentOnManifoldUsingFV1Geom(), ug::InverseTransposed(), ug::LeftInverse(), ug::MinAbsEigenvalue(), ug::RayRayIntersection2d(), and ug::RightInverse().

◆ InverseTransposed() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::InverseTransposed ( MathMatrix< 1, 1, T > &  mOut,
const MathMatrix< 1, 1, T > &  m 
)
inline

Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix)

Computes the Inverse-Transposed of a Matrix and returns the Determinant.

Parameters
mOutInverse-Transposed of Matrix
mMatrix
Returns
Determinant of Matrix

References ug::Inverse().

◆ InverseTransposed() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::InverseTransposed ( MathMatrix< 2, 2, T > &  mOut,
const MathMatrix< 2, 2, T > &  m 
)
inline

Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix)

Computes the Inverse-Transposed of a Matrix and returns the Determinant.

Parameters
mOutInverse-Transposed of Matrix
mMatrix
Returns
Determinant of Matrix

References ug::Determinant(), and UG_ASSERT.

◆ InverseTransposed() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::InverseTransposed ( MathMatrix< 3, 3, T > &  mOut,
const MathMatrix< 3, 3, T > &  m 
)
inline

Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix)

Computes the Inverse-Transposed of a Matrix and returns the Determinant.

Parameters
mOutInverse-Transposed of Matrix
mMatrix
Returns
Determinant of Matrix

References ug::Determinant(), and UG_ASSERT.

◆ InverseTransposed() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::InverseTransposed ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

Transposed-Inverse of a Matrix (= Inverse-Transposed of a Matrix)

Computes the Inverse-Transposed of a Matrix and returns the Determinant.

Parameters
mOutInverse-Transposed of Matrix
mMatrix
Returns
Determinant of Matrix

References UG_THROW.

◆ LeftInverse() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::LeftInverse ( MathMatrix< 1, 1 > &  mOut,
const MathMatrix< 1, 1 > &  m 
)
inline

Left-Inverse of a Matrix.

Computes the Left-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \geq N \)) the Left-Inverse is defined as

\[ A^{-1}_{left} := (A^T A)^{-1} A^T, \]

such that \( A^{-1}_{left} A = 1 \). The gram determinate is defined as \( \det{A^T A} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Left- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutLeft-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ LeftInverse() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::LeftInverse ( MathMatrix< 2, 2 > &  mOut,
const MathMatrix< 2, 2 > &  m 
)
inline

Left-Inverse of a Matrix.

Computes the Left-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \geq N \)) the Left-Inverse is defined as

\[ A^{-1}_{left} := (A^T A)^{-1} A^T, \]

such that \( A^{-1}_{left} A = 1 \). The gram determinate is defined as \( \det{A^T A} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Left- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutLeft-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ LeftInverse() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::LeftInverse ( MathMatrix< 3, 3 > &  mOut,
const MathMatrix< 3, 3 > &  m 
)
inline

Left-Inverse of a Matrix.

Computes the Left-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \geq N \)) the Left-Inverse is defined as

\[ A^{-1}_{left} := (A^T A)^{-1} A^T, \]

such that \( A^{-1}_{left} A = 1 \). The gram determinate is defined as \( \det{A^T A} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Left- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutLeft-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ LeftInverse() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::LeftInverse ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

Left-Inverse of a Matrix.

Computes the Left-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \geq N \)) the Left-Inverse is defined as

\[ A^{-1}_{left} := (A^T A)^{-1} A^T, \]

such that \( A^{-1}_{left} A = 1 \). The gram determinate is defined as \( \det{A^T A} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Left- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutLeft-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse(), ug::MatMultiplyMTM(), ug::MatMultiplyTransposed(), and UG_THROW.

Referenced by ug::GeneralizedInverse(), and ug::BaseReferenceMapping< dim, worldDim, isLinear, TImpl >::global_to_local().

◆ MatAdd() [1/2]

template<typename matrix_t >
void ug::MatAdd ( matrix_t &  mOut,
const matrix_t &  m,
typename matrix_t::value_type  s 
)
inline

Add a scalar to a matrix (componentwise)

References s.

◆ MatAdd() [2/2]

template<typename matrix_t >
void ug::MatAdd ( matrix_t &  mOut,
const matrix_t &  m1,
const matrix_t &  m2 
)
inline

adds two matrices and stores the result in a third one

Referenced by ug::MatAdd().

◆ MatContraction()

template<typename matrix_t >
matrix_t::value_type ug::MatContraction ( const matrix_t &  m1,
const matrix_t &  m2 
)
inline

◆ MatDeviatorTrace()

template<typename matrix_t >
matrix_t::value_type ug::MatDeviatorTrace ( const matrix_t &  m,
matrix_t &  dev 
)
inline

References ug::Trace().

◆ MatDiagSet()

template<typename matrix_t >
void ug::MatDiagSet ( matrix_t &  mInOut,
typename matrix_t::value_type  s 
)
inline

Set diagonal entries of a matrix to a scalar (other entries are not changed)

References s.

Referenced by ug::MatIdentity().

◆ MatDivide()

template<typename matrix_t >
void ug::MatDivide ( matrix_t &  mOut,
const matrix_t &  m,
typename matrix_t::value_type  s 
)
inline

Devide a matrix by a scalar (componentwise)

References s.

◆ MatFrobeniusNorm()

template<typename matrix_t >
matrix_t::value_type ug::MatFrobeniusNorm ( matrix_t &  m)
inline

◆ MatFrobeniusNormSq()

template<typename matrix_t >
matrix_t::value_type ug::MatFrobeniusNormSq ( matrix_t &  m)
inline

Referenced by ug::MatFrobeniusNorm().

◆ MatHouseholder()

template<typename matrix_t , typename vector_t >
void ug::MatHouseholder ( matrix_t &  mOut,
const vector_t &  orthoVec 
)
inline

Creates a householder matrix given the orthogonal vector to the householder-hypersphere through the origin.

References ug::VecDot().

Referenced by ug::ObstacleInNormalDir< TDomain, TAlgebra >::transform_eulerian_coord_sys().

◆ MathSymmetricMatrix() [1/2]

template<std::size_t N, typename T = number>
ug::MathSymmetricMatrix< N, T >::MathSymmetricMatrix ( )
inline

◆ MathSymmetricMatrix() [2/2]

template<std::size_t N, typename T = number>
ug::MathSymmetricMatrix< N, T >::MathSymmetricMatrix ( const MathSymmetricMatrix< N, T > &  v)
inline

◆ MatIdentity()

template<typename matrix_t >
void ug::MatIdentity ( matrix_t &  mOut)
inline

Fills the matrix with the identity matrix.

References ug::MatDiagSet(), and ug::MatSet().

Referenced by ug::MatRotationX(), ug::MatRotationY(), and ug::MatRotationZ().

◆ MatInftyNorm()

template<typename matrix_t >
matrix_t::value_type ug::MatInftyNorm ( matrix_t &  m)
inline

◆ MatMaxNorm()

template<typename matrix_t >
matrix_t::value_type ug::MatMaxNorm ( matrix_t &  m)
inline

◆ MatMultiply() [1/3]

template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiply ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< N, L, T > &  m1,
const MathMatrix< L, M, T > &  m2 
)
inline

multiply two matrices and stores the result in a third one

Referenced by ug::MatRotationYawPitchRoll().

◆ MatMultiply() [2/3]

template<size_t N, size_t M, size_t L, size_t P, typename T >
void ug::MatMultiply ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< N, L, T > &  m1,
const MathMatrix< L, P, T > &  m2,
const MathMatrix< P, M, T > &  m3 
)
inline

multiply three matrices and stores the result in a fourth one

◆ MatMultiply() [3/3]

template<typename matrix_t >
void ug::MatMultiply ( matrix_t &  mOut,
const matrix_t &  m,
typename matrix_t::value_type  s 
)
inline

Multiply a matrix by a scalar (componentwise)

References s.

◆ MatMultiplyMBMT()

template<size_t N, size_t M, typename T >
void ug::MatMultiplyMBMT ( MathMatrix< N, N, T > &  mOut,
const MathMatrix< N, M, T > &  m1,
const MathMatrix< M, M, T > &  m2 
)
inline

multiply a matrix m2 with a matrix m1 from left and its transpose m1^T from right and stores the result in mOut

◆ MatMultiplyMBT()

template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyMBT ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< N, L, T > &  m1,
const MathMatrix< M, L, T > &  m2 
)
inline

multiply a matrix with the transposed of a second one and stores the result in mOut

◆ MatMultiplyMMT()

template<size_t N, size_t M, typename T >
void ug::MatMultiplyMMT ( MathMatrix< M, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

multiply a matrix with its transposed and stores the result in a second one

Referenced by ug::GramDeterminant(), and ug::RightInverse().

◆ MatMultiplyMTB()

template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyMTB ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< L, N, T > &  m1,
const MathMatrix< L, M, T > &  m2 
)
inline

multiply the transposed of a matrix with a matrix and stores the result in mOut

◆ MatMultiplyMTBM()

template<size_t N, size_t M, typename T >
void ug::MatMultiplyMTBM ( MathMatrix< N, N, T > &  mOut,
const MathMatrix< M, N, T > &  m1,
const MathMatrix< M, M, T > &  m2 
)
inline

multiply a matrix m2 with a matrix m1 from right and its transpose m1^T from left and stores the result in mOut

◆ MatMultiplyMTM()

template<size_t N, size_t M, typename T >
void ug::MatMultiplyMTM ( MathMatrix< N, N, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

multiply a transposed matrix with itself and stores the result in a second one

Referenced by ug::GramDeterminant(), and ug::LeftInverse().

◆ MatMultiplyTransposed()

template<size_t N, size_t M, size_t L, typename T >
void ug::MatMultiplyTransposed ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< L, N, T > &  m1,
const MathMatrix< M, L, T > &  m2 
)
inline

multiply two transposed matrices and stores the result in a third one

Referenced by ug::LeftInverse(), and ug::RightInverse().

◆ MatOneNorm()

template<typename matrix_t >
matrix_t::value_type ug::MatOneNorm ( matrix_t &  m)
inline

◆ MatRotationX()

template<typename matrix_t >
void ug::MatRotationX ( matrix_t &  mOut,
typename matrix_t::value_type  rads 
)
inline

Fills the matrix with a matrix that rotates around the x-axis in 3 dimensions.

matrix_t has to have at least 3 rows and 3 columns. Rotation is specified in radiants.

References ug::MatIdentity(), and s.

Referenced by ug::MatRotationYawPitchRoll().

◆ MatRotationY()

template<typename matrix_t >
void ug::MatRotationY ( matrix_t &  mOut,
typename matrix_t::value_type  rads 
)
inline

Fills the matrix with a matrix that rotates around the y-axis in 3 dimensions.

matrix_t has to have at least 3 rows and 3 columns. Rotation is specified in radiants.

References ug::MatIdentity(), and s.

Referenced by ug::MatRotationYawPitchRoll().

◆ MatRotationYawPitchRoll()

template<typename matrix_t >
void ug::MatRotationYawPitchRoll ( matrix_t &  mOut,
typename matrix_t::value_type  yaw,
typename matrix_t::value_type  pitch,
typename matrix_t::value_type  roll 
)
inline

Creates a rotation matrix given yaw, pitch and roll in radiants.

References ug::MatMultiply(), ug::MatRotationX(), ug::MatRotationY(), and ug::MatRotationZ().

◆ MatRotationZ()

template<typename matrix_t >
void ug::MatRotationZ ( matrix_t &  mOut,
typename matrix_t::value_type  rads 
)
inline

Fills the matrix with a matrix that rotates around the y-axis in 2 or 3 dimensions.

matrix_t has to have at least 2 rows and 2 columns. Rotation is specified in radiants.

References ug::MatIdentity(), and s.

Referenced by ug::MatRotationYawPitchRoll().

◆ MatScale()

template<typename matrix_t >
void ug::MatScale ( matrix_t &  mOut,
typename matrix_t::value_type  s,
const matrix_t &  m 
)
inline

scales a matrix_t

References s.

Referenced by ug::DarcyVelocityLinker< dim >::eval_and_deriv().

◆ MatScaleAppend()

template<typename matrix_t >
void ug::MatScaleAppend ( matrix_t &  mOut,
typename matrix_t::value_type  s,
const matrix_t &  m 
)
inline

scales a matrix_t and adds to result to a second matrix

References s.

Referenced by ug::linker_traits< MathMatrix< dim, dim >, number >::mult_add(), and ug::LocalMatrix::scale_append().

◆ MatSet()

template<typename matrix_t >
void ug::MatSet ( matrix_t &  mInOut,
typename matrix_t::value_type  s 
)
inline

Set each matrix entry to a scalar (componentwise)

References s.

Referenced by ug::MatIdentity(), and ug::ConvectionShapesPartialUpwind< TDim >::update().

◆ MatSubtract() [1/2]

template<typename matrix_t >
void ug::MatSubtract ( matrix_t &  mOut,
const matrix_t &  m,
typename matrix_t::value_type  s 
)
inline

Subtract a scalar from a matrix (componentwise)

References s.

◆ MatSubtract() [2/2]

template<typename matrix_t >
void ug::MatSubtract ( matrix_t &  mOut,
const matrix_t &  m1,
const matrix_t &  m2 
)
inline

subtracts m2 from m1 and stores the result in a mOut

◆ MaxAbsEigenvalue()

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::MaxAbsEigenvalue ( const MathMatrix< M, N, T > &  m)
inline

Computes maximum eigenvalue of a (symmetric) matrix.

References UG_THROW.

Referenced by ug::MinAbsEigenvalue().

◆ MinAbsEigenvalue()

template<size_t N, size_t M, typename T >
MathMatrix<N,M,T>::value_type ug::MinAbsEigenvalue ( const MathMatrix< M, N, T > &  m)
inline

Computes minimum eigenvalue of a (symmetric) matrix.

◆ num_cols()

template<std::size_t N, typename T = number>
std::size_t ug::MathSymmetricMatrix< N, T >::num_cols ( ) const
inline

◆ num_rows()

template<std::size_t N, typename T = number>
std::size_t ug::MathSymmetricMatrix< N, T >::num_rows ( ) const
inline

◆ operator()() [1/2]

template<std::size_t N, typename T = number>
value_type& ug::MathSymmetricMatrix< N, T >::operator() ( std::size_t  row,
std::size_t  col 
)
inline

◆ operator()() [2/2]

template<std::size_t N, typename T = number>
const value_type& ug::MathSymmetricMatrix< N, T >::operator() ( std::size_t  row,
std::size_t  col 
) const
inline

◆ operator*()

template<std::size_t N, typename T = number>
value_type ug::MathSymmetricMatrix< N, T >::operator* ( const MathSymmetricMatrix< N, T > &  v) const
inline

Multiplies the matrix element-wise with another matrix and sums up the entries.

Parameters
vThe Matrix.
Returns
A scalar value of the element-wise summed up products

References ug::MathSymmetricMatrix< N, T >::entry().

◆ operator*=()

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator*= ( const value_type val)
inline

Multiplies all elements of the matrix with the given value.

Parameters
valThe factor.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator+=() [1/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator+= ( const MathSymmetricMatrix< N, T > &  B)
inline

Adds a matrix to 'this' one: \( A_{this} \leftarrow A_{this} + B\).

Parameters
BThe matrix to be added.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator+=() [2/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator+= ( const value_type val)
inline

Adds the given value to all elements of the matrix.

Parameters
valThe value to be added.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator-=() [1/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator-= ( const MathSymmetricMatrix< N, T > &  B)
inline

Subtracts a matrix from 'this' one: \( A_{this} \leftarrow A_{this} - B\).

Parameters
BThe matrix to be subtracted.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator-=() [2/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator-= ( const value_type val)
inline

Subtracts the given value from all elements of the matrix.

Parameters
valThe value to be subtracted.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator/=()

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator/= ( const value_type val)
inline

Divides all elements of the matrix by the given value.

Parameters
valThe divisor.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator<<() [1/8]

std::ostream & ug::operator<< ( std::ostream &  outStream,
const ug::MathMatrix< 2, 2 > &  m 
)

◆ operator<<() [2/8]

std::ostream & ug::operator<< ( std::ostream &  outStream,
const ug::MathMatrix< 2, 3 > &  m 
)

◆ operator<<() [3/8]

std::ostream & ug::operator<< ( std::ostream &  outStream,
const ug::MathMatrix< 3, 2 > &  m 
)

◆ operator<<() [4/8]

std::ostream & ug::operator<< ( std::ostream &  outStream,
const ug::MathMatrix< 3, 3 > &  m 
)

◆ operator<<() [5/8]

template<std::size_t N, std::size_t M>
std::ostream& ug::operator<< ( std::ostream &  outStream,
const ug::MathMatrix< N, M > &  m 
)

Print MathMatrix<N,M> to standard output.

References ug::MathMatrix< N, M, T >::entry().

◆ operator<<() [6/8]

std::ostream& ug::operator<< ( std::ostream &  outStream,
const ug::MathSymmetricMatrix< 2 > &  m 
)

◆ operator<<() [7/8]

std::ostream& ug::operator<< ( std::ostream &  outStream,
const ug::MathSymmetricMatrix< 3 > &  m 
)

◆ operator<<() [8/8]

template<std::size_t N>
std::ostream& ug::operator<< ( std::ostream &  outStream,
const ug::MathSymmetricMatrix< N > &  m 
)

Print MathSymmetricMatrix<N> to standard output.

References ug::MathSymmetricMatrix< N, T >::entry().

◆ operator=() [1/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator= ( const MathSymmetricMatrix< N, T > &  v)
inline

Assigns the elements of the given matrix to this one.

Parameters
vThe matrix to be assigned.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::assign().

◆ operator=() [2/2]

template<std::size_t N, typename T = number>
MathSymmetricMatrix& ug::MathSymmetricMatrix< N, T >::operator= ( const value_type val)
inline

Assigns the given value to all elements of the matrix.

Parameters
valThe value to be assigned to the matrix.
Returns
A reference to this matrix.

References ug::MathSymmetricMatrix< N, T >::m_data, and ug::MathSymmetricMatrix< N, T >::m_size.

◆ operator[]() [1/2]

template<std::size_t N, typename T = number>
value_type& ug::MathSymmetricMatrix< N, T >::operator[] ( std::size_t  index)
inline

◆ operator[]() [2/2]

template<std::size_t N, typename T = number>
const value_type& ug::MathSymmetricMatrix< N, T >::operator[] ( std::size_t  index) const
inline

◆ RightInverse() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::RightInverse ( MathMatrix< 1, 1 > &  mOut,
const MathMatrix< 1, 1 > &  m 
)
inline

Right-Inverse of a Matrix.

Computes the Right-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \leq N \)) the Right-Inverse is defined as

\[ A^{-1}_{right} := A^T (A A^T)^{-1}, \]

such that \( A A^{-1}_{right} = 1 \). The gram determinate is defined as \( \det{A A^T} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Right- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutRight-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ RightInverse() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::RightInverse ( MathMatrix< 2, 2 > &  mOut,
const MathMatrix< 2, 2 > &  m 
)
inline

Right-Inverse of a Matrix.

Computes the Right-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \leq N \)) the Right-Inverse is defined as

\[ A^{-1}_{right} := A^T (A A^T)^{-1}, \]

such that \( A A^{-1}_{right} = 1 \). The gram determinate is defined as \( \det{A A^T} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Right- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutRight-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ RightInverse() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::RightInverse ( MathMatrix< 3, 3 > &  mOut,
const MathMatrix< 3, 3 > &  m 
)
inline

Right-Inverse of a Matrix.

Computes the Right-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \leq N \)) the Right-Inverse is defined as

\[ A^{-1}_{right} := A^T (A A^T)^{-1}, \]

such that \( A A^{-1}_{right} = 1 \). The gram determinate is defined as \( \det{A A^T} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Right- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutRight-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse().

◆ RightInverse() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::RightInverse ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

Right-Inverse of a Matrix.

Computes the Right-Inverse of a Matrix and returns the square root of the gram determinate. For any \( A \in \mathbb{R}^{M \times N} \) (with \( M \leq N \)) the Right-Inverse is defined as

\[ A^{-1}_{right} := A^T (A A^T)^{-1}, \]

such that \( A A^{-1}_{right} = 1 \). The gram determinate is defined as \( \det{A A^T} \).

Please note, that in case of a square matrix (i.e. \( N = M \)), the Right- Inverse is identical to the Inverse and the square root of the gram determinante simplifies to the norm of the usual determinate.

Parameters
mOutRight-Inverse of Matrix
mMatrix
Returns
Square root of gram determinate of Matrix

References ug::Inverse(), ug::MatMultiplyMMT(), ug::MatMultiplyTransposed(), and UG_THROW.

Referenced by ug::GridFunctionGradientData< TGridFunction >::eval_and_deriv(), ug::GridFunctionGradientComponentData< TGridFunction >::eval_and_deriv(), ug::GlobalGridFunctionGradientData< TGridFunction >::evaluate(), ug::GeneralizedInverse(), and ug::BaseReferenceMapping< dim, worldDim, isLinear, TImpl >::jacobian_transposed_inverse().

◆ scale_by_fnorm()

template<std::size_t N, typename T = number>
void ug::MathSymmetricMatrix< N, T >::scale_by_fnorm ( )
inline

◆ SqrtGramDeterminant() [1/4]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::SqrtGramDeterminant ( const MathMatrix< 1, 1, T > &  m)
inline

Square root of Gram Determinant of a matrix.

Returns Square root of Gram Determinant of a matrix, i.e. \( \sqrt{\det(M M^T)} \).

Parameters
mMatrix
Returns
square root of gram determinant of matrix

References ug::Determinant().

◆ SqrtGramDeterminant() [2/4]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::SqrtGramDeterminant ( const MathMatrix< 2, 2, T > &  m)
inline

Square root of Gram Determinant of a matrix.

Returns Square root of Gram Determinant of a matrix, i.e. \( \sqrt{\det(M M^T)} \).

Parameters
mMatrix
Returns
square root of gram determinant of matrix

References ug::Determinant().

◆ SqrtGramDeterminant() [3/4]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::SqrtGramDeterminant ( const MathMatrix< 3, 3, T > &  m)
inline

Square root of Gram Determinant of a matrix.

Returns Square root of Gram Determinant of a matrix, i.e. \( \sqrt{\det(M M^T)} \).

Parameters
mMatrix
Returns
square root of gram determinant of matrix

References ug::Determinant().

◆ SqrtGramDeterminant() [4/4]

template<size_t N, size_t M, typename T >
MathMatrix< N, M, T >::value_type ug::SqrtGramDeterminant ( const MathMatrix< N, M, T > &  m)
inline

Square root of Gram Determinant of a matrix.

Returns Square root of Gram Determinant of a matrix, i.e. \( \sqrt{\det(M M^T)} \).

Parameters
mMatrix
Returns
square root of gram determinant of matrix

References ug::GramDeterminant().

Referenced by ug::IntegralNormalComponentOnManifoldGeneral(), ug::Integrate(), and ug::BaseReferenceMapping< dim, worldDim, isLinear, TImpl >::sqrt_gram_det().

◆ Trace() [1/3]

template<typename T >
MathMatrix< 1, 1, T >::value_type ug::Trace ( const MathMatrix< 1, 1, T > &  m)
inline

Trace of a Matrix.

Returns the Trace of a Matrix.

Referenced by ug::MatDeviatorTrace().

◆ Trace() [2/3]

template<typename T >
MathMatrix< 2, 2, T >::value_type ug::Trace ( const MathMatrix< 2, 2, T > &  m)
inline

Trace of a Matrix.

Returns the Trace of a Matrix.

◆ Trace() [3/3]

template<typename T >
MathMatrix< 3, 3, T >::value_type ug::Trace ( const MathMatrix< 3, 3, T > &  m)
inline

Trace of a Matrix.

Returns the Trace of a Matrix.

◆ Transpose() [1/2]

template<size_t N, size_t M, typename T >
void ug::Transpose ( MathMatrix< N, M, T > &  mOut,
const MathMatrix< M, N, T > &  m 
)
inline

◆ Transpose() [2/2]

template<typename matrix_t >
void ug::Transpose ( matrix_t &  m)
inline

transpose a matrix_t, override original matrix_t

References UG_ASSERT.

Variable Documentation

◆ ColSize

template<std::size_t N, typename T = number>
const std::size_t ug::MathSymmetricMatrix< N, T >::ColSize = N
static

◆ m_data

◆ m_size

◆ RowSize

template<std::size_t N, typename T = number>
const std::size_t ug::MathSymmetricMatrix< N, T >::RowSize = N
static