- eigen2 now fully enforces constness! found a way to achieve that

with minimal code duplication. There now are only two (2)
  const_cast remaining in the whole source code.
- eigen2 now fully allows copying a row-vector into a column-vector.
  added a unit-test for that.
- split unit tests, improve docs, various improvements.
This commit is contained in:
Benoit Jacob
2007-12-25 17:20:58 +00:00
parent 3cd2a125b2
commit dad245af56
26 changed files with 414 additions and 141 deletions

View File

@@ -64,10 +64,17 @@ template<typename MatrixType> class DiagonalCoeffs
template<typename Scalar, typename Derived>
DiagonalCoeffs<Derived>
MatrixBase<Scalar, Derived>::diagonal()
{
return DiagonalCoeffs<Derived>(ref());
}
/** This is the const version of diagonal(). */
template<typename Scalar, typename Derived>
const DiagonalCoeffs<Derived>
MatrixBase<Scalar, Derived>::diagonal() const
{
return DiagonalCoeffs<Derived>
(static_cast<Derived*>(const_cast<MatrixBase*>(this))->ref());
return DiagonalCoeffs<Derived>(ref());
}
#endif // EIGEN_DIAGONALCOEFFS_H