Class for computing matrix powers. More...
#include <MatrixPower.h>
Public Member Functions | |
Index | cols () const |
template<typename ResultType > | |
void | compute (ResultType &res, RealScalar p) |
Compute the matrix power. | |
MatrixPower (const MatrixType &A) | |
Constructor. | |
const MatrixPowerRetval < MatrixType > | operator() (RealScalar p) |
Returns the matrix power. | |
Index | rows () const |
Private Types | |
enum | { RowsAtCompileTime = MatrixType::RowsAtCompileTime, ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime } |
typedef Matrix< ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, MatrixType::Options, MaxRowsAtCompileTime, MaxColsAtCompileTime > | ComplexMatrix |
typedef std::complex< RealScalar > | ComplexScalar |
typedef MatrixType::Index | Index |
typedef MatrixType::RealScalar | RealScalar |
typedef MatrixType::Scalar | Scalar |
Private Member Functions | |
template<typename ResultType > | |
void | computeFracPower (ResultType &, RealScalar) |
template<typename ResultType > | |
void | computeIntPower (ResultType &, RealScalar) |
RealScalar | modfAndInit (RealScalar, RealScalar *) |
Static Private Member Functions | |
template<int Rows, int Cols, int Options, int MaxRows, int MaxCols> | |
static void | revertSchur (Matrix< ComplexScalar, Rows, Cols, Options, MaxRows, MaxCols > &res, const ComplexMatrix &T, const ComplexMatrix &U) |
template<int Rows, int Cols, int Options, int MaxRows, int MaxCols> | |
static void | revertSchur (Matrix< RealScalar, Rows, Cols, Options, MaxRows, MaxCols > &res, const ComplexMatrix &T, const ComplexMatrix &U) |
Private Attributes | |
MatrixType::Nested | m_A |
RealScalar | m_conditionNumber |
ComplexMatrix | m_fT |
ComplexMatrix | m_T |
MatrixType | m_tmp |
ComplexMatrix | m_U |
Class for computing matrix powers.
MatrixType | type of the base, expected to be an instantiation of the Matrix class template. |
This class is capable of computing real/complex matrices raised to an arbitrary real power. Meanwhile, it saves the result of Schur decomposition if an non-integral power has even been calculated. Therefore, if you want to compute multiple (>= 2) matrix powers for the same matrix, using the class directly is more efficient than calling MatrixBase::pow().
Example:
Definition at line 275 of file MatrixPower.h.
typedef Matrix<ComplexScalar, RowsAtCompileTime, ColsAtCompileTime, MatrixType::Options, MaxRowsAtCompileTime, MaxColsAtCompileTime> Eigen::MatrixPower< MatrixType >::ComplexMatrix [private] |
Definition at line 326 of file MatrixPower.h.
typedef std::complex<RealScalar> Eigen::MatrixPower< MatrixType >::ComplexScalar [private] |
Definition at line 324 of file MatrixPower.h.
typedef MatrixType::Index Eigen::MatrixPower< MatrixType >::Index [private] |
Definition at line 286 of file MatrixPower.h.
typedef MatrixType::RealScalar Eigen::MatrixPower< MatrixType >::RealScalar [private] |
Definition at line 285 of file MatrixPower.h.
typedef MatrixType::Scalar Eigen::MatrixPower< MatrixType >::Scalar [private] |
Definition at line 284 of file MatrixPower.h.
anonymous enum [private] |
Definition at line 278 of file MatrixPower.h.
Eigen::MatrixPower< MatrixType >::MatrixPower | ( | const MatrixType & | A | ) | [inline, explicit] |
Constructor.
[in] | A | the base of the matrix power. |
The class stores a reference to A, so it should not be changed (or destroyed) before evaluation.
Definition at line 297 of file MatrixPower.h.
Index Eigen::MatrixPower< MatrixType >::cols | ( | void | ) | const [inline] |
Definition at line 321 of file MatrixPower.h.
void Eigen::MatrixPower< MatrixType >::compute | ( | ResultType & | res, |
RealScalar | p | ||
) |
Compute the matrix power.
[in] | p | exponent, a real scalar. |
[out] | res | where A is specified in the constructor. |
Definition at line 356 of file MatrixPower.h.
void Eigen::MatrixPower< MatrixType >::computeFracPower | ( | ResultType & | res, |
RealScalar | p | ||
) | [private] |
Definition at line 416 of file MatrixPower.h.
void Eigen::MatrixPower< MatrixType >::computeIntPower | ( | ResultType & | res, |
RealScalar | p | ||
) | [private] |
Definition at line 398 of file MatrixPower.h.
MatrixPower< MatrixType >::RealScalar Eigen::MatrixPower< MatrixType >::modfAndInit | ( | RealScalar | x, |
RealScalar * | intpart | ||
) | [private] |
Definition at line 373 of file MatrixPower.h.
const MatrixPowerRetval<MatrixType> Eigen::MatrixPower< MatrixType >::operator() | ( | RealScalar | p | ) | [inline] |
Returns the matrix power.
[in] | p | exponent, a real scalar. |
Definition at line 307 of file MatrixPower.h.
void Eigen::MatrixPower< MatrixType >::revertSchur | ( | Matrix< ComplexScalar, Rows, Cols, Options, MaxRows, MaxCols > & | res, |
const ComplexMatrix & | T, | ||
const ComplexMatrix & | U | ||
) | [inline, static, private] |
Definition at line 428 of file MatrixPower.h.
void Eigen::MatrixPower< MatrixType >::revertSchur | ( | Matrix< RealScalar, Rows, Cols, Options, MaxRows, MaxCols > & | res, |
const ComplexMatrix & | T, | ||
const ComplexMatrix & | U | ||
) | [inline, static, private] |
Definition at line 436 of file MatrixPower.h.
Index Eigen::MatrixPower< MatrixType >::rows | ( | void | ) | const [inline] |
Definition at line 320 of file MatrixPower.h.
MatrixType::Nested Eigen::MatrixPower< MatrixType >::m_A [private] |
Definition at line 328 of file MatrixPower.h.
RealScalar Eigen::MatrixPower< MatrixType >::m_conditionNumber [private] |
Definition at line 331 of file MatrixPower.h.
ComplexMatrix Eigen::MatrixPower< MatrixType >::m_fT [private] |
Definition at line 330 of file MatrixPower.h.
ComplexMatrix Eigen::MatrixPower< MatrixType >::m_T [private] |
Definition at line 330 of file MatrixPower.h.
MatrixType Eigen::MatrixPower< MatrixType >::m_tmp [private] |
Definition at line 329 of file MatrixPower.h.
ComplexMatrix Eigen::MatrixPower< MatrixType >::m_U [private] |
Definition at line 330 of file MatrixPower.h.