funcy  1.6.0
Modules | Namespaces | Classes | Typedefs | Functions | Variables
Linear Algebra

Functionality from linear algebra such as (modified) principal and mixed matrix invariants. More...

Modules

 Invariants
 Matrix Invariants (principal and mixed, modified (isochoric) invariants and deviatoric invariants).
 

Namespaces

 funcy::linalg
 Functionality from linear algebra such as (modified) principal and mixed matrix invariants.
 

Classes

struct  funcy::linalg::SquaredFrobeniusNorm< Mat >
 
class  funcy::linalg::Transpose< Mat >
 

Typedefs

template<class Mat >
using funcy::linalg::FrobeniusNorm = mathop::Chain< Sqrt, SquaredFrobeniusNorm< Mat > >
 

Functions

template<int row, int col, ConstantSize Mat>
auto funcy::linalg::compute_cofactor (const Mat &A) requires(dim< Mat >()
 Compute the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \). More...
 
template<int row, int col, ConstantSize Mat>
auto funcy::linalg::compute_cofactor_directional_derivative (const Mat &A, const Mat &B) requires(dim< Mat >()
 Compute the first directional derivative in direction \( B \) of the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \). More...
 
template<class Mat >
auto funcy::linalg::det (const Mat &A) requires(!Function< Mat > &&!SquareMatrix< Mat >)
 Generate \(\det(A)\). More...
 
template<Function F>
auto funcy::linalg::det (const F &f)
 Generate \(\det\circ f\). More...
 
template<SquareMatrix M, int n = dim< M >()>
auto funcy::linalg::deviator (const M &A)
 
template<class Matrix >
auto funcy::linalg::deviator (const Matrix &A)
 
template<Function F>
auto funcy::linalg::deviator (const F &f)
 Generate deviator \( \mathrm{dev}\circ f\).
 
template<class Mat >
auto funcy::linalg::frobenius_norm (const Mat &A)
 
template<Function F>
auto funcy::linalg::frobenius_norm (const F &f)
 
template<ConstantSize Matrix, class Vector1 , class Vector2 >
Matrix funcy::linalg::tensor_product (const Vector1 &v, const Vector2 &w)
 Compute tensor product \( M = v \otimes w \).
 
template<class Matrix , class Vector >
Matrix funcy::linalg::tensor_product (const Vector &v)
 Compute tensor product \( M = v \otimes v \).
 
template<class Mat >
auto funcy::linalg::trace (const Mat &A) requires(!Function< Mat > &&!ConstantSize< Mat >)
 Generate \(\mathrm{tr}(A)\in\mathbb{R}^{n,n}\). More...
 
template<Function F>
auto funcy::linalg::trace (const F &f)
 Generate \(\mathrm{tr}\circ f\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<class Mat >
auto funcy::linalg::transpose (const Mat &A)
 Generate \(A^T\in\mathbb{R}^{n,n}\). More...
 
template<Function F>
auto funcy::linalg::transpose (const F &f)
 Generate \(f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<ConstantSize Matrix>
Matrix funcy::linalg::unit_matrix ()
 
template<class Matrix >
Matrix funcy::linalg::unit_matrix (int rows)
 

Variables

auto int funcy::linalg::col
 

Detailed Description

Functionality from linear algebra such as (modified) principal and mixed matrix invariants.

Typedef Documentation

§ FrobeniusNorm

template<class Mat >
using funcy::linalg::FrobeniusNorm = typedef mathop::Chain< Sqrt, SquaredFrobeniusNorm< Mat > >

Frobenius norm \( \|A\| = \sqrt{A\negthinspace : \negthinspace A }= \sqrt{\mathrm{tr}(A^TA)} = \sqrt{\sum_{i,j} A_{ij}^2}. \)

Function Documentation

§ compute_cofactor()

template<int row, int col, ConstantSize Mat>
auto int class Mat auto funcy::linalg::compute_cofactor ( const Mat &  A)

Compute the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \).

The \((i,j)\)-cofactor of a matrix \( A \) is \( (-1)^{i+j} \det(A^\#_{ij}) \), where \( A^\#_ij \) is obtained from \( A \) by deleting the \(i\)-th row and \( j \)-th column.

§ compute_cofactor_directional_derivative()

template<int row, int col, ConstantSize Mat>
auto int class Mat auto funcy::linalg::compute_cofactor_directional_derivative ( const Mat &  A,
const Mat &  B 
)

Compute the first directional derivative in direction \( B \) of the \((row,col)\)-cofactor of \( A \). Implemented for \( A\in \mathbb{R}^{n,n} \) with \( n=2,3 \).

The \((i,j)\)-cofactor of a matrix \( A \) is \( (-1)^{i+j} \det(A^\#_{ij}) \), where \( A^\#_{ij} \) is obtained from \( A \) by deleting the \(i\)-th row and \( j \)-th column. If \( A\in \mathbb{R}^{3,3} \), then the cofactors are quadratic polynomials of the entries of \( A^\#_{ij} \). In this case this function can also used to compute the second directional derivative in directions \( A \) and \( B \).

§ det() [1/2]

template<class Mat >
auto funcy::linalg::det ( const Mat &  A)

Generate \(\det(A)\).

Parameters
Asquare matrix
Returns
Determinant<Matrix>(A)

§ det() [2/2]

template<Function F>
auto funcy::linalg::det ( const F &  f)

Generate \(\det\circ f\).

Parameters
ffunction mapping into a space of square matrices
Returns
Determinant< std::decay_t<decltype(f())> >(f())(f)

§ deviator() [1/2]

template<SquareMatrix M, int n = dim< M >()>
auto funcy::linalg::deviator ( const M &  A)

Generate deviator \( \mathrm{dev}(A) = A - \frac{\mathrm{tr}(A)}{n}I \) of a matrix \( A\in\mathbb{R}^{n,n} \).

§ deviator() [2/2]

template<class Matrix >
auto funcy::linalg::deviator ( const Matrix A)

Generate deviator \( \mathrm{dev}(A) = A - \frac{\mathrm{tr}(A)}{n}I \) of a matrix \( A\in\mathbb{R}^{n,n} \).

§ frobenius_norm() [1/2]

template<class Mat >
auto funcy::linalg::frobenius_norm ( const Mat &  A)

Generate Frobenius norm \( \|A\| = \sqrt{A\negthinspace : \negthinspace A }= \sqrt{\mathrm{tr}(A^TA)} = \sqrt{\sum_{i,j} A_{ij}^2}. \)

§ frobenius_norm() [2/2]

template<Function F>
auto funcy::linalg::frobenius_norm ( const F &  f)

Generate Frobenius norm \( \|A\| = \sqrt{A\negthinspace : \negthinspace A }= \sqrt{\mathrm{tr}(A^TA)} = \sqrt{\sum_{i,j} A_{ij}^2}. \)

§ trace() [1/2]

template<class Mat >
auto funcy::linalg::trace ( const Mat &  A)

Generate \(\mathrm{tr}(A)\in\mathbb{R}^{n,n}\).

Parameters
Amatrix
Returns
DynamicSizeTrace<Mat>(A)
Parameters
Amatrix
Returns
ConstantSizeTrace<Mat>(A)

§ trace() [2/2]

template<Function F>
auto funcy::linalg::trace ( const F &  f)

Generate \(\mathrm{tr}\circ f\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \).

Parameters
ffunction object mapping into a space of square matrices

§ transpose() [1/2]

template<class Mat >
auto funcy::linalg::transpose ( const Mat &  A)

Generate \(A^T\in\mathbb{R}^{n,n}\).

Parameters
Asquare matrix
Returns
Transpose<Matrix>(A)

§ transpose() [2/2]

template<Function F>
auto funcy::linalg::transpose ( const F &  f)

Generate \(f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \).

Parameters
ffunction object mapping into a space of square matrices
Returns
Transpose< decay_t<decltype(f())> >(f())( f )

§ unit_matrix() [1/2]

template<ConstantSize Matrix>
Matrix funcy::linalg::unit_matrix ( )

Compute unit matrix for the specified constant size matrix type. This requires that a corresponding specialization of Zero is provided.

§ unit_matrix() [2/2]

template<class Matrix >
Matrix funcy::linalg::unit_matrix ( int  rows)

Compute unit matrix for the specified dynamic size matrix type. This requires that a corresponding specialization of Zero is provided.