make shameless use of const_cast to reduce code redundancy. This means Eigen2

gives up enforcing constness. I really tried to enforce it, but it really was
much hassle because our expression templates can be lvalues (not only rvalues)
and so much code had to be written twice.
This commit is contained in:
Benoit Jacob
2007-10-15 05:56:21 +00:00
parent f355ef2df0
commit 884a718b0a
20 changed files with 34 additions and 83 deletions

View File

@@ -43,7 +43,6 @@ using Eigen::Matrix;
//forward declarations
template<typename _Scalar, int _Rows, int _Cols> class Matrix;
template<typename MatrixType> class MatrixRef;
template<typename MatrixType> class MatrixConstRef;
template<typename MatrixType> class Row;
template<typename MatrixType> class Column;
template<typename MatrixType> class Minor;
@@ -64,14 +63,12 @@ template<typename MatrixType> class FromArray;
template<typename T> struct ForwardDecl
{
typedef T Ref;
typedef T ConstRef;
};
template<typename _Scalar, int _Rows, int _Cols>
struct ForwardDecl<Matrix<_Scalar, _Rows, _Cols> >
{
typedef MatrixRef<Matrix<_Scalar, _Rows, _Cols> > Ref;
typedef MatrixConstRef<Matrix<_Scalar, _Rows, _Cols> > ConstRef;
};
const int Dynamic = -1;