Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Eigen::MatrixFunction< MatrixType, AtomicType, 1 > Class Template Reference

#include <MatrixFunction.h>

Public Member Functions

template<typename ResultType >
void compute (ResultType &result)
 Compute the matrix function. More...
 
 MatrixFunction (const MatrixType &A, AtomicType &atomic)
 Constructor. More...
 

Private Types

typedef std::list< ScalarCluster
 
typedef Matrix< Index, Dynamic, 1 > DynamicIntVectorType
 
typedef Matrix< Scalar, Dynamic, Dynamic, Options, RowsAtCompileTime, ColsAtCompileTimeDynMatrixType
 
typedef MatrixType::Index Index
 
typedef Matrix< Index, Traits::RowsAtCompileTime, 1 > IntVectorType
 
typedef std::list< ClusterListOfClusters
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef internal::traits< MatrixType > Traits
 
typedef Matrix< Scalar, Traits::RowsAtCompileTime, 1 > VectorType
 

Private Member Functions

Block< MatrixType > block (MatrixType &A, Index i, Index j)
 Return block of matrix according to blocking given by m_blockStart. More...
 
void computeBlockAtomic ()
 Compute block diagonal part of m_fT. More...
 
void computeBlockStart ()
 Compute m_blockStart using m_clusterSize. More...
 
void computeClusterSize ()
 Compute m_clusterSize and m_eivalToCluster using m_clusters. More...
 
void computeOffDiagonal ()
 Compute part of m_fT above block diagonal. More...
 
void computeSchurDecomposition ()
 Store the Schur decomposition of m_A in m_T and m_U. More...
 
void constructPermutation ()
 Compute m_permutation using m_eivalToCluster and m_blockStart. More...
 
ListOfClusters::iterator findCluster (Scalar key)
 Find cluster in m_clusters containing some value. More...
 
MatrixFunctionoperator= (const MatrixFunction &)
 
void partitionEigenvalues ()
 Partition eigenvalues in clusters of ei'vals close to each other. More...
 
void permuteSchur ()
 Permute Schur decomposition in m_U and m_T according to m_permutation. More...
 
DynMatrixType solveTriangularSylvester (const DynMatrixType &A, const DynMatrixType &B, const DynMatrixType &C)
 Solve a triangular Sylvester equation AX + XB = C. More...
 
void swapEntriesInSchur (Index index)
 Swap rows index and index+1 in Schur decomposition in m_U and m_T. More...
 

Static Private Member Functions

static const RealScalar separation ()
 Maximum distance allowed between eigenvalues to be considered "close". More...
 

Private Attributes

internal::nested< MatrixType >::type m_A
 Reference to argument of matrix function. More...
 
AtomicType & m_atomic
 Class for computing matrix function of atomic blocks. More...
 
DynamicIntVectorType m_blockStart
 Row index at which block corresponding to i-th cluster starts. More...
 
ListOfClusters m_clusters
 Partition of eigenvalues into clusters of ei'vals "close" to each other. More...
 
DynamicIntVectorType m_clusterSize
 Number of eigenvalues in each clusters. More...
 
DynamicIntVectorType m_eivalToCluster
 m_eivalToCluster[i] = j means i-th ei'val is in j-th cluster More...
 
MatrixType m_fT
 Matrix function applied to m_T More...
 
IntVectorType m_permutation
 Permutation which groups ei'vals in the same cluster together. More...
 
MatrixType m_T
 Triangular part of Schur decomposition. More...
 
MatrixType m_U
 Unitary part of Schur decomposition. More...
 

Static Private Attributes

static const int ColsAtCompileTime = Traits::ColsAtCompileTime
 
static const int Options = MatrixType::Options
 
static const int RowsAtCompileTime = Traits::RowsAtCompileTime
 

Detailed Description

template<typename MatrixType, typename AtomicType>
class Eigen::MatrixFunction< MatrixType, AtomicType, 1 >

Definition at line 123 of file MatrixFunction.h.

Member Typedef Documentation

template<typename MatrixType , typename AtomicType >
typedef std::list<Scalar> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::Cluster
private

Definition at line 137 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef Matrix<Index, Dynamic, 1> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::DynamicIntVectorType
private

Definition at line 136 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef Matrix<Scalar, Dynamic, Dynamic, Options, RowsAtCompileTime, ColsAtCompileTime> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::DynMatrixType
private

Definition at line 139 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef MatrixType::Index Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::Index
private

Definition at line 129 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef Matrix<Index, Traits::RowsAtCompileTime, 1> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::IntVectorType
private

Definition at line 135 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef std::list<Cluster> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::ListOfClusters
private

Definition at line 138 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef NumTraits<Scalar>::Real Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::RealScalar
private

Definition at line 133 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef MatrixType::Scalar Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::Scalar
private

Definition at line 128 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef internal::traits<MatrixType> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::Traits
private

Definition at line 127 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
typedef Matrix<Scalar, Traits::RowsAtCompileTime, 1> Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::VectorType
private

Definition at line 134 of file MatrixFunction.h.

Constructor & Destructor Documentation

template<typename MatrixType , typename AtomicType >
Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::MatrixFunction ( const MatrixType &  A,
AtomicType &  atomic 
)

Constructor.

Parameters
[in]Aargument of matrix function, should be a square matrix.
[in]atomicclass for computing matrix function of atomic blocks.

Definition at line 189 of file MatrixFunction.h.

Member Function Documentation

template<typename MatrixType , typename AtomicType >
Block< MatrixType > Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::block ( MatrixType &  A,
Index  i,
Index  j 
)
private

Return block of matrix according to blocking given by m_blockStart.

Definition at line 378 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
template<typename ResultType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::compute ( ResultType &  result)

Compute the matrix function.

Parameters
[out]resultthe function f applied to A, as specified in the constructor.

Definition at line 202 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::computeBlockAtomic ( )
private

Compute block diagonal part of m_fT.

This routine computes the matrix function applied to the block diagonal part of m_T, with the blocking given by m_blockStart. The matrix function of each diagonal block is computed by m_atomic. The off-diagonal parts of m_fT are set to zero.

Definition at line 367 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::computeBlockStart ( )
private

Compute m_blockStart using m_clusterSize.

Definition at line 309 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::computeClusterSize ( )
private

Compute m_clusterSize and m_eivalToCluster using m_clusters.

Definition at line 287 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::computeOffDiagonal ( )
private

Compute part of m_fT above block diagonal.

This routine assumes that the block diagonal part of m_fT (which equals the matrix function applied to m_T) has already been computed and computes the part above the block diagonal. The part below the diagonal is zero, because m_T is upper triangular.

Definition at line 391 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::computeSchurDecomposition ( )
private

Store the Schur decomposition of m_A in m_T and m_U.

Definition at line 217 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::constructPermutation ( )
private

Compute m_permutation using m_eivalToCluster and m_blockStart.

Definition at line 320 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixFunction< MatrixType, AtomicType, 1 >::ListOfClusters::iterator Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::findCluster ( Scalar  key)
private

Find cluster in m_clusters containing some value.

Parameters
[in]keyValue to find
Returns
Iterator to cluster containing key, or m_clusters.end() if no cluster in m_clusters contains key.

Definition at line 274 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixFunction& Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::operator= ( const MatrixFunction< MatrixType, AtomicType, 1 > &  )
private
template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::partitionEigenvalues ( )
private

Partition eigenvalues in clusters of ei'vals close to each other.

This function computes m_clusters. This is a partition of the eigenvalues of m_T in clusters, such that

Any eigenvalue in a certain cluster is at most separation() away

from another eigenvalue in the same cluster.

The distance between two eigenvalues in different clusters is

more than separation(). The implementation follows Algorithm 4.1 in the paper of Davies and Higham.

Definition at line 236 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::permuteSchur ( )
private

Permute Schur decomposition in m_U and m_T according to m_permutation.

Definition at line 333 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
static const RealScalar Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::separation ( )
inlinestaticprivate

Maximum distance allowed between eigenvalues to be considered "close".

This is morally a static const Scalar, but only integers can be static constant class members in C++. The separation constant is set to 0.1, a value taken from the paper by Davies and Higham.

Definition at line 178 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixFunction< MatrixType, AtomicType, 1 >::DynMatrixType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::solveTriangularSylvester ( const DynMatrixType A,
const DynMatrixType B,
const DynMatrixType C 
)
private

Solve a triangular Sylvester equation AX + XB = C.

Parameters
[in]Athe matrix A; should be square and upper triangular
[in]Bthe matrix B; should be square and upper triangular
[in]Cthe matrix C; should have correct size.
Returns
the solution X.

If A is m-by-m and B is n-by-n, then both C and X are m-by-n. The (i,j)-th component of the Sylvester equation is

\[ \sum_{k=i}^m A_{ik} X_{kj} + \sum_{k=1}^j X_{ik} B_{kj} = C_{ij}. \]

This can be re-arranged to yield:

\[ X_{ij} = \frac{1}{A_{ii} + B_{jj}} \Bigl( C_{ij} - \sum_{k=i+1}^m A_{ik} X_{kj} - \sum_{k=1}^{j-1} X_{ik} B_{kj} \Bigr). \]

It is assumed that A and B are such that the numerator is never zero (otherwise the Sylvester equation does not have a unique solution). In that case, these equations can be evaluated in the order $ i=m,\ldots,1 $ and $ j=1,\ldots,n $.

Definition at line 433 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
void Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::swapEntriesInSchur ( Index  index)
private

Swap rows index and index+1 in Schur decomposition in m_U and m_T.

Definition at line 351 of file MatrixFunction.h.

Member Data Documentation

template<typename MatrixType , typename AtomicType >
const int Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::ColsAtCompileTime = Traits::ColsAtCompileTime
staticprivate

Definition at line 131 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
internal::nested<MatrixType>::type Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_A
private

Reference to argument of matrix function.

Definition at line 161 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
AtomicType& Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_atomic
private

Class for computing matrix function of atomic blocks.

Definition at line 162 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
DynamicIntVectorType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_blockStart
private

Row index at which block corresponding to i-th cluster starts.

Definition at line 169 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
ListOfClusters Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_clusters
private

Partition of eigenvalues into clusters of ei'vals "close" to each other.

Definition at line 166 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
DynamicIntVectorType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_clusterSize
private

Number of eigenvalues in each clusters.

Definition at line 168 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
DynamicIntVectorType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_eivalToCluster
private

m_eivalToCluster[i] = j means i-th ei'val is in j-th cluster

Definition at line 167 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_fT
private

Matrix function applied to m_T

Definition at line 165 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
IntVectorType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_permutation
private

Permutation which groups ei'vals in the same cluster together.

Definition at line 170 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_T
private

Triangular part of Schur decomposition.

Definition at line 163 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
MatrixType Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::m_U
private

Unitary part of Schur decomposition.

Definition at line 164 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
const int Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::Options = MatrixType::Options
staticprivate

Definition at line 132 of file MatrixFunction.h.

template<typename MatrixType , typename AtomicType >
const int Eigen::MatrixFunction< MatrixType, AtomicType, 1 >::RowsAtCompileTime = Traits::RowsAtCompileTime
staticprivate

Definition at line 130 of file MatrixFunction.h.


The documentation for this class was generated from the following file:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:36