diff options
author | Chen-Pang He <jdh8@ms63.hinet.net> | 2013-07-13 22:12:09 +0800 |
---|---|---|
committer | Chen-Pang He <jdh8@ms63.hinet.net> | 2013-07-13 22:12:09 +0800 |
commit | 3c423ccfe215283c5a5159ac74a8a23603e3f9bd (patch) | |
tree | 0563ce2a58a0a2b00d8a8c173bbc655589cedf2e /unsupported | |
parent | 738d75d3eb187bf1b3169d0de4328c6a2a5ef500 (diff) |
Document on complex matrix power.
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/Eigen/src/MatrixFunctions/MatrixPower.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h index 5ba6278ae..ffb344065 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h @@ -513,7 +513,7 @@ class MatrixPowerReturnValue : public ReturnByValue< MatrixPowerReturnValue<Deri * \brief Constructor. * * \param[in] A %Matrix (expression), the base of the matrix power. - * \param[in] p scalar, the exponent of the matrix power. + * \param[in] p real scalar, the exponent of the matrix power. */ MatrixPowerReturnValue(const Derived& A, RealScalar p) : m_A(A), m_p(p) { } @@ -536,6 +536,19 @@ class MatrixPowerReturnValue : public ReturnByValue< MatrixPowerReturnValue<Deri const RealScalar m_p; }; +/** + * \ingroup MatrixFunctions_Module + * + * \brief Proxy for the matrix power of some matrix (expression). + * + * \tparam Derived type of the base, a matrix (expression). + * + * This class holds the arguments to the matrix power until it is + * assigned or evaluated for some other reason (so the argument + * should not be changed in the meantime). It is the return type of + * MatrixBase::pow() and related functions and most of the + * time this is the only way it is used. + */ template<typename Derived> class MatrixComplexPowerReturnValue : public ReturnByValue< MatrixComplexPowerReturnValue<Derived> > { @@ -544,9 +557,24 @@ class MatrixComplexPowerReturnValue : public ReturnByValue< MatrixComplexPowerRe typedef typename std::complex<typename Derived::RealScalar> ComplexScalar; typedef typename Derived::Index Index; + /** + * \brief Constructor. + * + * \param[in] A %Matrix (expression), the base of the matrix power. + * \param[in] p complex scalar, the exponent of the matrix power. + */ MatrixComplexPowerReturnValue(const Derived& A, const ComplexScalar& p) : m_A(A), m_p(p) { } + /** + * \brief Compute the matrix power. + * + * Because \p p is complex, \f$ A^p \f$ is simply evaluated as \f$ + * \exp(p \log(A)) \f$. + * + * \param[out] result \f$ A^p \f$ where \p A and \p p are as in the + * constructor. + */ template<typename ResultType> inline void evalTo(ResultType& res) const { res = (m_p * m_A.log()).exp(); } |