fix several const qualifier issues: double ones, meaningless ones, some missing ones, etc.

(note that const qualifiers are set by internall::nested)
This commit is contained in:
Gael Guennebaud
2012-02-03 23:18:26 +01:00
parent bc7b251cd9
commit fe85b7ebc6
55 changed files with 151 additions and 141 deletions

View File

@@ -190,7 +190,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
template<typename Derived>
inline bool contains(const MatrixBase<Derived>& a_p) const
{
const typename internal::nested<Derived,2>::type p(a_p.derived());
typename internal::nested<Derived,2>::type p(a_p.derived());
return (m_min.array()<=p.array()).all() && (p.array()<=m_max.array()).all();
}
@@ -202,7 +202,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
template<typename Derived>
inline AlignedBox& extend(const MatrixBase<Derived>& a_p)
{
const typename internal::nested<Derived,2>::type p(a_p.derived());
typename internal::nested<Derived,2>::type p(a_p.derived());
m_min = m_min.cwiseMin(p);
m_max = m_max.cwiseMax(p);
return *this;

View File

@@ -121,7 +121,7 @@ template<typename MatrixType,int _Direction> class Homogeneous
}
protected:
const typename MatrixType::Nested m_matrix;
typename MatrixType::Nested m_matrix;
};
/** \geometry_module
@@ -216,8 +216,8 @@ template<typename Scalar, int Dim, int Mode,int Options>
struct take_matrix_for_product<Transform<Scalar, Dim, Mode, Options> >
{
typedef Transform<Scalar, Dim, Mode, Options> TransformType;
typedef typename TransformType::ConstAffinePart type;
static const type run (const TransformType& x) { return x.affine(); }
typedef typename internal::add_const<typename TransformType::ConstAffinePart>::type type;
static type run (const TransformType& x) { return x.affine(); }
};
template<typename Scalar, int Dim, int Options>
@@ -270,8 +270,8 @@ struct homogeneous_left_product_impl<Homogeneous<MatrixType,Vertical>,Lhs>
.template replicate<MatrixType::ColsAtCompileTime>(m_rhs.cols());
}
const typename LhsMatrixTypeCleaned::Nested m_lhs;
const typename MatrixType::Nested m_rhs;
typename LhsMatrixTypeCleaned::Nested m_lhs;
typename MatrixType::Nested m_rhs;
};
template<typename MatrixType,typename Rhs>
@@ -309,8 +309,8 @@ struct homogeneous_right_product_impl<Homogeneous<MatrixType,Horizontal>,Rhs>
.template replicate<MatrixType::RowsAtCompileTime>(m_lhs.rows());
}
const typename MatrixType::Nested m_lhs;
const typename Rhs::Nested m_rhs;
typename MatrixType::Nested m_lhs;
typename Rhs::Nested m_rhs;
};
} // end namespace internal

View File

@@ -43,8 +43,8 @@ MatrixBase<Derived>::cross(const MatrixBase<OtherDerived>& other) const
// Note that there is no need for an expression here since the compiler
// optimize such a small temporary very well (even within a complex expression)
const typename internal::nested<Derived,2>::type lhs(derived());
const typename internal::nested<OtherDerived,2>::type rhs(other.derived());
typename internal::nested<Derived,2>::type lhs(derived());
typename internal::nested<OtherDerived,2>::type rhs(other.derived());
return typename cross_product_return_type<OtherDerived>::type(
internal::conj(lhs.coeff(1) * rhs.coeff(2) - lhs.coeff(2) * rhs.coeff(1)),
internal::conj(lhs.coeff(2) * rhs.coeff(0) - lhs.coeff(0) * rhs.coeff(2)),