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

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

Collaboration diagram for Linear Algebra:

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::RightCauchyGreenStrainTensor< Mat >
 Right Cauchy-Green strain tensor \( F^T F \) for a symmetric matrix \( F \). More...
 
class  funcy::linalg::LeftCauchyGreenStrainTensor< Mat >
 Left Cauchy-Green strain tensor \( F^T F \) for a symmetric matrix \( F \). More...
 
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<SquareMatrix Mat>
auto funcy::linalg::det (const Mat &A)
 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)
 
 funcy::linalg::RightCauchyGreenStrainTensor< Mat >::RightCauchyGreenStrainTensor (const Mat &F)
 Constructor. More...
 
void funcy::linalg::RightCauchyGreenStrainTensor< Mat >::update (const Mat &F)
 Reset point of evaluation.
 
const Mat & funcy::linalg::RightCauchyGreenStrainTensor< Mat >::d0 () const noexcept
 Function value \( F^T * F \).
 
Mat funcy::linalg::RightCauchyGreenStrainTensor< Mat >::d1 (const Mat &dF1) const
 First directional derivative \( F^T dF_1 + dF_1^T F \).
 
Mat funcy::linalg::RightCauchyGreenStrainTensor< Mat >::d2 (const Mat &dF1, const Mat &dF2) const
 Second directional derivative \( dF_2^T dF_1 + dF_1^T dF_2 \).
 
 funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::LeftCauchyGreenStrainTensor (const Mat &F)
 Constructor. More...
 
void funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::update (const Mat &F)
 Reset point of evaluation.
 
const Mat & funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::d0 () const noexcept
 Function value \( F^T * F \).
 
Mat funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::d1 (const Mat &dF1) const
 First directional derivative \( F^T dF_1 + dF_1^T F \).
 
Mat funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::d2 (const Mat &dF1, const Mat &dF2) const
 Second directional derivative \( dF_2^T dF_1 + dF_1^T dF_2 \).
 
template<class Mat >
auto funcy::linalg::strain_tensor (const Mat &A)
 Generate the right Cauchy-Green strain tensor \(A*A^T\). More...
 
template<Function F>
auto funcy::linalg::strain_tensor (const F &f)
 Generate the right Cauchy-Green strain tensor \(f*f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \). More...
 
template<class Mat >
auto funcy::linalg::left_strain_tensor (const Mat &A)
 Generate the left Cauchy-Green strain tensor \(A^T*A\). More...
 
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<ConstantSize Mat>
auto funcy::linalg::trace (const Mat &A) requires(!Function< 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/3]

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

Generate \(\det(A)\).

Parameters
Asquare matrix
Returns
Determinant<Matrix>(A)

◆ det() [2/3]

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

Generate \(\det(A)\).

Parameters
Asquare matrix
Returns
Determinant<Matrix>(A)

◆ det() [3/3]

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}. \)

◆ left_strain_tensor()

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

Generate the left Cauchy-Green strain tensor \(A^T*A\).

Parameters
Amatrix
Returns
LeftCauchyGreenStrainTensor<Matrix>(A)

◆ LeftCauchyGreenStrainTensor()

template<class Mat >
funcy::linalg::LeftCauchyGreenStrainTensor< Mat >::LeftCauchyGreenStrainTensor ( const Mat &  F)
inlineexplicit

Constructor.

Parameters
Fpoint of evaluation.

◆ RightCauchyGreenStrainTensor()

template<class Mat >
funcy::linalg::RightCauchyGreenStrainTensor< Mat >::RightCauchyGreenStrainTensor ( const Mat &  F)
inlineexplicit

Constructor.

Parameters
Fpoint of evaluation.

◆ strain_tensor() [1/2]

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

Generate the right Cauchy-Green strain tensor \(A*A^T\).

Parameters
Amatrix
Returns
RightCauchyGreenStrainTensor<Matrix>(A)

◆ strain_tensor() [2/2]

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

Generate the right Cauchy-Green strain tensor \(f*f^T\), where \(f:\cdot\mapsto\mathbb{R}^{n,n} \).

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

◆ trace() [1/3]

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)

◆ trace() [2/3]

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

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

Parameters
Amatrix
Returns
ConstantSizeTrace<Mat>(A)

◆ trace() [3/3]

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.