- introduce sum() returning the sum of the coeffs of a vector

- reimplement trace() as just diagonal().sum()
- apidoc fixes
This commit is contained in:
Benoit Jacob
2008-03-15 11:05:38 +00:00
parent fb3438e609
commit 29184ad27d
7 changed files with 121 additions and 91 deletions

View File

@@ -27,10 +27,12 @@
/** \class DiagonalCoeffs
*
* \brief Expression of the main diagonal of a square matrix
* \brief Expression of the main diagonal of a matrix
*
* \param MatrixType the type of the object in which we are taking the main diagonal
*
* The matrix is not required to be square.
*
* This class represents an expression of the main diagonal of a square matrix.
* It is the return type of MatrixBase::diagonal() and most of the time this is
* the only way it is used.
@@ -84,7 +86,9 @@ template<typename MatrixType> class DiagonalCoeffs
const typename MatrixType::XprCopy m_matrix;
};
/** \returns an expression of the main diagonal of *this, which must be a square matrix.
/** \returns an expression of the main diagonal of the matrix \c *this
*
* \c *this is not required to be square.
*
* Example: \include MatrixBase_diagonal.cpp
* Output: \verbinclude MatrixBase_diagonal.out