aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/MatrixFunctions
diff options
context:
space:
mode:
authorGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-13 23:13:07 +0800
committerGravatar Chen-Pang He <jdh8@ms63.hinet.net>2013-07-13 23:13:07 +0800
commitd5501d3a90c954a901fe95e654f4195744179831 (patch)
tree4cfe6cce53917d9e442e2cb74278d99b87950e19 /unsupported/Eigen/src/MatrixFunctions
parent3c423ccfe215283c5a5159ac74a8a23603e3f9bd (diff)
Document on MatrixPowerAtomic.
Diffstat (limited to 'unsupported/Eigen/src/MatrixFunctions')
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixPower.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
index ffb344065..e1de7f606 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h
@@ -68,6 +68,21 @@ class MatrixPowerParenthesesReturnValue : public ReturnByValue< MatrixPowerParen
const RealScalar m_p;
};
+/**
+ * \ingroup MatrixFunctions_Module
+ *
+ * \brief Class for computing matrix powers.
+ *
+ * \tparam MatrixType type of the base, expected to be an instantiation
+ * of the Matrix class template.
+ *
+ * This class is capable of computing triangular real/complex matrices
+ * raised to a power in the interval \f$ (-1, 1) \f$.
+ *
+ * \note Currently this class is only used by MatrixPower. One may
+ * insist that this be nested into MatrixPower. This class is here to
+ * faciliate future development of triangular matrix functions.
+ */
template<typename MatrixType>
class MatrixPowerAtomic : internal::noncopyable
{
@@ -95,14 +110,35 @@ class MatrixPowerAtomic : internal::noncopyable
static RealScalar computeSuperDiag(RealScalar, RealScalar, RealScalar p);
public:
+ /**
+ * \brief Constructor.
+ *
+ * \param[in] T the base of the matrix power.
+ * \param[in] p the exponent of the matrix power, should be in
+ * \f$ (-1, 1) \f$.
+ *
+ * The class stores a reference to T, so it should not be changed
+ * (or destroyed) before evaluation. Only the upper triangular
+ * part of T is read.
+ */
MatrixPowerAtomic(const MatrixType& T, RealScalar p);
+
+ /**
+ * \brief Compute the matrix power.
+ *
+ * \param[out] res \f$ A^p \f$ where A and p are specified in the
+ * constructor.
+ */
void compute(ResultType& res) const;
};
template<typename MatrixType>
MatrixPowerAtomic<MatrixType>::MatrixPowerAtomic(const MatrixType& T, RealScalar p) :
m_A(T), m_p(p)
-{ eigen_assert(T.rows() == T.cols()); }
+{
+ eigen_assert(T.rows() == T.cols());
+ eigen_assert(p > -1 && p < 1);
+}
template<typename MatrixType>
void MatrixPowerAtomic<MatrixType>::compute(ResultType& res) const