![]() |
|
Class for computing matrix powers. More...
#include <MatrixPower.h>
Inheritance diagram for Eigen::MatrixPower< MatrixType >:Public Member Functions | |
| MatrixPower (const MatrixType &A) | |
| Constructor. More... | |
| const MatrixPowerParenthesesReturnValue< MatrixType > | operator() (RealScalar p) |
| Returns the matrix power. More... | |
| template<typename ResultType > | |
| void | compute (ResultType &res, RealScalar p) |
| Compute the matrix power. More... | |
| Index | rows () const |
| Index | cols () const |
Private Types | |
| typedef MatrixType::Scalar | Scalar |
| typedef MatrixType::RealScalar | RealScalar |
| typedef std::complex< RealScalar > | ComplexScalar |
| typedef Matrix< ComplexScalar, Dynamic, Dynamic, 0, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime > | ComplexMatrix |
Private Member Functions | |
| void | split (RealScalar &p, RealScalar &intpart) |
| Split p into integral part and fractional part. More... | |
| void | initialize () |
| Perform Schur decomposition for fractional power. More... | |
| template<typename ResultType > | |
| void | computeIntPower (ResultType &res, RealScalar p) |
| template<typename ResultType > | |
| void | computeFracPower (ResultType &res, RealScalar p) |
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... | |
| MatrixType | m_tmp |
| Temporary storage. More... | |
| ComplexMatrix | m_T |
| Store the result of Schur decomposition. More... | |
| ComplexMatrix | m_U |
| ComplexMatrix | m_fT |
| Store fractional power of m_T. More... | |
| RealScalar | m_conditionNumber |
| Condition number of m_A. More... | |
| Index | m_rank |
| Rank of m_A. More... | |
| Index | m_nulls |
| Rank deficiency of m_A. More... | |
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:
|
private |
|
private |
|
private |
|
private |
|
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.
References Eigen::PlainObjectBase< Derived >::cols(), eigen_assert, and Eigen::PlainObjectBase< Derived >::rows().
|
inline |
References Eigen::MatrixPower< MatrixType >::m_A.
Referenced by gdb.printers._MatrixEntryIterator::__next__(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
| void Eigen::MatrixPower< MatrixType >::compute | ( | ResultType & | res, |
| RealScalar | p | ||
| ) |
Compute the matrix power.
| [in] | p | exponent, a real scalar. |
| [out] | res | \( A^p \) where A is specified in the constructor. |
References cols, p, Eigen::bfloat16_impl::pow(), res, rows, and oomph::DoubleVectorHelpers::split().
Referenced by Eigen::MatrixPowerReturnValue< Derived >::evalTo().
|
private |
References Eigen::MatrixPowerAtomic< MatrixType >::compute(), eigen_assert, p, res, and rows.
|
private |
References abs(), Eigen::bfloat16_impl::fmod(), p, and res.
|
private |
Perform Schur decomposition for fractional power.
References cols, eigen_assert, i, j, rot(), rows, and schurOfA().
|
inline |
|
inlinestaticprivate |
References res, and RachelsAdvectionDiffusion::U.
|
inlinestaticprivate |
|
inline |
References Eigen::MatrixPower< MatrixType >::m_A.
Referenced by gdb.printers._MatrixEntryIterator::__next__(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
|
private |
Split p into integral part and fractional part.
| [in] | p | The exponent. |
| [out] | p | The fractional part ranging in \( (-1, 1) \). |
| [out] | intpart | The integral part. |
Only if the fractional part is nonzero, it calls initialize().
References Eigen::bfloat16_impl::floor(), p, and Eigen::bfloat16_impl::pow().
|
private |
Reference to the base of matrix power.
Referenced by Eigen::MatrixPower< MatrixType >::cols(), and Eigen::MatrixPower< MatrixType >::rows().
|
private |
Condition number of m_A.
It is initialized as 0 to avoid performing unnecessary Schur decomposition, which is the bottleneck.
|
private |
Store fractional power of m_T.
|
private |
Rank deficiency of m_A.
|
private |
Rank of m_A.
|
private |
Store the result of Schur decomposition.
|
private |
Temporary storage.
|
private |