diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 7118db4b8..405839ae3 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -71,7 +71,7 @@ class DiagonalBase : public EigenBase const DiagonalProduct operator*(const MatrixBase &matrix) const; - inline const DiagonalWrapper, DiagonalVectorType> > + inline const DiagonalWrapper, const DiagonalVectorType> > inverse() const { return diagonal().cwiseInverse(); diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 3b5f5986b..ce5b53631 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -755,7 +755,7 @@ MatrixBase::triangularView() const /** \returns true if *this is approximately equal to an upper triangular matrix, * within the precision given by \a prec. * - * \sa isLowerTriangular(), extract(), part(), marked() + * \sa isLowerTriangular() */ template bool MatrixBase::isUpperTriangular(RealScalar prec) const @@ -780,7 +780,7 @@ bool MatrixBase::isUpperTriangular(RealScalar prec) const /** \returns true if *this is approximately equal to a lower triangular matrix, * within the precision given by \a prec. * - * \sa isUpperTriangular(), extract(), part(), marked() + * \sa isUpperTriangular() */ template bool MatrixBase::isLowerTriangular(RealScalar prec) const diff --git a/Eigen/src/Core/VectorwiseOp.h b/Eigen/src/Core/VectorwiseOp.h index 8e1a337ee..60a405129 100644 --- a/Eigen/src/Core/VectorwiseOp.h +++ b/Eigen/src/Core/VectorwiseOp.h @@ -447,8 +447,8 @@ template class VectorwiseOp /** Returns the expression of the sum of the vector \a other to each subvector of \c *this */ template EIGEN_STRONG_INLINE CwiseBinaryOp, - ExpressionTypeNestedCleaned, - typename ExtendedType::Type> + const ExpressionTypeNestedCleaned, + const typename ExtendedType::Type> operator+(const DenseBase& other) const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived); @@ -458,8 +458,8 @@ template class VectorwiseOp /** Returns the expression of the difference between each subvector of \c *this and the vector \a other */ template CwiseBinaryOp, - ExpressionTypeNestedCleaned, - typename ExtendedType::Type> + const ExpressionTypeNestedCleaned, + const typename ExtendedType::Type> operator-(const DenseBase& other) const { EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived); diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 1de2c6f26..b1bdea44e 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -342,10 +342,10 @@ #define EIGEN_MAKE_CWISE_BINARY_OP(METHOD,FUNCTOR) \ template \ - EIGEN_STRONG_INLINE const CwiseBinaryOp, Derived, OtherDerived> \ + EIGEN_STRONG_INLINE const CwiseBinaryOp, const Derived, const OtherDerived> \ METHOD(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const \ { \ - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); \ + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); \ } // the expression type of a cwise product @@ -355,8 +355,8 @@ typename internal::traits::Scalar, \ typename internal::traits::Scalar \ >, \ - LHS, \ - RHS \ + const LHS, \ + const RHS \ > #endif // EIGEN_MACROS_H diff --git a/Eigen/src/Geometry/AlignedBox.h b/Eigen/src/Geometry/AlignedBox.h index 0497eb301..d81dcad9e 100644 --- a/Eigen/src/Geometry/AlignedBox.h +++ b/Eigen/src/Geometry/AlignedBox.h @@ -121,7 +121,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim) /** \returns the center of the box */ inline const CwiseUnaryOp, - CwiseBinaryOp, VectorType, VectorType> > + const CwiseBinaryOp, const VectorType, const VectorType> > center() const { return (m_min+m_max)/2; } @@ -129,7 +129,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim) * Note that this function does not get the same * result for integral or floating scalar types: see */ - inline const CwiseBinaryOp< internal::scalar_difference_op, VectorType, VectorType> sizes() const + inline const CwiseBinaryOp< internal::scalar_difference_op, const VectorType, const VectorType> sizes() const { return m_max - m_min; } /** \returns the volume of the bounding box */ @@ -140,7 +140,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim) * if the length of the diagonal is needed: diagonal().norm() * will provide it. */ - inline CwiseBinaryOp< internal::scalar_difference_op, VectorType, VectorType> diagonal() const + inline CwiseBinaryOp< internal::scalar_difference_op, const VectorType, const VectorType> diagonal() const { return sizes(); } /** \returns the vertex of the bounding box at the corner defined by diff --git a/Eigen/src/plugins/ArrayCwiseBinaryOps.h b/Eigen/src/plugins/ArrayCwiseBinaryOps.h index d19299c35..3928b6bc9 100644 --- a/Eigen/src/plugins/ArrayCwiseBinaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseBinaryOps.h @@ -14,10 +14,10 @@ operator*(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa MatrixBase::cwiseQuotient */ template -EIGEN_STRONG_INLINE const CwiseBinaryOp, Derived, OtherDerived> +EIGEN_STRONG_INLINE const CwiseBinaryOp, const Derived, const OtherDerived> operator/(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise min of \c *this and \a other @@ -111,13 +111,13 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator!=,std::not_equal_to) * * \sa operator+=(), operator-() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> operator+(const Scalar& scalar) const { - return CwiseUnaryOp, Derived>(derived(), internal::scalar_add_op(scalar)); + return CwiseUnaryOp, const Derived>(derived(), internal::scalar_add_op(scalar)); } -friend inline const CwiseUnaryOp, Derived> +friend inline const CwiseUnaryOp, const Derived> operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& other) { return other + scalar; @@ -130,13 +130,13 @@ operator+(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& * * \sa operator+(), operator-=() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> operator-(const Scalar& scalar) const { return *this + (-scalar); } -friend inline const CwiseUnaryOp, CwiseUnaryOp,Derived> > +friend inline const CwiseUnaryOp, CwiseUnaryOp, const Derived> > operator-(const Scalar& scalar,const EIGEN_CURRENT_STORAGE_BASE_CLASS& other) { return (-other) + scalar; diff --git a/Eigen/src/plugins/ArrayCwiseUnaryOps.h b/Eigen/src/plugins/ArrayCwiseUnaryOps.h index 78479b985..3c6a59a87 100644 --- a/Eigen/src/plugins/ArrayCwiseUnaryOps.h +++ b/Eigen/src/plugins/ArrayCwiseUnaryOps.h @@ -7,7 +7,7 @@ * * \sa abs2() */ -EIGEN_STRONG_INLINE const CwiseUnaryOp, Derived> +EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> abs() const { return derived(); @@ -20,7 +20,7 @@ abs() const * * \sa abs(), square() */ -EIGEN_STRONG_INLINE const CwiseUnaryOp, Derived> +EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> abs2() const { return derived(); @@ -33,7 +33,7 @@ abs2() const * * \sa pow(), log(), sin(), cos() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> exp() const { return derived(); @@ -46,7 +46,7 @@ exp() const * * \sa exp() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> log() const { return derived(); @@ -59,7 +59,7 @@ log() const * * \sa pow(), square() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> sqrt() const { return derived(); @@ -72,7 +72,7 @@ sqrt() const * * \sa sin(), exp() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> cos() const { return derived(); @@ -86,7 +86,7 @@ cos() const * * \sa cos(), exp() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> sin() const { return derived(); @@ -100,10 +100,10 @@ sin() const * * \sa exp(), log() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> pow(const Scalar& exponent) const { - return CwiseUnaryOp,Derived> + return CwiseUnaryOp, const Derived> (derived(), internal::scalar_pow_op(exponent)); } @@ -115,7 +115,7 @@ pow(const Scalar& exponent) const * * \sa operator/(), operator*() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> inverse() const { return derived(); @@ -128,7 +128,7 @@ inverse() const * * \sa operator/(), operator*(), abs2() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> square() const { return derived(); @@ -141,16 +141,16 @@ square() const * * \sa square(), pow() */ -inline const CwiseUnaryOp, Derived> +inline const CwiseUnaryOp, const Derived> cube() const { return derived(); } #define EIGEN_MAKE_SCALAR_CWISE_UNARY_OP(METHOD_NAME,FUNCTOR) \ - inline const CwiseUnaryOp >,Derived> \ + inline const CwiseUnaryOp >, const Derived> \ METHOD_NAME(const Scalar& s) const { \ - return CwiseUnaryOp >,Derived> \ + return CwiseUnaryOp >, const Derived> \ (derived(), std::bind2nd(FUNCTOR(), s)); \ } diff --git a/Eigen/src/plugins/CommonCwiseBinaryOps.h b/Eigen/src/plugins/CommonCwiseBinaryOps.h index 944c86148..8f7765e72 100644 --- a/Eigen/src/plugins/CommonCwiseBinaryOps.h +++ b/Eigen/src/plugins/CommonCwiseBinaryOps.h @@ -53,9 +53,9 @@ EIGEN_MAKE_CWISE_BINARY_OP(operator+,internal::scalar_sum_op) * \sa class CwiseBinaryOp, operator+(), operator-(), cwiseProduct() */ template -EIGEN_STRONG_INLINE const CwiseBinaryOp +EIGEN_STRONG_INLINE const CwiseBinaryOp binaryExpr(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other, const CustomBinaryOp& func = CustomBinaryOp()) const { - return CwiseBinaryOp(derived(), other.derived(), func); + return CwiseBinaryOp(derived(), other.derived(), func); } diff --git a/Eigen/src/plugins/CommonCwiseUnaryOps.h b/Eigen/src/plugins/CommonCwiseUnaryOps.h index 631d6197b..941d5153c 100644 --- a/Eigen/src/plugins/CommonCwiseUnaryOps.h +++ b/Eigen/src/plugins/CommonCwiseUnaryOps.h @@ -28,17 +28,17 @@ #ifndef EIGEN_PARSED_BY_DOXYGEN /** \internal Represents a scalar multiple of an expression */ -typedef CwiseUnaryOp, Derived> ScalarMultipleReturnType; +typedef CwiseUnaryOp, const Derived> ScalarMultipleReturnType; /** \internal Represents a quotient of an expression by a scalar*/ -typedef CwiseUnaryOp, Derived> ScalarQuotient1ReturnType; +typedef CwiseUnaryOp, const Derived> ScalarQuotient1ReturnType; /** \internal the return type of conjugate() */ typedef typename internal::conditional::IsComplex, - const CwiseUnaryOp, Derived>, + const CwiseUnaryOp, const Derived>, const Derived& >::type ConjugateReturnType; /** \internal the return type of real() const */ typedef typename internal::conditional::IsComplex, - const CwiseUnaryOp, Derived>, + const CwiseUnaryOp, const Derived>, const Derived& >::type RealReturnType; /** \internal the return type of real() */ @@ -47,7 +47,7 @@ typedef typename internal::conditional::IsComplex, Derived& >::type NonConstRealReturnType; /** \internal the return type of imag() const */ -typedef CwiseUnaryOp, Derived> ImagReturnType; +typedef CwiseUnaryOp, const Derived> ImagReturnType; /** \internal the return type of imag() */ typedef CwiseUnaryView, Derived> NonConstImagReturnType; @@ -55,7 +55,7 @@ typedef CwiseUnaryView, Derived> NonConstIm /** \returns an expression of the opposite of \c *this */ -inline const CwiseUnaryOp::Scalar>,Derived> +inline const CwiseUnaryOp::Scalar>, const Derived> operator-() const { return derived(); } @@ -63,7 +63,7 @@ operator-() const { return derived(); } inline const ScalarMultipleReturnType operator*(const Scalar& scalar) const { - return CwiseUnaryOp, Derived> + return CwiseUnaryOp, const Derived> (derived(), internal::scalar_multiple_op(scalar)); } @@ -72,18 +72,18 @@ const ScalarMultipleReturnType operator*(const RealScalar& scalar) const; #endif /** \returns an expression of \c *this divided by the scalar value \a scalar */ -inline const CwiseUnaryOp::Scalar>, Derived> +inline const CwiseUnaryOp::Scalar>, const Derived> operator/(const Scalar& scalar) const { - return CwiseUnaryOp, Derived> + return CwiseUnaryOp, const Derived> (derived(), internal::scalar_quotient1_op(scalar)); } /** Overloaded for efficient real matrix times complex scalar value */ -inline const CwiseUnaryOp >, Derived> +inline const CwiseUnaryOp >, const Derived> operator*(const std::complex& scalar) const { - return CwiseUnaryOp >, Derived> + return CwiseUnaryOp >, const Derived> (*static_cast(this), internal::scalar_multiple2_op >(scalar)); } @@ -91,7 +91,7 @@ inline friend const ScalarMultipleReturnType operator*(const Scalar& scalar, const StorageBaseType& matrix) { return matrix*scalar; } -inline friend const CwiseUnaryOp >, Derived> +inline friend const CwiseUnaryOp >, const Derived> operator*(const std::complex& scalar, const StorageBaseType& matrix) { return matrix*scalar; } @@ -103,7 +103,7 @@ operator*(const std::complex& scalar, const StorageBaseType& matrix) * \sa class CwiseUnaryOp */ template -typename internal::cast_return_type::Scalar, NewType>, Derived> >::type +typename internal::cast_return_type::Scalar, NewType>, const Derived> >::type cast() const { return derived(); @@ -150,10 +150,10 @@ imag() const { return derived(); } * \sa class CwiseUnaryOp, class CwiseBinaryOp */ template -inline const CwiseUnaryOp +inline const CwiseUnaryOp unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const { - return CwiseUnaryOp(derived(), func); + return CwiseUnaryOp(derived(), func); } /** \returns an expression of a custom coefficient-wise unary operator \a func of *this @@ -168,10 +168,10 @@ unaryExpr(const CustomUnaryOp& func = CustomUnaryOp()) const * \sa class CwiseUnaryOp, class CwiseBinaryOp */ template -inline const CwiseUnaryView +inline const CwiseUnaryView unaryViewExpr(const CustomViewOp& func = CustomViewOp()) const { - return CwiseUnaryView(derived(), func); + return CwiseUnaryView(derived(), func); } /** \returns a non const expression of the real part of \c *this. diff --git a/Eigen/src/plugins/MatrixCwiseBinaryOps.h b/Eigen/src/plugins/MatrixCwiseBinaryOps.h index 75397c512..35183f91f 100644 --- a/Eigen/src/plugins/MatrixCwiseBinaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseBinaryOps.h @@ -52,10 +52,10 @@ cwiseProduct(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa cwiseNotEqual(), isApprox(), isMuchSmallerThan() */ template -inline const CwiseBinaryOp, Derived, OtherDerived> +inline const CwiseBinaryOp, const Derived, const OtherDerived> cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise != operator of *this and \a other @@ -71,10 +71,10 @@ cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa cwiseEqual(), isApprox(), isMuchSmallerThan() */ template -inline const CwiseBinaryOp, Derived, OtherDerived> +inline const CwiseBinaryOp, const Derived, const OtherDerived> cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise min of *this and \a other @@ -85,10 +85,10 @@ cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa class CwiseBinaryOp, max() */ template -EIGEN_STRONG_INLINE const CwiseBinaryOp, Derived, OtherDerived> +EIGEN_STRONG_INLINE const CwiseBinaryOp, const Derived, const OtherDerived> cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise max of *this and \a other @@ -99,10 +99,10 @@ cwiseMin(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa class CwiseBinaryOp, min() */ template -EIGEN_STRONG_INLINE const CwiseBinaryOp, Derived, OtherDerived> +EIGEN_STRONG_INLINE const CwiseBinaryOp, const Derived, const OtherDerived> cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } /** \returns an expression of the coefficient-wise quotient of *this and \a other @@ -113,8 +113,8 @@ cwiseMax(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const * \sa class CwiseBinaryOp, cwiseProduct(), cwiseInverse() */ template -EIGEN_STRONG_INLINE const CwiseBinaryOp, Derived, OtherDerived> +EIGEN_STRONG_INLINE const CwiseBinaryOp, const Derived, const OtherDerived> cwiseQuotient(const EIGEN_CURRENT_STORAGE_BASE_CLASS &other) const { - return CwiseBinaryOp, Derived, OtherDerived>(derived(), other.derived()); + return CwiseBinaryOp, const Derived, const OtherDerived>(derived(), other.derived()); } diff --git a/Eigen/src/plugins/MatrixCwiseUnaryOps.h b/Eigen/src/plugins/MatrixCwiseUnaryOps.h index 85df29cbe..f95c0fe29 100644 --- a/Eigen/src/plugins/MatrixCwiseUnaryOps.h +++ b/Eigen/src/plugins/MatrixCwiseUnaryOps.h @@ -32,7 +32,7 @@ * * \sa cwiseAbs2() */ -EIGEN_STRONG_INLINE const CwiseUnaryOp,Derived> +EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> cwiseAbs() const { return derived(); } /** \returns an expression of the coefficient-wise squared absolute value of \c *this @@ -42,7 +42,7 @@ cwiseAbs() const { return derived(); } * * \sa cwiseAbs() */ -EIGEN_STRONG_INLINE const CwiseUnaryOp,Derived> +EIGEN_STRONG_INLINE const CwiseUnaryOp, const Derived> cwiseAbs2() const { return derived(); } /** \returns an expression of the coefficient-wise square root of *this. @@ -52,7 +52,7 @@ cwiseAbs2() const { return derived(); } * * \sa cwisePow(), cwiseSquare() */ -inline const CwiseUnaryOp,Derived> +inline const CwiseUnaryOp, const Derived> cwiseSqrt() const { return derived(); } /** \returns an expression of the coefficient-wise inverse of *this. @@ -62,7 +62,7 @@ cwiseSqrt() const { return derived(); } * * \sa cwiseProduct() */ -inline const CwiseUnaryOp,Derived> +inline const CwiseUnaryOp, const Derived> cwiseInverse() const { return derived(); } /** \returns an expression of the coefficient-wise == operator of \c *this and a scalar \a s @@ -74,7 +74,7 @@ cwiseInverse() const { return derived(); } * * \sa cwiseEqual(const MatrixBase &) const */ -inline const CwiseUnaryOp >,Derived> +inline const CwiseUnaryOp >, const Derived> cwiseEqual(const Scalar& s) const { return CwiseUnaryOp >,Derived>