STK++ 0.9.13
|
The class ISymEigen is an interface class for the method computing the eigenvalue Decomposition of a symmetric ArrayXX. More...
#include <STK_ISymEigen.h>
Public Member Functions | |
~ISymEigen () | |
virtual destructor | |
ISymEigen & | operator= (ISymEigen const &eigen) |
Operator = : overwrite the ISymEigen with eigen. | |
Range const & | range () const |
Type const & | norm () const |
int const & | rank () const |
Type const & | det () const |
Type const & | trace () const |
CArraySquare< Type, size_ > const & | rotation () const |
CArraySquare< Type, size_ > const & | eigenVectors () const |
CArrayVector< Type, size_ > const & | eigenValues () const |
template<class OtherDerived > | |
void | setData (ExprBase< OtherDerived > const &data) |
overloading of setData. | |
template<class ArraySquare > | |
ArraySquare & | ginv (ArraySquare &res) const |
Compute the generalized inverse of the symmetric matrix and put the result in res. | |
template<class ArraySquare > | |
ArraySquare & | ginvsqrt (ArraySquare &res) const |
Compute the generalized square root inverse of the symmetric matrix and put the result in res. | |
template<class ArraySquare > | |
ArraySquare & | gsqrt (ArraySquare &res) const |
Compute the square root of the symmetric matrix and put the result in res. | |
virtual bool | run () |
Find the eigenvalues and eigenvectors of the matrix. | |
![]() | |
String const & | error () const |
get the last error message. | |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Protected Types | |
enum | { structure_ = hidden::Traits< SquareArray >::structure_ , orient_ = hidden::Traits< SquareArray >::orient_ , sizeRows_ = hidden::Traits< SquareArray >::sizeRows_ , sizeCols_ = hidden::Traits< SquareArray >::sizeCols_ , size_ = (sizeRows_<sizeCols_) ? sizeRows_ : sizeCols_ } |
typedef IRunnerBase | Base |
typedef hidden::AlgebraTraits< Derived >::SquareArray | SquareArray |
typedef hidden::Traits< SquareArray >::Type | Type |
Protected Member Functions | |
ISymEigen () | |
Default constructor. | |
ISymEigen (SquareArray const &data, bool ref=false) | |
Constructor The original data set can be overwritten by the eigenvectors if it is stored in a CSquareXd. | |
template<class OtherDerived > | |
ISymEigen (ExprBase< OtherDerived > const &data) | |
template constructor | |
ISymEigen (ISymEigen const &eigen) | |
Copy constructor. | |
void | finalizeStep () |
finalize the computation by computing the trace, rank, trace norm and determinant of the matrix. | |
![]() | |
IRunnerBase () | |
default constructor | |
IRunnerBase (IRunnerBase const &runner) | |
copy constructor | |
virtual | ~IRunnerBase () |
destructor | |
virtual void | update () |
update the runner. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
Protected Attributes | |
Range | range_ |
range of the original data set. | |
Type | trace_ |
trace norm | |
Type | norm_ |
trace norm | |
int | rank_ |
rank | |
Type | det_ |
determinant | |
CArraySquare< Type, size_ > | eigenVectors_ |
Square matrix or the eigenvectors. | |
CArrayVector< Type, size_ > | eigenValues_ |
Array of the eigenvalues. | |
CVectorXi | SupportEigenVectors_ |
Array for the support of the eigenvectors. | |
![]() | |
String | msg_error_ |
String with the last error message. | |
bool | hasRun_ |
true if run has been used, false otherwise | |
The class ISymEigen is an interface class for the method computing the eigenvalue Decomposition of a symmetric ArrayXX.
The decomposition of a symmetric matrix require
The 2-norm (operator norm) of the matrix is given. if the 2-norm is less than the arithmetic precision of the type Real
, the rank is not full. Thus the user can be faced with a deficient rank matrix and with a norm very small (i.e. not exactly 0.0).
Definition at line 64 of file STK_ISymEigen.h.
|
protected |
Definition at line 67 of file STK_ISymEigen.h.
|
protected |
Definition at line 68 of file STK_ISymEigen.h.
|
protected |
Definition at line 70 of file STK_ISymEigen.h.
Enumerator | |
---|---|
structure_ | |
orient_ | |
sizeRows_ | |
sizeCols_ | |
size_ |
Definition at line 71 of file STK_ISymEigen.h.
|
protected |
Default constructor.
Definition at line 220 of file STK_ISymEigen.h.
References STK::Arrays::lower_symmetric_, STK::Arrays::square_, STK_STATIC_ASSERT, STK::Arrays::symmetric_, and STK::Arrays::upper_symmetric_.
|
protected |
Constructor The original data set can be overwritten by the eigenvectors if it is stored in a CSquareXd.
Observe that in this case the base index have to be 0.
data | reference on a symmetric square matrix |
ref | true if we overwrite the data set, false otherwise |
Definition at line 241 of file STK_ISymEigen.h.
References STK::Arrays::lower_symmetric_, STK::Arrays::square_, STK_STATIC_ASSERT, STK::Arrays::symmetric_, and STK::Arrays::upper_symmetric_.
|
protected |
template constructor
data | reference on a symmetric square expression |
Definition at line 259 of file STK_ISymEigen.h.
References STK::Arrays::lower_symmetric_, STK::Arrays::square_, STK_STATIC_ASSERT, STK::Arrays::symmetric_, and STK::Arrays::upper_symmetric_.
|
protected |
Copy constructor.
eigen | the EigenValue to copy |
Definition at line 276 of file STK_ISymEigen.h.
References STK::Arrays::lower_symmetric_, STK::Arrays::square_, STK_STATIC_ASSERT, STK::Arrays::symmetric_, and STK::Arrays::upper_symmetric_.
|
inline |
|
inline |
Definition at line 127 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::det_.
Referenced by STK::hidden::InvertLowerSymMatrixImpl< Matrix, Size_ >::invertLowerSymMatrixXX(), STK::hidden::InvertSymImpl< Matrix, Size_ >::invertSymMatrixXX(), and STK::hidden::InvertUpperSymMatrixImpl< Matrix, Size_ >::invertUpperSymMatrixXX().
|
inline |
Definition at line 135 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::eigenValues_.
Referenced by main().
|
inline |
Definition at line 133 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::eigenVectors_.
Referenced by main().
|
protected |
finalize the computation by computing the trace, rank, trace norm and determinant of the matrix.
Definition at line 294 of file STK_ISymEigen.h.
References STK::sign().
|
inline |
Compute the generalized inverse of the symmetric matrix and put the result in res.
res | array with the result |
Definition at line 156 of file STK_ISymEigen.h.
References STK::ArrayBase< Derived >::diagonalize(), STK::ISymEigen< Derived >::eigenValues_, STK::ISymEigen< Derived >::eigenVectors_, STK::ISymEigen< Derived >::norm_, and STK::ArrayBase< Derived >::transpose().
Referenced by STK::hidden::InvertLowerSymMatrixImpl< Matrix, Size_ >::invertLowerSymMatrixXX(), STK::hidden::InvertSymImpl< Matrix, Size_ >::invertSymMatrixXX(), and STK::hidden::InvertUpperSymMatrixImpl< Matrix, Size_ >::invertUpperSymMatrixXX().
|
inline |
Compute the generalized square root inverse of the symmetric matrix and put the result in res.
res | array with the result |
Definition at line 169 of file STK_ISymEigen.h.
References STK::ArrayBase< Derived >::diagonalize(), STK::ISymEigen< Derived >::eigenValues_, STK::ISymEigen< Derived >::eigenVectors_, STK::ISymEigen< Derived >::norm_, and STK::ArrayBase< Derived >::transpose().
|
inline |
Compute the square root of the symmetric matrix and put the result in res.
res | array with the result |
Definition at line 181 of file STK_ISymEigen.h.
References STK::ArrayBase< Derived >::diagonalize(), STK::ISymEigen< Derived >::eigenValues_, STK::ISymEigen< Derived >::eigenVectors_, STK::ISymEigen< Derived >::norm_, and STK::ArrayBase< Derived >::transpose().
|
inline |
Definition at line 123 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::norm_.
|
inline |
Operator = : overwrite the ISymEigen with eigen.
eigen | ISymEigen to copy |
Definition at line 107 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::det_, STK::ISymEigen< Derived >::eigenValues_, STK::ISymEigen< Derived >::eigenVectors_, STK::ISymEigen< Derived >::norm_, STK::ISymEigen< Derived >::range_, STK::ISymEigen< Derived >::rank_, STK::ISymEigen< Derived >::SupportEigenVectors_, and STK::ISymEigen< Derived >::trace_.
|
inline |
Definition at line 121 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::range_.
|
inline |
Definition at line 125 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::rank_.
|
inline |
Definition at line 131 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::eigenVectors_.
|
inlinevirtual |
Find the eigenvalues and eigenvectors of the matrix.
Implements STK::IRunnerBase.
Definition at line 189 of file STK_ISymEigen.h.
References STK::IRecursiveTemplate< Derived >::asDerived(), STK::ISymEigen< Derived >::eigenVectors_, and STK::ICArray< Derived >::empty().
Referenced by STK::hidden::InvertLowerSymMatrixImpl< Matrix, Size_ >::invertLowerSymMatrixXX(), STK::hidden::InvertSymImpl< Matrix, Size_ >::invertSymMatrixXX(), STK::hidden::InvertUpperSymMatrixImpl< Matrix, Size_ >::invertUpperSymMatrixXX(), and main().
|
inline |
overloading of setData.
data | the data set to set. |
Definition at line 141 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::det_, STK::ISymEigen< Derived >::eigenValues_, STK::ISymEigen< Derived >::eigenVectors_, STK::IRunnerBase::hasRun_, STK::ISymEigen< Derived >::norm_, STK::ISymEigen< Derived >::range_, STK::ISymEigen< Derived >::rank_, STK::ICArray< Derived >::resize(), STK::Arrays::square_, STK_STATIC_ASSERT, STK::ISymEigen< Derived >::SupportEigenVectors_, and STK::ISymEigen< Derived >::trace_.
|
inline |
Definition at line 129 of file STK_ISymEigen.h.
References STK::ISymEigen< Derived >::trace_.
|
protected |
determinant
Definition at line 205 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::det(), STK::ISymEigen< Derived >::operator=(), and STK::ISymEigen< Derived >::setData().
|
protected |
Array of the eigenvalues.
Definition at line 209 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::eigenValues(), STK::ISymEigen< Derived >::ginv(), STK::ISymEigen< Derived >::ginvsqrt(), STK::ISymEigen< Derived >::gsqrt(), STK::ISymEigen< Derived >::operator=(), and STK::ISymEigen< Derived >::setData().
|
protected |
Square matrix or the eigenvectors.
Definition at line 207 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::eigenVectors(), STK::ISymEigen< Derived >::ginv(), STK::ISymEigen< Derived >::ginvsqrt(), STK::ISymEigen< Derived >::gsqrt(), STK::ISymEigen< Derived >::operator=(), STK::ISymEigen< Derived >::rotation(), STK::ISymEigen< Derived >::run(), and STK::ISymEigen< Derived >::setData().
|
protected |
trace norm
Definition at line 201 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::ginv(), STK::ISymEigen< Derived >::ginvsqrt(), STK::ISymEigen< Derived >::gsqrt(), STK::ISymEigen< Derived >::norm(), STK::ISymEigen< Derived >::operator=(), and STK::ISymEigen< Derived >::setData().
|
protected |
range of the original data set.
Definition at line 197 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::operator=(), STK::ISymEigen< Derived >::range(), and STK::ISymEigen< Derived >::setData().
|
protected |
rank
Definition at line 203 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::operator=(), STK::ISymEigen< Derived >::rank(), and STK::ISymEigen< Derived >::setData().
|
protected |
Array for the support of the eigenvectors.
Definition at line 211 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::operator=(), and STK::ISymEigen< Derived >::setData().
|
protected |
trace norm
Definition at line 199 of file STK_ISymEigen.h.
Referenced by STK::ISymEigen< Derived >::operator=(), STK::ISymEigen< Derived >::setData(), and STK::ISymEigen< Derived >::trace().