From 17230686944e63cca8d9ce1c981d6e869fcbcb62 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Thu, 4 Mar 2010 18:33:51 +0100 Subject: [PATCH] Moved x()/y()/z() and w() access functions to DenseBase; they are now available for Arrays as well. --- Eigen/src/Core/Coeffs.h | 16 ++++++++-------- Eigen/src/Core/DenseBase.h | 9 +++++++++ Eigen/src/Core/MatrixBase.h | 9 --------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Eigen/src/Core/Coeffs.h b/Eigen/src/Core/Coeffs.h index da7b9153f..727dea75e 100644 --- a/Eigen/src/Core/Coeffs.h +++ b/Eigen/src/Core/Coeffs.h @@ -239,42 +239,42 @@ EIGEN_STRONG_INLINE typename ei_traits::Scalar& DenseBase /** equivalent to operator[](0). */ template -EIGEN_STRONG_INLINE const typename MatrixBase::CoeffReturnType MatrixBase +EIGEN_STRONG_INLINE const typename DenseBase::CoeffReturnType DenseBase ::x() const { return (*this)[0]; } /** equivalent to operator[](1). */ template -EIGEN_STRONG_INLINE const typename MatrixBase::CoeffReturnType MatrixBase +EIGEN_STRONG_INLINE const typename DenseBase::CoeffReturnType DenseBase ::y() const { return (*this)[1]; } /** equivalent to operator[](2). */ template -EIGEN_STRONG_INLINE const typename MatrixBase::CoeffReturnType MatrixBase +EIGEN_STRONG_INLINE const typename DenseBase::CoeffReturnType DenseBase ::z() const { return (*this)[2]; } /** equivalent to operator[](3). */ template -EIGEN_STRONG_INLINE const typename MatrixBase::CoeffReturnType MatrixBase +EIGEN_STRONG_INLINE const typename DenseBase::CoeffReturnType DenseBase ::w() const { return (*this)[3]; } /** equivalent to operator[](0). */ template -EIGEN_STRONG_INLINE typename ei_traits::Scalar& MatrixBase +EIGEN_STRONG_INLINE typename ei_traits::Scalar& DenseBase ::x() { return (*this)[0]; } /** equivalent to operator[](1). */ template -EIGEN_STRONG_INLINE typename ei_traits::Scalar& MatrixBase +EIGEN_STRONG_INLINE typename ei_traits::Scalar& DenseBase ::y() { return (*this)[1]; } /** equivalent to operator[](2). */ template -EIGEN_STRONG_INLINE typename ei_traits::Scalar& MatrixBase +EIGEN_STRONG_INLINE typename ei_traits::Scalar& DenseBase ::z() { return (*this)[2]; } /** equivalent to operator[](3). */ template -EIGEN_STRONG_INLINE typename ei_traits::Scalar& MatrixBase +EIGEN_STRONG_INLINE typename ei_traits::Scalar& DenseBase ::w() { return (*this)[3]; } /** \returns the packet of coefficients starting at the given row and column. It is your responsibility diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 67540bd8c..52a883811 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -280,6 +280,15 @@ template class DenseBase typedef Block::ColsAtCompileTime> RowXpr; #endif // not EIGEN_PARSED_BY_DOXYGEN + const CoeffReturnType x() const; + const CoeffReturnType y() const; + const CoeffReturnType z() const; + const CoeffReturnType w() const; + Scalar& x(); + Scalar& y(); + Scalar& z(); + Scalar& w(); + /** Copies \a other into *this. \returns a reference to *this. */ template Derived& operator=(const DenseBase& other); diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 9c62163ba..ac79de66d 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -169,15 +169,6 @@ template class MatrixBase Derived& lazyAssign(const ProductBase& other); #endif // not EIGEN_PARSED_BY_DOXYGEN - const CoeffReturnType x() const; - const CoeffReturnType y() const; - const CoeffReturnType z() const; - const CoeffReturnType w() const; - Scalar& x(); - Scalar& y(); - Scalar& z(); - Scalar& w(); - template Derived& operator+=(const MatrixBase& other); template