Loading...
Searching...
No Matches
Dune::FMatrixHelp Namespace Reference
Common » Dense Matrix and Vector Template Library

## Functions

template<typename K>
static constexpr K | invertMatrix (const FieldMatrix< K, 1, 1 > &matrix, FieldMatrix< K, 1, 1 > &inverse)
| invert scalar without changing the original matrix
template<typename K>
static constexpr K | invertMatrix_retTransposed (const FieldMatrix< K, 1, 1 > &matrix, FieldMatrix< K, 1, 1 > &inverse)
| invert scalar without changing the original matrix
template<typename K>
static constexpr K | invertMatrix (const FieldMatrix< K, 2, 2 > &matrix, FieldMatrix< K, 2, 2 > &inverse)
| invert 2x2 Matrix without changing the original matrix
template<typename K>
static constexpr K | invertMatrix_retTransposed (const FieldMatrix< K, 2, 2 > &matrix, FieldMatrix< K, 2, 2 > &inverse)
template<typename K>
static constexpr K | invertMatrix (const FieldMatrix< K, 3, 3 > &matrix, FieldMatrix< K, 3, 3 > &inverse)
| invert 3x3 Matrix without changing the original matrix
template<typename K>
static constexpr K | invertMatrix_retTransposed (const FieldMatrix< K, 3, 3 > &matrix, FieldMatrix< K, 3, 3 > &inverse)
| invert 3x3 Matrix without changing the original matrix
template<class K, int m, int n, int p>
static constexpr void | multMatrix (const FieldMatrix< K, m, n > &A, const FieldMatrix< K, n, p > &B, FieldMatrix< K, m, p > &ret)
| calculates ret = A * B
template<typename K, int rows, int cols>
static constexpr void | multTransposedMatrix (const FieldMatrix< K, rows, cols > &matrix, FieldMatrix< K, cols, cols > &ret)
| calculates ret= A_t*A
template<typename K, int rows, int cols>
static constexpr void | multAssignTransposed (const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, rows > &x, FieldVector< K, cols > &ret)
| calculates ret = matrix^T * x
template<typename K, int rows, int cols>
static constexpr FieldVector< K, rows > | mult (const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, cols > &x)
| calculates ret = matrix * x
template<typename K, int rows, int cols>
static constexpr FieldVector< K, cols > | multTransposed (const FieldMatrix< K, rows, cols > &matrix, const FieldVector< K, rows > &x)
| calculates ret = matrix^T * x
template<int dim, typename K>
static void | eigenValues (const FieldMatrix< K, dim, dim > &matrix, FieldVector< K, dim > &eigenValues)
| calculates the eigenvalues of a symmetric field matrix
template<int dim, typename K>
static void | eigenValuesVectors (const FieldMatrix< K, dim, dim > &matrix, FieldVector< K, dim > &eigenValues, FieldMatrix< K, dim, dim > &eigenVectors)
| calculates the eigenvalues and eigenvectors of a symmetric field matrix
template<int dim, typename K>
static void | eigenValuesLapack (const FieldMatrix< K, dim, dim > &matrix, FieldVector< K, dim > &eigenValues)
| calculates the eigenvalues of a symmetric field matrix
template<int dim, typename K>
static void | eigenValuesVectorsLapack (const FieldMatrix< K, dim, dim > &matrix, FieldVector< K, dim > &eigenValues, FieldMatrix< K, dim, dim > &eigenVectors)
| calculates the eigenvalues and -vectors of a symmetric field matrix
template<int dim, typename K, class C>
static void | eigenValuesNonSym (const FieldMatrix< K, dim, dim > &matrix, FieldVector< C, dim > &eigenValues)
| calculates the eigenvalues of a non-symmetric field matrix
template<typename MAT, typename V1, typename V2>
static void | multAssign (const DenseMatrix< MAT > &matrix, const DenseVector< V1 > &x, DenseVector< V2 > &ret)
| calculates ret = matrix * x

## Function Documentation

## eigenValues()

template<int dim, typename K>

void Dune::FMatrixHelp::eigenValues | ( | const FieldMatrix< K, dim, dim > & | matrix,
|  | FieldVector< K, dim > & | eigenValues )

static

calculates the eigenvalues of a symmetric field matrix

Parameters

  [in] | matrix | matrix eigenvalues are calculated for
  [out] | eigenValues | FieldVector that contains eigenvalues in ascending order

Note
  specializations for dim=1,2,3 exist, for dim>3 LAPACK::dsyev is used

## eigenValuesLapack()

template<int dim, typename K>

void Dune::FMatrixHelp::eigenValuesLapack | ( | const FieldMatrix< K, dim, dim > & | matrix,
|  | FieldVector< K, dim > & | eigenValues )

static

calculates the eigenvalues of a symmetric field matrix

Parameters

  [in] | matrix | matrix eigenvalues are calculated for
  [out] | eigenValues | FieldVector that contains eigenvalues in ascending order

Note
  LAPACK::dsyev is used to calculate the eigenvalues

## eigenValuesNonSym()

template<int dim, typename K, class C>

void Dune::FMatrixHelp::eigenValuesNonSym | ( | const FieldMatrix< K, dim, dim > & | matrix,
|  | FieldVector< C, dim > & | eigenValues )

static

calculates the eigenvalues of a non-symmetric field matrix

Parameters

  [in] | matrix | matrix eigenvalues are calculated for
  [out] | eigenValues | FieldVector that contains eigenvalues in ascending order

Note
  LAPACK::dgeev is used to calculate the eigenvalues

## eigenValuesVectors()

template<int dim, typename K>

void Dune::FMatrixHelp::eigenValuesVectors | ( | const FieldMatrix< K, dim, dim > & | matrix,
|  | FieldVector< K, dim > & | eigenValues,
|  | FieldMatrix< K, dim, dim > & | eigenVectors )

static

calculates the eigenvalues and eigenvectors of a symmetric field matrix

Parameters

  [in] | matrix | matrix eigenvalues are calculated for
  [out] | eigenValues | FieldVector that contains eigenvalues in ascending order
  [out] | eigenVectors | FieldMatrix that contains the eigenvectors

Note
  specializations for dim=1,2,3 exist, for dim>3 LAPACK::dsyev is used

## eigenValuesVectorsLapack()

template<int dim, typename K>

void Dune::FMatrixHelp::eigenValuesVectorsLapack | ( | const FieldMatrix< K, dim, dim > & | matrix,
|  | FieldVector< K, dim > & | eigenValues,
|  | FieldMatrix< K, dim, dim > & | eigenVectors )

static

calculates the eigenvalues and -vectors of a symmetric field matrix

Parameters

  [in] | matrix | matrix eigenvalues are calculated for
  [out] | eigenValues | FieldVector that contains eigenvalues in ascending order
  [out] | eigenVectors | FieldMatrix that contains the eigenvectors

Note
  LAPACK::dsyev is used to calculate the eigenvalues and -vectors

## invertMatrix() [1/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix | ( | const FieldMatrix< K, 1, 1 > & | matrix,
|  | FieldMatrix< K, 1, 1 > & | inverse )

static constexpr

invert scalar without changing the original matrix

## invertMatrix() [2/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix | ( | const FieldMatrix< K, 2, 2 > & | matrix,
|  | FieldMatrix< K, 2, 2 > & | inverse )

static constexpr

invert 2x2 Matrix without changing the original matrix

## invertMatrix() [3/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix | ( | const FieldMatrix< K, 3, 3 > & | matrix,
|  | FieldMatrix< K, 3, 3 > & | inverse )

static constexpr

invert 3x3 Matrix without changing the original matrix

## invertMatrix_retTransposed() [1/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix_retTransposed | ( | const FieldMatrix< K, 1, 1 > & | matrix,
|  | FieldMatrix< K, 1, 1 > & | inverse )

static constexpr

invert scalar without changing the original matrix

## invertMatrix_retTransposed() [2/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix_retTransposed | ( | const FieldMatrix< K, 2, 2 > & | matrix,
|  | FieldMatrix< K, 2, 2 > & | inverse )

static constexpr

invert 2x2 Matrix without changing the original matrix return transposed matrix

## invertMatrix_retTransposed() [3/3]

template<typename K>

constexpr K Dune::FMatrixHelp::invertMatrix_retTransposed | ( | const FieldMatrix< K, 3, 3 > & | matrix,
|  | FieldMatrix< K, 3, 3 > & | inverse )

static constexpr

invert 3x3 Matrix without changing the original matrix

## mult()

template<typename K, int rows, int cols>

constexpr FieldVector< K, rows > Dune::FMatrixHelp::mult | ( | const FieldMatrix< K, rows, cols > & | matrix,
|  | const FieldVector< K, cols > & | x )

static constexpr

calculates ret = matrix * x

## multAssign()

template<typename MAT, typename V1, typename V2>

void Dune::DenseMatrixHelp::multAssign | ( | const DenseMatrix< MAT > & | matrix,
|  | const DenseVector< V1 > & | x,
|  | DenseVector< V2 > & | ret )

inline static

calculates ret = matrix * x

## multAssignTransposed()

template<typename K, int rows, int cols>

constexpr void Dune::FMatrixHelp::multAssignTransposed | ( | const FieldMatrix< K, rows, cols > & | matrix,
|  | const FieldVector< K, rows > & | x,
|  | FieldVector< K, cols > & | ret )

static constexpr

calculates ret = matrix^T * x

## multMatrix()

template<class K, int m, int n, int p>

constexpr void Dune::FMatrixHelp::multMatrix | ( | const FieldMatrix< K, m, n > & | A,
|  | const FieldMatrix< K, n, p > & | B,
|  | FieldMatrix< K, m, p > & | ret )

static constexpr

calculates ret = A * B

## multTransposed()

template<typename K, int rows, int cols>

constexpr FieldVector< K, cols > Dune::FMatrixHelp::multTransposed | ( | const FieldMatrix< K, rows, cols > & | matrix,
|  | const FieldVector< K, rows > & | x )

static constexpr

calculates ret = matrix^T * x

## multTransposedMatrix()

template<typename K, int rows, int cols>

constexpr void Dune::FMatrixHelp::multTransposedMatrix | ( | const FieldMatrix< K, rows, cols > & | matrix,
|  | FieldMatrix< K, cols, cols > & | ret )

static constexpr

calculates ret= A_t*A