diff --git a/Eigen/src/Core/Block.h b/Eigen/src/Core/Block.h index 5c1827c43..d9f7ee531 100644 --- a/Eigen/src/Core/Block.h +++ b/Eigen/src/Core/Block.h @@ -63,7 +63,7 @@ template; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -104,7 +104,7 @@ template Block MatrixBase ::block(int startRow, int startCol, int blockRows, int blockCols) { - return Block(ref(), startRow, startCol, blockRows, blockCols); + return Block(asArg(), startRow, startCol, blockRows, blockCols); } /** This is the const version of block(int,int,int,int). */ @@ -155,7 +155,7 @@ template const Block MatrixBase ::block(int startRow, int startCol, int blockRows, int blockCols) const { - return Block(ref(), startRow, startCol, blockRows, blockCols); + return Block(asArg(), startRow, startCol, blockRows, blockCols); } /** \returns a dynamic-size expression of a block in *this. @@ -179,7 +179,7 @@ Block MatrixBase ::block(int start, int size) { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), Traits::RowsAtCompileTime == 1 ? 0 : start, + return Block(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : start, Traits::ColsAtCompileTime == 1 ? 0 : start, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); @@ -191,7 +191,7 @@ const Block MatrixBase ::block(int start, int size) const { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), Traits::RowsAtCompileTime == 1 ? 0 : start, + return Block(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : start, Traits::ColsAtCompileTime == 1 ? 0 : start, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); @@ -217,7 +217,7 @@ Block MatrixBase ::start(int size) { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), 0, 0, + return Block(asArg(), 0, 0, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); } @@ -228,7 +228,7 @@ const Block MatrixBase ::start(int size) const { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), 0, 0, + return Block(asArg(), 0, 0, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); } @@ -253,7 +253,7 @@ Block MatrixBase ::end(int size) { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), + return Block(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : rows() - size, Traits::ColsAtCompileTime == 1 ? 0 : cols() - size, Traits::RowsAtCompileTime == 1 ? 1 : size, @@ -266,7 +266,7 @@ const Block MatrixBase ::end(int size) const { assert(Traits::IsVectorAtCompileTime); - return Block(ref(), + return Block(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : rows() - size, Traits::ColsAtCompileTime == 1 ? 0 : cols() - size, Traits::RowsAtCompileTime == 1 ? 1 : size, @@ -294,13 +294,13 @@ Block MatrixBase ::corner(CornerType type, int cRows, int cCols) { if(type == TopLeft) - return Block(ref(), 0, 0, cRows, cCols); + return Block(asArg(), 0, 0, cRows, cCols); else if(type == TopRight) - return Block(ref(), 0, cols() - cCols, cRows, cCols); + return Block(asArg(), 0, cols() - cCols, cRows, cCols); else if(type == BottomLeft) - return Block(ref(), rows() - cRows, 0, cRows, cCols); + return Block(asArg(), rows() - cRows, 0, cRows, cCols); else - return Block(ref(), rows() - cRows, cols() - cCols, cRows, cCols); + return Block(asArg(), rows() - cRows, cols() - cCols, cRows, cCols); } /** This is the const version of corner(CornerType, int, int).*/ @@ -309,13 +309,13 @@ const Block MatrixBase ::corner(CornerType type, int cRows, int cCols) const { if(type == TopLeft) - return Block(ref(), 0, 0, cRows, cCols); + return Block(asArg(), 0, 0, cRows, cCols); else if(type == TopRight) - return Block(ref(), 0, cols() - cCols, cRows, cCols); + return Block(asArg(), 0, cols() - cCols, cRows, cCols); else if(type == BottomLeft) - return Block(ref(), rows() - cRows, 0, cRows, cCols); + return Block(asArg(), rows() - cRows, 0, cRows, cCols); else - return Block(ref(), rows() - cRows, cols() - cCols, cRows, cCols); + return Block(asArg(), rows() - cRows, cols() - cCols, cRows, cCols); } /** \returns a fixed-size expression of a block in *this. @@ -339,7 +339,7 @@ template Block MatrixBase ::block(int startRow, int startCol) { - return Block(ref(), startRow, startCol); + return Block(asArg(), startRow, startCol); } /** This is the const version of block<>(int, int). */ @@ -348,7 +348,7 @@ template const Block MatrixBase ::block(int startRow, int startCol) const { - return Block(ref(), startRow, startCol); + return Block(asArg(), startRow, startCol); } #endif // EIGEN_BLOCK_H diff --git a/Eigen/src/Core/Cast.h b/Eigen/src/Core/Cast.h index cc67ce5d8..29d24967f 100644 --- a/Eigen/src/Core/Cast.h +++ b/Eigen/src/Core/Cast.h @@ -50,7 +50,7 @@ template class Cast : NoOperatorEquals, { public: typedef NewScalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -64,7 +64,7 @@ template class Cast : NoOperatorEquals, MaxRowsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Cast& _ref() const { return *this; } + const Cast& _asArg() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return m_matrix.cols(); } @@ -92,7 +92,7 @@ template const Cast MatrixBase::cast() const { - return Cast(ref()); + return Cast(asArg()); } #endif // EIGEN_CAST_H diff --git a/Eigen/src/Core/Column.h b/Eigen/src/Core/Column.h index bece3caa7..d9aec6c42 100644 --- a/Eigen/src/Core/Column.h +++ b/Eigen/src/Core/Column.h @@ -50,7 +50,7 @@ template class Column { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -71,7 +71,7 @@ template class Column MaxColsAtCompileTime = 1 }; - const Column& _ref() const { return *this; } + const Column& _asArg() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return 1; } @@ -100,7 +100,7 @@ template Column MatrixBase::col(int i) { - return Column(ref(), i); + return Column(asArg(), i); } /** This is the const version of col(). */ @@ -108,7 +108,7 @@ template const Column MatrixBase::col(int i) const { - return Column(ref(), i); + return Column(asArg(), i); } #endif // EIGEN_COLUMN_H diff --git a/Eigen/src/Core/CwiseBinaryOp.h b/Eigen/src/Core/CwiseBinaryOp.h index 571c0ebad..a0e9b3cd3 100644 --- a/Eigen/src/Core/CwiseBinaryOp.h +++ b/Eigen/src/Core/CwiseBinaryOp.h @@ -52,8 +52,8 @@ class CwiseBinaryOp : NoOperatorEquals, { public: typedef typename Lhs::Scalar Scalar; - typedef typename Lhs::Ref LhsRef; - typedef typename Rhs::Ref RhsRef; + typedef typename Lhs::AsArg LhsRef; + typedef typename Rhs::AsArg RhsRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -72,7 +72,7 @@ class CwiseBinaryOp : NoOperatorEquals, MaxColsAtCompileTime = Lhs::Traits::MaxColsAtCompileTime }; - const CwiseBinaryOp& _ref() const { return *this; } + const CwiseBinaryOp& _asArg() const { return *this; } int _rows() const { return m_lhs.rows(); } int _cols() const { return m_lhs.cols(); } @@ -128,7 +128,7 @@ template const CwiseBinaryOp operator-(const MatrixBase &mat1, const MatrixBase &mat2) { - return CwiseBinaryOp(mat1.ref(), mat2.ref()); + return CwiseBinaryOp(mat1.asArg(), mat2.asArg()); } /** replaces \c *this by \c *this - \a other. @@ -154,7 +154,7 @@ template const CwiseBinaryOp operator+(const MatrixBase &mat1, const MatrixBase &mat2) { - return CwiseBinaryOp(mat1.ref(), mat2.ref()); + return CwiseBinaryOp(mat1.asArg(), mat2.asArg()); } /** replaces \c *this by \c *this + \a other. @@ -179,7 +179,7 @@ template const CwiseBinaryOp MatrixBase::cwiseProduct(const MatrixBase &other) const { - return CwiseBinaryOp(ref(), other.ref()); + return CwiseBinaryOp(asArg(), other.asArg()); } @@ -192,7 +192,7 @@ template const CwiseBinaryOp MatrixBase::cwiseQuotient(const MatrixBase &other) const { - return CwiseBinaryOp(ref(), other.ref()); + return CwiseBinaryOp(asArg(), other.asArg()); } @@ -209,7 +209,7 @@ template cwise(const MatrixBase &mat1, const MatrixBase &mat2) { - return CwiseBinaryOp(mat1.ref(), mat2.ref()); + return CwiseBinaryOp(mat1.asArg(), mat2.asArg()); } /** \returns an expression of a custom coefficient-wise operator of *this and \a other @@ -232,7 +232,7 @@ template const CwiseBinaryOp MatrixBase::cwise(const MatrixBase &other) const { - return CwiseBinaryOp(ref(), other.ref()); + return CwiseBinaryOp(asArg(), other.asArg()); } diff --git a/Eigen/src/Core/CwiseUnaryOp.h b/Eigen/src/Core/CwiseUnaryOp.h index e3eb9090f..7dc912416 100644 --- a/Eigen/src/Core/CwiseUnaryOp.h +++ b/Eigen/src/Core/CwiseUnaryOp.h @@ -45,7 +45,7 @@ class CwiseUnaryOp : NoOperatorEquals, { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -60,7 +60,7 @@ class CwiseUnaryOp : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const CwiseUnaryOp& _ref() const { return *this; } + const CwiseUnaryOp& _asArg() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return m_matrix.cols(); } @@ -96,7 +96,7 @@ template const CwiseUnaryOp MatrixBase::operator-() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(asArg()); } /** \returns an expression of the opposite of \c *this @@ -105,7 +105,7 @@ template const CwiseUnaryOp MatrixBase::cwiseAbs() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(asArg()); } @@ -122,7 +122,7 @@ template const CwiseUnaryOp cwise(const MatrixBase &mat) { - return CwiseUnaryOp(mat.ref()); + return CwiseUnaryOp(mat.asArg()); } /** \returns an expression of a custom coefficient-wise unary operator of *this @@ -145,7 +145,7 @@ template const CwiseUnaryOp MatrixBase::cwise() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(asArg()); } @@ -164,7 +164,7 @@ template const CwiseUnaryOp MatrixBase::conjugate() const { - return CwiseUnaryOp(ref()); + return CwiseUnaryOp(asArg()); } diff --git a/Eigen/src/Core/DiagonalCoeffs.h b/Eigen/src/Core/DiagonalCoeffs.h index 291bfe472..58c6e3ed8 100644 --- a/Eigen/src/Core/DiagonalCoeffs.h +++ b/Eigen/src/Core/DiagonalCoeffs.h @@ -42,7 +42,7 @@ template class DiagonalCoeffs { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -63,7 +63,7 @@ template class DiagonalCoeffs MaxColsAtCompileTime = 1 }; - const DiagonalCoeffs& _ref() const { return *this; } + const DiagonalCoeffs& _asArg() const { return *this; } int _rows() const { return std::min(m_matrix.rows(), m_matrix.cols()); } int _cols() const { return 1; } @@ -91,7 +91,7 @@ template DiagonalCoeffs MatrixBase::diagonal() { - return DiagonalCoeffs(ref()); + return DiagonalCoeffs(asArg()); } /** This is the const version of diagonal(). */ @@ -99,7 +99,7 @@ template const DiagonalCoeffs MatrixBase::diagonal() const { - return DiagonalCoeffs(ref()); + return DiagonalCoeffs(asArg()); } #endif // EIGEN_DIAGONALCOEFFS_H diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 6cfd910c6..90683e6bc 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -45,7 +45,7 @@ class DiagonalMatrix : NoOperatorEquals, { public: typedef typename CoeffsVectorType::Scalar Scalar; - typedef typename CoeffsVectorType::Ref CoeffsVecRef; + typedef typename CoeffsVectorType::AsArg CoeffsVecRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -64,7 +64,7 @@ class DiagonalMatrix : NoOperatorEquals, MaxColsAtCompileTime = CoeffsVectorType::Traits::MaxSizeAtCompileTime }; - const DiagonalMatrix& _ref() const { return *this; } + const DiagonalMatrix& _asArg() const { return *this; } int _rows() const { return m_coeffs.size(); } int _cols() const { return m_coeffs.size(); } @@ -90,7 +90,7 @@ template const DiagonalMatrix MatrixBase::asDiagonal() const { - return DiagonalMatrix(ref()); + return DiagonalMatrix(asArg()); } /** \returns true if *this is approximately equal to a diagonal matrix, diff --git a/Eigen/src/Core/Identity.h b/Eigen/src/Core/Identity.h index a057e915b..5fd854850 100644 --- a/Eigen/src/Core/Identity.h +++ b/Eigen/src/Core/Identity.h @@ -56,7 +56,7 @@ template class Identity : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Identity& _ref() const { return *this; } + const Identity& _asArg() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index b3160396a..ce46dd81c 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -56,7 +56,7 @@ template class Map MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Map& _ref() const { return *this; } + const Map& _asArg() const { return *this; } int _rows() const { return m_rows; } int _cols() const { return m_cols; } diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index bfb6d5f65..474b55eab 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -84,7 +84,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, typedef MatrixBase<_Scalar, Matrix> Base; typedef _Scalar Scalar; - typedef MatrixRef Ref; + typedef MatrixRef AsArg; friend class MatrixRef; private: @@ -101,7 +101,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, MatrixStorage m_storage; - Ref _ref() const { return Ref(*this); } + AsArg _asArg() const { return AsArg(*this); } int _rows() const { return m_storage.rows(); } int _cols() const { return m_storage.cols(); } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index 7d401e96c..09af4bd8d 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -125,13 +125,13 @@ template class MatrixBase }; /** This is the "reference type" used to pass objects of type MatrixBase as arguments - * to functions. If this MatrixBase type represents an expression, then \a Ref + * to functions. If this MatrixBase type represents an expression, then \a AsArg * is just this MatrixBase type itself, i.e. expressions are just passed by value * and the compiler is usually clever enough to optimize that. If, on the - * other hand, this MatrixBase type is an actual matrix or vector type, then \a Ref is + * other hand, this MatrixBase type is an actual matrix or vector type, then \a AsArg is * a typedef to MatrixRef, which works as a reference, so that matrices and vectors - * are passed by reference, not by value. \sa ref()*/ - typedef typename Reference::Type Ref; + * are passed by reference, not by value. \sa asArg()*/ + typedef typename Reference::Type AsArg; /** This is the "real scalar" type; if the \a Scalar type is already real numbers * (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If @@ -160,9 +160,9 @@ template class MatrixBase bool isVector() const { return rows()==1 || cols()==1; } //@} - /** \returns a Ref to *this. \sa Ref */ - Ref ref() const - { return static_cast(this)->_ref(); } + /** \returns a AsArg to *this. \sa AsArg */ + AsArg asArg() const + { return static_cast(this)->_asArg(); } //@{ /** Copies \a other into *this. \returns a reference to *this. */ diff --git a/Eigen/src/Core/MatrixRef.h b/Eigen/src/Core/MatrixRef.h index 7cc1fd138..0c5c9f632 100644 --- a/Eigen/src/Core/MatrixRef.h +++ b/Eigen/src/Core/MatrixRef.h @@ -47,7 +47,7 @@ template class MatrixRef MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - MatrixRef _ref() const { return *this; } + MatrixRef _asArg() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return m_matrix.cols(); } diff --git a/Eigen/src/Core/Minor.h b/Eigen/src/Core/Minor.h index b98f09707..8da9e9051 100644 --- a/Eigen/src/Core/Minor.h +++ b/Eigen/src/Core/Minor.h @@ -42,7 +42,7 @@ template class Minor { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -69,7 +69,7 @@ template class Minor MatrixType::Traits::MaxColsAtCompileTime - 1 : Dynamic }; - const Minor& _ref() const { return *this; } + const Minor& _asArg() const { return *this; } int _rows() const { return m_matrix.rows() - 1; } int _cols() const { return m_matrix.cols() - 1; } @@ -101,7 +101,7 @@ template Minor MatrixBase::minor(int row, int col) { - return Minor(ref(), row, col); + return Minor(asArg(), row, col); } /** This is the const version of minor(). */ @@ -109,7 +109,7 @@ template const Minor MatrixBase::minor(int row, int col) const { - return Minor(ref(), row, col); + return Minor(asArg(), row, col); } #endif // EIGEN_MINOR_H diff --git a/Eigen/src/Core/Ones.h b/Eigen/src/Core/Ones.h index e9131cd51..91b77cd9f 100644 --- a/Eigen/src/Core/Ones.h +++ b/Eigen/src/Core/Ones.h @@ -49,7 +49,7 @@ template class Ones : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Ones& _ref() const { return *this; } + const Ones& _asArg() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index f41d887a5..7ca68d76e 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -77,8 +77,8 @@ template class Product : NoOperatorEquals, { public: typedef typename Lhs::Scalar Scalar; - typedef typename Lhs::Ref LhsRef; - typedef typename Rhs::Ref RhsRef; + typedef typename Lhs::AsArg LhsRef; + typedef typename Rhs::AsArg RhsRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -97,7 +97,7 @@ template class Product : NoOperatorEquals, MaxColsAtCompileTime = Rhs::Traits::MaxColsAtCompileTime }; - const Product& _ref() const { return *this; } + const Product& _asArg() const { return *this; } int _rows() const { return m_lhs.rows(); } int _cols() const { return m_rhs.cols(); } @@ -138,7 +138,7 @@ template const Product MatrixBase::lazyProduct(const MatrixBase &other) const { - return Product(ref(), other.ref()); + return Product(asArg(), other.asArg()); } /** \relates MatrixBase diff --git a/Eigen/src/Core/Random.h b/Eigen/src/Core/Random.h index 468216d56..394e6c3b0 100644 --- a/Eigen/src/Core/Random.h +++ b/Eigen/src/Core/Random.h @@ -49,7 +49,7 @@ template class Random : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Random& _ref() const { return *this; } + const Random& _asArg() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } diff --git a/Eigen/src/Core/Row.h b/Eigen/src/Core/Row.h index 4657e32db..b9d245ea7 100644 --- a/Eigen/src/Core/Row.h +++ b/Eigen/src/Core/Row.h @@ -50,7 +50,7 @@ template class Row { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -77,7 +77,7 @@ template class Row MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Row& _ref() const { return *this; } + const Row& _asArg() const { return *this; } int _rows() const { return 1; } int _cols() const { return m_matrix.cols(); } @@ -107,7 +107,7 @@ template Row MatrixBase::row(int i) { - return Row(ref(), i); + return Row(asArg(), i); } /** This is the const version of row(). */ @@ -115,7 +115,7 @@ template const Row MatrixBase::row(int i) const { - return Row(ref(), i); + return Row(asArg(), i); } #endif // EIGEN_ROW_H diff --git a/Eigen/src/Core/ScalarMultiple.h b/Eigen/src/Core/ScalarMultiple.h index 29858cea9..e37865790 100644 --- a/Eigen/src/Core/ScalarMultiple.h +++ b/Eigen/src/Core/ScalarMultiple.h @@ -41,7 +41,7 @@ template class ScalarMultiple : NoOperatorEquals, { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -57,7 +57,7 @@ template class ScalarMultiple : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const ScalarMultiple& _ref() const { return *this; } + const ScalarMultiple& _asArg() const { return *this; } int _rows() const { return m_matrix.rows(); } int _cols() const { return m_matrix.cols(); } @@ -76,7 +76,7 @@ template const ScalarMultiple MatrixBase::operator*(const Scalar& scalar) const { - return ScalarMultiple(ref(), scalar); + return ScalarMultiple(asArg(), scalar); } /** \relates MatrixBase \sa class ScalarMultiple */ @@ -85,7 +85,7 @@ const ScalarMultiple MatrixBase::operator/(const Scalar& scalar) const { assert(NumTraits::HasFloatingPoint); - return ScalarMultiple(ref(), static_cast(1) / scalar); + return ScalarMultiple(asArg(), static_cast(1) / scalar); } /** \sa ScalarMultiple */ diff --git a/Eigen/src/Core/Transpose.h b/Eigen/src/Core/Transpose.h index 3fbf87b0c..8948f7dac 100644 --- a/Eigen/src/Core/Transpose.h +++ b/Eigen/src/Core/Transpose.h @@ -42,7 +42,7 @@ template class Transpose { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase; friend class MatrixBase::Traits; typedef MatrixBase Base; @@ -59,7 +59,7 @@ template class Transpose MaxColsAtCompileTime = MatrixType::Traits::MaxRowsAtCompileTime }; - const Transpose& _ref() const { return *this; } + const Transpose& _asArg() const { return *this; } int _rows() const { return m_matrix.cols(); } int _cols() const { return m_matrix.rows(); } @@ -87,7 +87,7 @@ template Transpose MatrixBase::transpose() { - return Transpose(ref()); + return Transpose(asArg()); } /** This is the const version of transpose(). \sa adjoint() */ @@ -95,7 +95,7 @@ template const Transpose MatrixBase::transpose() const { - return Transpose(ref()); + return Transpose(asArg()); } /** \returns an expression of the adjoint (i.e. conjugate transpose) of *this. diff --git a/Eigen/src/Core/Zero.h b/Eigen/src/Core/Zero.h index e152a6fc1..abfb65db7 100644 --- a/Eigen/src/Core/Zero.h +++ b/Eigen/src/Core/Zero.h @@ -49,7 +49,7 @@ template class Zero : NoOperatorEquals, MaxColsAtCompileTime = MatrixType::Traits::MaxColsAtCompileTime }; - const Zero& _ref() const { return *this; } + const Zero& _asArg() const { return *this; } int _rows() const { return m_rows.value(); } int _cols() const { return m_cols.value(); } diff --git a/doc/examples/class_Block.cpp b/doc/examples/class_Block.cpp index 6d48d235d..26f9666cb 100644 --- a/doc/examples/class_Block.cpp +++ b/doc/examples/class_Block.cpp @@ -6,14 +6,14 @@ template Eigen::Block topLeftCorner(MatrixBase& m, int rows, int cols) { - return Eigen::Block(m.ref(), 0, 0, rows, cols); + return Eigen::Block(m.asArg(), 0, 0, rows, cols); } template const Eigen::Block topLeftCorner(const MatrixBase& m, int rows, int cols) { - return Eigen::Block(m.ref(), 0, 0, rows, cols); + return Eigen::Block(m.asArg(), 0, 0, rows, cols); } int main(int, char**) diff --git a/doc/examples/class_Cast.cpp b/doc/examples/class_Cast.cpp index f50fd2f4f..9751b05c1 100644 --- a/doc/examples/class_Cast.cpp +++ b/doc/examples/class_Cast.cpp @@ -12,7 +12,7 @@ castToFloatingPoint(const MatrixBase& m) return Eigen::Cast< typename Eigen::NumTraits::FloatingPoint, Derived - >(m.ref()); + >(m.asArg()); } int main(int, char**) diff --git a/doc/examples/class_Column.cpp b/doc/examples/class_Column.cpp index bab6eaedc..3b37d835f 100644 --- a/doc/examples/class_Column.cpp +++ b/doc/examples/class_Column.cpp @@ -6,14 +6,14 @@ template Eigen::Column firstColumn(MatrixBase& m) { - return Eigen::Column(m.ref(), 0); + return Eigen::Column(m.asArg(), 0); } template const Eigen::Column firstColumn(const MatrixBase& m) { - return Eigen::Column(m.ref(), 0); + return Eigen::Column(m.asArg(), 0); } int main(int, char**) diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp index 2a0f11a75..9bb10cdcb 100644 --- a/doc/examples/class_CwiseBinaryOp.cpp +++ b/doc/examples/class_CwiseBinaryOp.cpp @@ -13,7 +13,7 @@ template const Eigen::CwiseBinaryOp cwiseMin(const MatrixBase &mat1, const MatrixBase &mat2) { - return Eigen::CwiseBinaryOp(mat1.ref(), mat2.ref()); + return Eigen::CwiseBinaryOp(mat1.asArg(), mat2.asArg()); // Note that the above is equivalent to: // return mat1.template cwise(mat2); } diff --git a/doc/examples/class_FixedBlock.cpp b/doc/examples/class_FixedBlock.cpp index a6025231e..18dda46e7 100644 --- a/doc/examples/class_FixedBlock.cpp +++ b/doc/examples/class_FixedBlock.cpp @@ -6,14 +6,14 @@ template Eigen::Block topLeft2x2Corner(MatrixBase& m) { - return Eigen::Block(m.ref(), 0, 0); + return Eigen::Block(m.asArg(), 0, 0); } template const Eigen::Block topLeft2x2Corner(const MatrixBase& m) { - return Eigen::Block(m.ref(), 0, 0); + return Eigen::Block(m.asArg(), 0, 0); } int main(int, char**) diff --git a/doc/examples/class_Row.cpp b/doc/examples/class_Row.cpp index 12c144c85..23358d869 100644 --- a/doc/examples/class_Row.cpp +++ b/doc/examples/class_Row.cpp @@ -6,14 +6,14 @@ template Eigen::Row firstRow(MatrixBase& m) { - return Eigen::Row(m.ref(), 0); + return Eigen::Row(m.asArg(), 0); } template const Eigen::Row firstRow(const MatrixBase& m) { - return Eigen::Row(m.ref(), 0); + return Eigen::Row(m.asArg(), 0); } int main(int, char**)