Remove some useless const_cast

This commit is contained in:
Gael Guennebaud 2019-01-17 18:27:49 +01:00
parent 0fe6b7d687
commit ee3662abc5
4 changed files with 4 additions and 4 deletions

View File

@ -81,7 +81,7 @@ class CwiseUnaryView : public CwiseUnaryViewImpl<ViewOp, MatrixType, typename in
/** \returns the nested expression */ /** \returns the nested expression */
typename internal::remove_reference<MatrixTypeNested>::type& typename internal::remove_reference<MatrixTypeNested>::type&
nestedExpression() { return m_matrix.const_cast_derived(); } nestedExpression() { return m_matrix; }
protected: protected:
MatrixTypeNested m_matrix; MatrixTypeNested m_matrix;

View File

@ -132,7 +132,7 @@ public:
/** \returns the nested expression */ /** \returns the nested expression */
typename internal::remove_reference<XprType>::type& typename internal::remove_reference<XprType>::type&
nestedExpression() { return m_xpr.const_cast_derived(); } nestedExpression() { return m_xpr; }
/** \returns a const reference to the object storing/generating the row indices */ /** \returns a const reference to the object storing/generating the row indices */
const RowIndices& rowIndices() const { return m_rowIndices; } const RowIndices& rowIndices() const { return m_rowIndices; }

View File

@ -203,7 +203,7 @@ struct vectorwise_reverse_inplace_impl<Horizontal>
template<typename ExpressionType, int Direction> template<typename ExpressionType, int Direction>
EIGEN_DEVICE_FUNC void VectorwiseOp<ExpressionType,Direction>::reverseInPlace() EIGEN_DEVICE_FUNC void VectorwiseOp<ExpressionType,Direction>::reverseInPlace()
{ {
internal::vectorwise_reverse_inplace_impl<Direction>::run(_expression().const_cast_derived()); internal::vectorwise_reverse_inplace_impl<Direction>::run(m_matrix);
} }
} // end namespace Eigen } // end namespace Eigen

View File

@ -19,7 +19,7 @@ template<typename Decomposition, typename RhsType, typename StorageKind> class S
* *
* \brief Pseudo expression representing a solving operation * \brief Pseudo expression representing a solving operation
* *
* \tparam Decomposition the type of the matrix or decomposion object * \tparam Decomposition the type of the matrix or decomposition object
* \tparam Rhstype the type of the right-hand side * \tparam Rhstype the type of the right-hand side
* *
* This class represents an expression of A.solve(B) * This class represents an expression of A.solve(B)