mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user