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. More... | |
MatrixPower (const MatrixType &A) | |
Constructor. More... | |
const MatrixPowerParenthesesReturnValue< MatrixType > | operator() (RealScalar p) |
Returns the matrix power. More... | |
Index | rows () const |
Private Types | |
typedef Matrix< ComplexScalar, Dynamic, Dynamic, 0, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime > | 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 &res, RealScalar p) |
template<typename ResultType > | |
void | computeIntPower (ResultType &res, RealScalar p) |
void | initialize () |
Perform Schur decomposition for fractional power. More... | |
void | split (RealScalar &p, RealScalar &intpart) |
Split p into integral part and fractional part. More... | |
Private Member Functions inherited from Eigen::internal::noncopyable | |
EIGEN_DEVICE_FUNC | noncopyable () |
EIGEN_DEVICE_FUNC | ~noncopyable () |
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 |
Reference to the base of matrix power. More... | |
RealScalar | m_conditionNumber |
Condition number of m_A. More... | |
ComplexMatrix | m_fT |
Store fractional power of m_T. More... | |
Index | m_nulls |
Rank deficiency of m_A. More... | |
Index | m_rank |
Rank of m_A. More... | |
ComplexMatrix | m_T |
Store the result of Schur decomposition. More... | |
MatrixType | m_tmp |
Temporary storage. More... | |
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:
Output:
Definition at line 15 of file MatrixPower.h.
|
private |
Definition at line 387 of file MatrixPower.h.
|
private |
Definition at line 385 of file MatrixPower.h.
|
private |
Definition at line 343 of file MatrixPower.h.
|
private |
Definition at line 342 of file MatrixPower.h.
|
private |
Definition at line 341 of file MatrixPower.h.
|
inlineexplicit |
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 354 of file MatrixPower.h.
|
inline |
Definition at line 382 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 450 of file MatrixPower.h.
|
private |
Definition at line 553 of file MatrixPower.h.
|
private |
Definition at line 530 of file MatrixPower.h.
|
private |
Perform Schur decomposition for fractional power.
Definition at line 491 of file MatrixPower.h.
|
inline |
Returns the matrix power.
[in] | p | exponent, a real scalar. |
Definition at line 368 of file MatrixPower.h.
|
inlinestaticprivate |
Definition at line 570 of file MatrixPower.h.
|
inlinestaticprivate |
Definition at line 578 of file MatrixPower.h.
|
inline |
Definition at line 381 of file MatrixPower.h.
|
private |
Split p into integral part and fractional part.
[in] | p | The exponent. |
[out] | p | The fractional part ranging in . |
[out] | intpart | The integral part. |
Only if the fractional part is nonzero, it calls initialize().
Definition at line 470 of file MatrixPower.h.
|
private |
Reference to the base of matrix power.
Definition at line 390 of file MatrixPower.h.
|
private |
Condition number of m_A.
It is initialized as 0 to avoid performing unnecessary Schur decomposition, which is the bottleneck.
Definition at line 407 of file MatrixPower.h.
|
private |
Store fractional power of m_T.
Definition at line 399 of file MatrixPower.h.
|
private |
Rank deficiency of m_A.
Definition at line 413 of file MatrixPower.h.
|
private |
Rank of m_A.
Definition at line 410 of file MatrixPower.h.
|
private |
Store the result of Schur decomposition.
Definition at line 396 of file MatrixPower.h.
|
private |
Temporary storage.
Definition at line 393 of file MatrixPower.h.
|
private |
Definition at line 396 of file MatrixPower.h.