KASKADE 7 development version
Loading...
Searching...
No Matches
Linear equations and similar problems

Functions

template<class Vector, class Matrix>
Vector Kaskade::project (Vector const &y, Matrix const &A)
 Computes the projection of \( y \) onto the range of \( A \).
template<class MEntry, class Vector>
Vector gesv (DynamicMatrix< MEntry > const &A, Vector const &b)
 Computes the solution of \( Ax = b \) for general invertible matrices.
template<class MEntry, class Vector>
Vector posv (DynamicMatrix< MEntry > const &A, Vector const &b)
 Computes the solution of \( Ax = b \) if \( A \) is symmetric positive definite.
template<class MEntry, class Vector>
Vector gelss (DynamicMatrix< MEntry > const &A, Vector const &b)
 Computes the solution of the standard least squares problem \( \|Ax-b\|=\min\).
template<class Scalar>
void invert (DynamicMatrix< Scalar > &A)
 Computes the inverse \( A^{-1} \).
template<class Entry>
DynamicMatrix< Entry > & invertSpd (DynamicMatrix< Entry > &A, bool symmetrize=true)
 In place computation of the inverse \( A^{-1} \).
template<class Entry>
DynamicMatrix< typename EntryTraits< Entry >::transpose_type > pseudoinverse (DynamicMatrix< Entry > A)
 Computes the right pseudoinverse \( A^+ \) of a wide matrix such that \( A A^+ = I \).
template<class Entry>
std::tuple< std::vector< typename EntryTraits< Entry >::field_type >, DynamicMatrix< typename EntryTraits< Entry >::field_type >, std::vector< int > > qr (DynamicMatrix< Entry > const &A)
 Computes a rank-revealing QR decomposition of \( A \) using column pivoting.

Detailed Description

Function Documentation

◆ gelss()

template<class MEntry, class Vector>
Vector gelss ( DynamicMatrix< MEntry > const & A,
Vector const & b )
related

Computes the solution of the standard least squares problem \( \|Ax-b\|=\min\).

This uses LAPACK *gelss for computing a norm-minimal solution to the least squares problem.

Parameters
Aa n x m matrix
ba n-vector
Returns
a m-vector

◆ gesv()

template<class MEntry, class Vector>
Vector gesv ( DynamicMatrix< MEntry > const & A,
Vector const & b )
related

Computes the solution of \( Ax = b \) for general invertible matrices.

Template Parameters
Vectora vector type, usually Dune::DynamicVector or Dune::BlockVector

The field types of MEntry and VEntry must be the same.

◆ invert()

template<class Scalar>
void invert ( DynamicMatrix< Scalar > & A)
related

Computes the inverse \( A^{-1} \).

Parameters
Athe input matrix to be inverted, is overwritten with its inverse

◆ invertSpd()

template<class Entry>
DynamicMatrix< Entry > & invertSpd ( DynamicMatrix< Entry > & A,
bool symmetrize = true )
related

In place computation of the inverse \( A^{-1} \).

Template Parameters
Entrythe type of matrix entries, either a scalar or a FieldMatrix<scalar,n,n>
Parameters
Athe quadratic input matrix to be inverted (has to be spd), is overwritten with its inverse
symmetrizeif true, the complete inverse is computed, otherwise only the lower triangular part
Returns
a reference to the (inverted) input matrix

Can throw NonpositiveMatrixException or SingularMatrixException.

◆ posv()

template<class MEntry, class Vector>
Vector posv ( DynamicMatrix< MEntry > const & A,
Vector const & b )
related

Computes the solution of \( Ax = b \) if \( A \) is symmetric positive definite.

Template Parameters
Vectora vector type, usually Dune::DynamicVector or Dune::BlockVector
Parameters
Amust be symmetric positive definite

The field types of MEntry and VEntry must be the same.

◆ project()

template<class Vector, class Matrix>
Vector Kaskade::project ( Vector const & y,
Matrix const & A )

Computes the projection of \( y \) onto the range of \( A \).

Equivalently, this solves the problem \( \min_s \|y-As\| \) and returns \( As \).

Explicit instantiations for common vector and matrix types are provided.

◆ pseudoinverse()

template<class Entry>
DynamicMatrix< typename EntryTraits< Entry >::transpose_type > pseudoinverse ( DynamicMatrix< Entry > A)
related

Computes the right pseudoinverse \( A^+ \) of a wide matrix such that \( A A^+ = I \).

Template Parameters
Entrythe type of matrix entries of \( A \). This needs to be scalar, i.e. either an arithmetic type or Dune::FieldMatrix<*,1,1>.
Parameters
Athe matrix \( A \in\mathbb{R}^{n\times m}\)
Returns
the matrix \( A^+ \in \mathbb{R}^{m\times n}\)

◆ qr()

template<class Entry>
std::tuple< std::vector< typename EntryTraits< Entry >::field_type >, DynamicMatrix< typename EntryTraits< Entry >::field_type >, std::vector< int > > qr ( DynamicMatrix< Entry > const & A)
related

Computes a rank-revealing QR decomposition of \( A \) using column pivoting.

This computes a unitary matrix \( Q \) and an upper triangular matrix \( R \) such that \( A P = QR \) with a permutation matrix \( P \). The permutation matrix is given as an index permutation vector \( p \), such that \( P_{k,j} = \delta_{k,p_j} \), i.e. the \( j \)-th column of \( AP \) is the \( p_j\)-th column of \( A \).

Template Parameters
Entryeither a scalar arithmetic type or a square field matrix
Returns
\((\tau,QR,p)\) with a vector \( \tau \) of elementary Householder reflectors \( H_i = I - \tau_i v_i v_i^T \), a matrix \( QR \) containing \( R \) in the upper triangular part and the Householder vectors \( v_i \) in the lower triangular part, and the permutation vector \( p \). The entry type of the returned matrix is the scalar field type of \( A \).