aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-02-09 14:45:17 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-02-09 14:45:17 +0100
commit285bc336d5eef7b522648f2fe8fb5a6df64a9645 (patch)
treec2bd11010d2f6725d2be8993434ae767b33520a6 /Eigen
parent840977529fd0e674e46a7cb6c5a5519c403b05bc (diff)
document lazyProduct
Diffstat (limited to 'Eigen')
-rw-r--r--Eigen/src/Core/Product.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 304dbc3ee..5903476b5 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -420,7 +420,7 @@ template<> struct ei_gemv_selector<OnTheRight,RowMajor,false>
*
* \note If instead of the matrix product you want the coefficient-wise product, see Cwise::operator*().
*
- * \sa lazy(), operator*=(const MatrixBase&), Cwise::operator*()
+ * \sa lazyProduct(), operator*=(const MatrixBase&), Cwise::operator*()
*/
template<typename Derived>
template<typename OtherDerived>
@@ -445,7 +445,22 @@ MatrixBase<Derived>::operator*(const MatrixBase<OtherDerived> &other) const
return typename ProductReturnType<Derived,OtherDerived>::Type(derived(), other.derived());
}
-
+/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation.
+ *
+ * The coefficients of the product will be computed as requested that is particularly useful when you
+ * only want to compute a small fraction of the result's coefficients.
+ * Here is an example:
+ * \code
+ * MatrixXf a(10,10), b(10,10);
+ * (a*b).diagonal().sum(); // here a*b is entirely computed into a 10x10 temporary matrix
+ * a.lazyProduct(b).diagonal().sum(); // here a*b is evaluated in a lazy manner,
+ * // so only the diagonal coefficients will be computed
+ * \endcode
+ *
+ * \warning This version of the matrix product can be much much slower if all coefficients have to be computed anyways.
+ *
+ * \sa operator*(const MatrixBase&)
+ */
template<typename Derived>
template<typename OtherDerived>
const typename ProductReturnType<Derived,OtherDerived,LazyCoeffBasedProductMode>::Type