From 1191949e8725106035d0f7276857217585a115ef Mon Sep 17 00:00:00 2001 From: Chen-Pang He Date: Sun, 21 Jul 2013 00:19:46 +0800 Subject: [PATCH] Improve documentation on Kronecker product module. --- .../KroneckerProduct/KroneckerTensorProduct.h | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h index 6ec8eb558..80be9fd7a 100644 --- a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +++ b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h @@ -12,8 +12,15 @@ #ifndef KRONECKER_TENSOR_PRODUCT_H #define KRONECKER_TENSOR_PRODUCT_H -namespace Eigen { +namespace Eigen { +/*! + * \ingroup KroneckerProduct_Module + * + * \brief The base class of dense and sparse Kronecker product. + * + * \tparam Derived is the derived type. + */ template class KroneckerProductBase : public ReturnByValue { @@ -27,6 +34,7 @@ class KroneckerProductBase : public ReturnByValue typedef typename Traits::Index Index; public: + /*! \brief Constructor. */ KroneckerProductBase(const Lhs& A, const Rhs& B) : m_A(A), m_B(B) {} @@ -34,12 +42,20 @@ class KroneckerProductBase : public ReturnByValue inline Index rows() const { return m_A.rows() * m_B.rows(); } inline Index cols() const { return m_A.cols() * m_B.cols(); } + /*! + * This overrides ReturnByValue::coeff because this function is + * efficient enough. + */ Scalar coeff(Index row, Index col) const { return m_A.coeff(row / m_B.rows(), col / m_B.cols()) * m_B.coeff(row % m_B.rows(), col % m_B.cols()); } + /*! + * This overrides ReturnByValue::coeff because this function is + * efficient enough. + */ Scalar coeff(Index i) const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived); @@ -52,6 +68,8 @@ class KroneckerProductBase : public ReturnByValue }; /*! + * \ingroup KroneckerProduct_Module + * * \brief Kronecker tensor product helper class for dense matrices * * This class is the return value of kroneckerProduct(MatrixBase, @@ -80,6 +98,8 @@ class KroneckerProduct : public KroneckerProductBase > }; /*! + * \ingroup KroneckerProduct_Module + * * \brief Kronecker tensor product helper class for sparse matrices * * If at least one of the operands is a sparse matrix expression,