|
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) |
|
template<typename MatrixType>
class Eigen::MatrixPower< MatrixType >
Class for computing matrix powers.
- Template Parameters
-
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:
#include <unsupported/Eigen/MatrixFunctions>
#include <iostream>
Matrix4cd
A = Matrix4cd::Random();
MatrixPower<Matrix4cd> Apow(
A);
std::cout << "The matrix A is:\n"
<< "\n\n"
"A^3.1 is:\n"
<< Apow(3.1)
<< "\n\n"
"A^3.3 is:\n"
<< Apow(3.3)
<< "\n\n"
"A^3.7 is:\n"
<< Apow(3.7)
<< "\n\n"
"A^3.9 is:\n"
<< Apow(3.9) << std::endl;
return 0;
}
int main(int argc, char *argv[])
Definition: T_protectiveWall.cpp:194
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
Definition: bench_gemm.cpp:47
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
Output:
template<typename MatrixType >
template<typename ResultType >
Compute the matrix power.
- Parameters
-
[in] | p | exponent, a real scalar. |
[out] | res | \( A^p \) where A is specified in the constructor. |
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Definition: PartialRedux_count.cpp:3
float * p
Definition: Tutorial_Map_using.cpp:9
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
Index cols() const
Definition: MatrixPower.h:380
void split(RealScalar &p, RealScalar &intpart)
Split p into integral part and fractional part.
Definition: MatrixPower.h:463
void computeFracPower(ResultType &res, RealScalar p)
Definition: MatrixPower.h:539
void computeIntPower(ResultType &res, RealScalar p)
Definition: MatrixPower.h:519
Index rows() const
Definition: MatrixPower.h:379
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
References cols, p, Eigen::bfloat16_impl::pow(), res, rows, and oomph::DoubleVectorHelpers::split().
Referenced by Eigen::MatrixPowerReturnValue< Derived >::evalTo().