bug #882: fix various const-correctness issues with *View classes.

This commit is contained in:
Gael Guennebaud
2014-10-07 18:29:28 +02:00
parent 118b1113d9
commit 5741349294
8 changed files with 25 additions and 24 deletions

View File

@@ -297,9 +297,9 @@ template<typename Derived> class SparseMatrixBase : public EigenBase<Derived>
Derived& operator*=(const SparseMatrixBase<OtherDerived>& other);
template<int Mode>
inline const TriangularView<Derived, Mode> triangularView() const;
inline const TriangularView<const Derived, Mode> triangularView() const;
template<unsigned int UpLo> inline const SparseSelfAdjointView<Derived, UpLo> selfadjointView() const;
template<unsigned int UpLo> inline const SparseSelfAdjointView<const Derived, UpLo> selfadjointView() const;
template<unsigned int UpLo> inline SparseSelfAdjointView<Derived, UpLo> selfadjointView();
template<typename OtherDerived> Scalar dot(const MatrixBase<OtherDerived>& other) const;

View File

@@ -170,9 +170,9 @@ template<typename MatrixType, unsigned int _Mode> class SparseSelfAdjointView
template<typename Derived>
template<unsigned int Mode>
const SparseSelfAdjointView<Derived, Mode> SparseMatrixBase<Derived>::selfadjointView() const
const SparseSelfAdjointView<const Derived, Mode> SparseMatrixBase<Derived>::selfadjointView() const
{
return SparseSelfAdjointView<Derived, Mode>(derived());
return SparseSelfAdjointView<const Derived, Mode>(derived());
}
template<typename Derived>

View File

@@ -266,10 +266,10 @@ protected:
template<typename Derived>
template<int Mode>
inline const TriangularView<Derived, Mode>
inline const TriangularView<const Derived, Mode>
SparseMatrixBase<Derived>::triangularView() const
{
return TriangularView<Derived, Mode>(derived());
return TriangularView<const Derived, Mode>(derived());
}
} // end namespace Eigen