diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-03-04 17:08:23 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-03-04 17:08:23 +0000 |
commit | 861c6f4c9b4ceff1ad734e22f4615b260b1d9c45 (patch) | |
tree | 3c9b2fecf2b79b23ec869fedaba573058f9baba1 | |
parent | f65cca5d1d28cff4880026d48a9e95b279bed3e3 (diff) |
renaming: ref() --> asArg()
-rw-r--r-- | Eigen/src/Core/Block.h | 40 | ||||
-rw-r--r-- | Eigen/src/Core/Cast.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/Column.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/CwiseBinaryOp.h | 18 | ||||
-rw-r--r-- | Eigen/src/Core/CwiseUnaryOp.h | 14 | ||||
-rw-r--r-- | Eigen/src/Core/DiagonalCoeffs.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/DiagonalMatrix.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/Identity.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Map.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Matrix.h | 4 | ||||
-rw-r--r-- | Eigen/src/Core/MatrixBase.h | 14 | ||||
-rw-r--r-- | Eigen/src/Core/MatrixRef.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Minor.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/Ones.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Product.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/Random.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Row.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/ScalarMultiple.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/Transpose.h | 8 | ||||
-rw-r--r-- | Eigen/src/Core/Zero.h | 2 | ||||
-rw-r--r-- | doc/examples/class_Block.cpp | 4 | ||||
-rw-r--r-- | doc/examples/class_Cast.cpp | 2 | ||||
-rw-r--r-- | doc/examples/class_Column.cpp | 4 | ||||
-rw-r--r-- | doc/examples/class_CwiseBinaryOp.cpp | 2 | ||||
-rw-r--r-- | doc/examples/class_FixedBlock.cpp | 4 | ||||
-rw-r--r-- | doc/examples/class_Row.cpp | 4 |
26 files changed, 95 insertions, 95 deletions
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<typename MatrixType, { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Block>; friend class MatrixBase<Scalar, Block>::Traits; typedef MatrixBase<Scalar, Block> Base; @@ -104,7 +104,7 @@ template<typename MatrixType, : (BlockCols==Dynamic ? MatrixType::Traits::MaxColsAtCompileTime : BlockCols) }; - const Block& _ref() const { return *this; } + const Block& _asArg() const { return *this; } int _rows() const { return m_blockRows.value(); } int _cols() const { return m_blockCols.value(); } @@ -147,7 +147,7 @@ template<typename Scalar, typename Derived> Block<Derived> MatrixBase<Scalar, Derived> ::block(int startRow, int startCol, int blockRows, int blockCols) { - return Block<Derived>(ref(), startRow, startCol, blockRows, blockCols); + return Block<Derived>(asArg(), startRow, startCol, blockRows, blockCols); } /** This is the const version of block(int,int,int,int). */ @@ -155,7 +155,7 @@ template<typename Scalar, typename Derived> const Block<Derived> MatrixBase<Scalar, Derived> ::block(int startRow, int startCol, int blockRows, int blockCols) const { - return Block<Derived>(ref(), startRow, startCol, blockRows, blockCols); + return Block<Derived>(asArg(), startRow, startCol, blockRows, blockCols); } /** \returns a dynamic-size expression of a block in *this. @@ -179,7 +179,7 @@ Block<Derived> MatrixBase<Scalar, Derived> ::block(int start, int size) { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), Traits::RowsAtCompileTime == 1 ? 0 : start, + return Block<Derived>(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<Derived> MatrixBase<Scalar, Derived> ::block(int start, int size) const { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), Traits::RowsAtCompileTime == 1 ? 0 : start, + return Block<Derived>(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<Derived> MatrixBase<Scalar, Derived> ::start(int size) { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), 0, 0, + return Block<Derived>(asArg(), 0, 0, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); } @@ -228,7 +228,7 @@ const Block<Derived> MatrixBase<Scalar, Derived> ::start(int size) const { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), 0, 0, + return Block<Derived>(asArg(), 0, 0, Traits::RowsAtCompileTime == 1 ? 1 : size, Traits::ColsAtCompileTime == 1 ? 1 : size); } @@ -253,7 +253,7 @@ Block<Derived> MatrixBase<Scalar, Derived> ::end(int size) { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), + return Block<Derived>(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : rows() - size, Traits::ColsAtCompileTime == 1 ? 0 : cols() - size, Traits::RowsAtCompileTime == 1 ? 1 : size, @@ -266,7 +266,7 @@ const Block<Derived> MatrixBase<Scalar, Derived> ::end(int size) const { assert(Traits::IsVectorAtCompileTime); - return Block<Derived>(ref(), + return Block<Derived>(asArg(), Traits::RowsAtCompileTime == 1 ? 0 : rows() - size, Traits::ColsAtCompileTime == 1 ? 0 : cols() - size, Traits::RowsAtCompileTime == 1 ? 1 : size, @@ -294,13 +294,13 @@ Block<Derived> MatrixBase<Scalar, Derived> ::corner(CornerType type, int cRows, int cCols) { if(type == TopLeft) - return Block<Derived>(ref(), 0, 0, cRows, cCols); + return Block<Derived>(asArg(), 0, 0, cRows, cCols); else if(type == TopRight) - return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols); + return Block<Derived>(asArg(), 0, cols() - cCols, cRows, cCols); else if(type == BottomLeft) - return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols); + return Block<Derived>(asArg(), rows() - cRows, 0, cRows, cCols); else - return Block<Derived>(ref(), rows() - cRows, cols() - cCols, cRows, cCols); + return Block<Derived>(asArg(), rows() - cRows, cols() - cCols, cRows, cCols); } /** This is the const version of corner(CornerType, int, int).*/ @@ -309,13 +309,13 @@ const Block<Derived> MatrixBase<Scalar, Derived> ::corner(CornerType type, int cRows, int cCols) const { if(type == TopLeft) - return Block<Derived>(ref(), 0, 0, cRows, cCols); + return Block<Derived>(asArg(), 0, 0, cRows, cCols); else if(type == TopRight) - return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols); + return Block<Derived>(asArg(), 0, cols() - cCols, cRows, cCols); else if(type == BottomLeft) - return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols); + return Block<Derived>(asArg(), rows() - cRows, 0, cRows, cCols); else - return Block<Derived>(ref(), rows() - cRows, cols() - cCols, cRows, cCols); + return Block<Derived>(asArg(), rows() - cRows, cols() - cCols, cRows, cCols); } /** \returns a fixed-size expression of a block in *this. @@ -339,7 +339,7 @@ template<int BlockRows, int BlockCols> Block<Derived, BlockRows, BlockCols> MatrixBase<Scalar, Derived> ::block(int startRow, int startCol) { - return Block<Derived, BlockRows, BlockCols>(ref(), startRow, startCol); + return Block<Derived, BlockRows, BlockCols>(asArg(), startRow, startCol); } /** This is the const version of block<>(int, int). */ @@ -348,7 +348,7 @@ template<int BlockRows, int BlockCols> const Block<Derived, BlockRows, BlockCols> MatrixBase<Scalar, Derived> ::block(int startRow, int startCol) const { - return Block<Derived, BlockRows, BlockCols>(ref(), startRow, startCol); + return Block<Derived, BlockRows, BlockCols>(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<typename NewScalar, typename MatrixType> class Cast : NoOperatorEquals, { public: typedef NewScalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Cast>; friend class MatrixBase<Scalar, Cast>::Traits; typedef MatrixBase<Scalar, Cast> Base; @@ -64,7 +64,7 @@ template<typename NewScalar, typename MatrixType> 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<typename NewScalar> const Cast<NewScalar, Derived> MatrixBase<Scalar, Derived>::cast() const { - return Cast<NewScalar, Derived>(ref()); + return Cast<NewScalar, Derived>(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<typename MatrixType> class Column { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Column>; friend class MatrixBase<Scalar, Column>::Traits; typedef MatrixBase<Scalar, Column> Base; @@ -71,7 +71,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> Column<Derived> MatrixBase<Scalar, Derived>::col(int i) { - return Column<Derived>(ref(), i); + return Column<Derived>(asArg(), i); } /** This is the const version of col(). */ @@ -108,7 +108,7 @@ template<typename Scalar, typename Derived> const Column<Derived> MatrixBase<Scalar, Derived>::col(int i) const { - return Column<Derived>(ref(), i); + return Column<Derived>(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<Scalar, CwiseBinaryOp>; friend class MatrixBase<Scalar, CwiseBinaryOp>::Traits; typedef MatrixBase<Scalar, CwiseBinaryOp> 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<typename Scalar, typename Derived1, typename Derived2> const CwiseBinaryOp<CwiseDifferenceOp, Derived1, Derived2> operator-(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { - return CwiseBinaryOp<CwiseDifferenceOp, Derived1, Derived2>(mat1.ref(), mat2.ref()); + return CwiseBinaryOp<CwiseDifferenceOp, Derived1, Derived2>(mat1.asArg(), mat2.asArg()); } /** replaces \c *this by \c *this - \a other. @@ -154,7 +154,7 @@ template<typename Scalar, typename Derived1, typename Derived2> const CwiseBinaryOp<CwiseSumOp, Derived1, Derived2> operator+(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { - return CwiseBinaryOp<CwiseSumOp, Derived1, Derived2>(mat1.ref(), mat2.ref()); + return CwiseBinaryOp<CwiseSumOp, Derived1, Derived2>(mat1.asArg(), mat2.asArg()); } /** replaces \c *this by \c *this + \a other. @@ -179,7 +179,7 @@ template<typename OtherDerived> const CwiseBinaryOp<ScalarProductOp, Derived, OtherDerived> MatrixBase<Scalar, Derived>::cwiseProduct(const MatrixBase<Scalar, OtherDerived> &other) const { - return CwiseBinaryOp<ScalarProductOp, Derived, OtherDerived>(ref(), other.ref()); + return CwiseBinaryOp<ScalarProductOp, Derived, OtherDerived>(asArg(), other.asArg()); } @@ -192,7 +192,7 @@ template<typename OtherDerived> const CwiseBinaryOp<ScalarQuotientOp, Derived, OtherDerived> MatrixBase<Scalar, Derived>::cwiseQuotient(const MatrixBase<Scalar, OtherDerived> &other) const { - return CwiseBinaryOp<ScalarQuotientOp, Derived, OtherDerived>(ref(), other.ref()); + return CwiseBinaryOp<ScalarQuotientOp, Derived, OtherDerived>(asArg(), other.asArg()); } @@ -209,7 +209,7 @@ template<typename CustomBinaryOp, typename Scalar, typename Derived1, typename D const CwiseBinaryOp<CustomBinaryOp, Derived1, Derived2> cwise(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { - return CwiseBinaryOp<CustomBinaryOp, Derived1, Derived2>(mat1.ref(), mat2.ref()); + return CwiseBinaryOp<CustomBinaryOp, Derived1, Derived2>(mat1.asArg(), mat2.asArg()); } /** \returns an expression of a custom coefficient-wise operator of *this and \a other @@ -232,7 +232,7 @@ template<typename CustomBinaryOp, typename OtherDerived> const CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived> MatrixBase<Scalar, Derived>::cwise(const MatrixBase<Scalar, OtherDerived> &other) const { - return CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>(ref(), other.ref()); + return CwiseBinaryOp<CustomBinaryOp, Derived, OtherDerived>(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<Scalar, CwiseUnaryOp>; friend class MatrixBase<Scalar, CwiseUnaryOp>::Traits; typedef MatrixBase<Scalar, CwiseUnaryOp> 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<typename Scalar, typename Derived> const CwiseUnaryOp<ScalarOppositeOp,Derived> MatrixBase<Scalar, Derived>::operator-() const { - return CwiseUnaryOp<ScalarOppositeOp,Derived>(ref()); + return CwiseUnaryOp<ScalarOppositeOp,Derived>(asArg()); } /** \returns an expression of the opposite of \c *this @@ -105,7 +105,7 @@ template<typename Scalar, typename Derived> const CwiseUnaryOp<ScalarAbsOp,Derived> MatrixBase<Scalar, Derived>::cwiseAbs() const { - return CwiseUnaryOp<ScalarAbsOp,Derived>(ref()); + return CwiseUnaryOp<ScalarAbsOp,Derived>(asArg()); } @@ -122,7 +122,7 @@ template<typename CustomUnaryOp, typename Scalar, typename Derived> const CwiseUnaryOp<CustomUnaryOp, Derived> cwise(const MatrixBase<Scalar, Derived> &mat) { - return CwiseUnaryOp<CustomUnaryOp, Derived>(mat.ref()); + return CwiseUnaryOp<CustomUnaryOp, Derived>(mat.asArg()); } /** \returns an expression of a custom coefficient-wise unary operator of *this @@ -145,7 +145,7 @@ template<typename CustomUnaryOp> const CwiseUnaryOp<CustomUnaryOp, Derived> MatrixBase<Scalar, Derived>::cwise() const { - return CwiseUnaryOp<CustomUnaryOp, Derived>(ref()); + return CwiseUnaryOp<CustomUnaryOp, Derived>(asArg()); } @@ -164,7 +164,7 @@ template<typename Scalar, typename Derived> const CwiseUnaryOp<ScalarConjugateOp, Derived> MatrixBase<Scalar, Derived>::conjugate() const { - return CwiseUnaryOp<ScalarConjugateOp, Derived>(ref()); + return CwiseUnaryOp<ScalarConjugateOp, Derived>(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<typename MatrixType> class DiagonalCoeffs { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, DiagonalCoeffs>; friend class MatrixBase<Scalar, DiagonalCoeffs>::Traits; typedef MatrixBase<Scalar, DiagonalCoeffs> Base; @@ -63,7 +63,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> DiagonalCoeffs<Derived> MatrixBase<Scalar, Derived>::diagonal() { - return DiagonalCoeffs<Derived>(ref()); + return DiagonalCoeffs<Derived>(asArg()); } /** This is the const version of diagonal(). */ @@ -99,7 +99,7 @@ template<typename Scalar, typename Derived> const DiagonalCoeffs<Derived> MatrixBase<Scalar, Derived>::diagonal() const { - return DiagonalCoeffs<Derived>(ref()); + return DiagonalCoeffs<Derived>(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<Scalar, DiagonalMatrix>; friend class MatrixBase<Scalar, DiagonalMatrix>::Traits; typedef MatrixBase<Scalar, DiagonalMatrix> 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<typename Scalar, typename Derived> const DiagonalMatrix<Derived> MatrixBase<Scalar, Derived>::asDiagonal() const { - return DiagonalMatrix<Derived>(ref()); + return DiagonalMatrix<Derived>(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<typename MatrixType> 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<typename MatrixType> 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<Matrix> Ref; + typedef MatrixRef<Matrix> AsArg; friend class MatrixRef<Matrix>; private: @@ -101,7 +101,7 @@ class Matrix : public MatrixBase<_Scalar, Matrix<_Scalar, _Rows, _Cols, MatrixStorage<Scalar, MaxSizeAtCompileTime, RowsAtCompileTime, ColsAtCompileTime> 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<typename Scalar, typename Derived> 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<Derived>::Type Ref; + * are passed by reference, not by value. \sa asArg()*/ + typedef typename Reference<Derived>::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<typename Scalar, typename Derived> class MatrixBase bool isVector() const { return rows()==1 || cols()==1; } //@} - /** \returns a Ref to *this. \sa Ref */ - Ref ref() const - { return static_cast<const Derived *>(this)->_ref(); } + /** \returns a AsArg to *this. \sa AsArg */ + AsArg asArg() const + { return static_cast<const Derived *>(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<typename MatrixType> 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<typename MatrixType> class Minor { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Minor>; friend class MatrixBase<Scalar, Minor>::Traits; typedef MatrixBase<Scalar, Minor> Base; @@ -69,7 +69,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> Minor<Derived> MatrixBase<Scalar, Derived>::minor(int row, int col) { - return Minor<Derived>(ref(), row, col); + return Minor<Derived>(asArg(), row, col); } /** This is the const version of minor(). */ @@ -109,7 +109,7 @@ template<typename Scalar, typename Derived> const Minor<Derived> MatrixBase<Scalar, Derived>::minor(int row, int col) const { - return Minor<Derived>(ref(), row, col); + return Minor<Derived>(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<typename MatrixType> 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<typename Lhs, typename Rhs> 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<Scalar, Product>; friend class MatrixBase<Scalar, Product>::Traits; typedef MatrixBase<Scalar, Product> Base; @@ -97,7 +97,7 @@ template<typename Lhs, typename Rhs> 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<typename OtherDerived> const Product<Derived, OtherDerived> MatrixBase<Scalar, Derived>::lazyProduct(const MatrixBase<Scalar, OtherDerived> &other) const { - return Product<Derived, OtherDerived>(ref(), other.ref()); + return Product<Derived, OtherDerived>(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<typename MatrixType> 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<typename MatrixType> class Row { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Row>; friend class MatrixBase<Scalar, Row>::Traits; typedef MatrixBase<Scalar, Row> Base; @@ -77,7 +77,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> Row<Derived> MatrixBase<Scalar, Derived>::row(int i) { - return Row<Derived>(ref(), i); + return Row<Derived>(asArg(), i); } /** This is the const version of row(). */ @@ -115,7 +115,7 @@ template<typename Scalar, typename Derived> const Row<Derived> MatrixBase<Scalar, Derived>::row(int i) const { - return Row<Derived>(ref(), i); + return Row<Derived>(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<typename MatrixType> class ScalarMultiple : NoOperatorEquals, { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, ScalarMultiple>; friend class MatrixBase<Scalar, ScalarMultiple>::Traits; typedef MatrixBase<Scalar, ScalarMultiple> Base; @@ -57,7 +57,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> const ScalarMultiple<Derived> MatrixBase<Scalar, Derived>::operator*(const Scalar& scalar) const { - return ScalarMultiple<Derived>(ref(), scalar); + return ScalarMultiple<Derived>(asArg(), scalar); } /** \relates MatrixBase \sa class ScalarMultiple */ @@ -85,7 +85,7 @@ const ScalarMultiple<Derived> MatrixBase<Scalar, Derived>::operator/(const Scalar& scalar) const { assert(NumTraits<Scalar>::HasFloatingPoint); - return ScalarMultiple<Derived>(ref(), static_cast<Scalar>(1) / scalar); + return ScalarMultiple<Derived>(asArg(), static_cast<Scalar>(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<typename MatrixType> class Transpose { public: typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Ref MatRef; + typedef typename MatrixType::AsArg MatRef; friend class MatrixBase<Scalar, Transpose>; friend class MatrixBase<Scalar, Transpose>::Traits; typedef MatrixBase<Scalar, Transpose> Base; @@ -59,7 +59,7 @@ template<typename MatrixType> 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<typename Scalar, typename Derived> Transpose<Derived> MatrixBase<Scalar, Derived>::transpose() { - return Transpose<Derived>(ref()); + return Transpose<Derived>(asArg()); } /** This is the const version of transpose(). \sa adjoint() */ @@ -95,7 +95,7 @@ template<typename Scalar, typename Derived> const Transpose<Derived> MatrixBase<Scalar, Derived>::transpose() const { - return Transpose<Derived>(ref()); + return Transpose<Derived>(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<typename MatrixType> 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<typename Scalar, typename Derived> Eigen::Block<Derived> topLeftCorner(MatrixBase<Scalar, Derived>& m, int rows, int cols) { - return Eigen::Block<Derived>(m.ref(), 0, 0, rows, cols); + return Eigen::Block<Derived>(m.asArg(), 0, 0, rows, cols); } template<typename Scalar, typename Derived> const Eigen::Block<Derived> topLeftCorner(const MatrixBase<Scalar, Derived>& m, int rows, int cols) { - return Eigen::Block<Derived>(m.ref(), 0, 0, rows, cols); + return Eigen::Block<Derived>(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<Scalar, Derived>& m) return Eigen::Cast< typename Eigen::NumTraits<Scalar>::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<typename Scalar, typename Derived> Eigen::Column<Derived> firstColumn(MatrixBase<Scalar, Derived>& m) { - return Eigen::Column<Derived>(m.ref(), 0); + return Eigen::Column<Derived>(m.asArg(), 0); } template<typename Scalar, typename Derived> const Eigen::Column<Derived> firstColumn(const MatrixBase<Scalar, Derived>& m) { - return Eigen::Column<Derived>(m.ref(), 0); + return Eigen::Column<Derived>(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<typename Scalar, typename Derived1, typename Derived2> const Eigen::CwiseBinaryOp<CwiseMinOp, Derived1, Derived2> cwiseMin(const MatrixBase<Scalar, Derived1> &mat1, const MatrixBase<Scalar, Derived2> &mat2) { - return Eigen::CwiseBinaryOp<CwiseMinOp, Derived1, Derived2>(mat1.ref(), mat2.ref()); + return Eigen::CwiseBinaryOp<CwiseMinOp, Derived1, Derived2>(mat1.asArg(), mat2.asArg()); // Note that the above is equivalent to: // return mat1.template cwise<CwiseMinOp>(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<typename Scalar, typename Derived> Eigen::Block<Derived, 2, 2> topLeft2x2Corner(MatrixBase<Scalar, Derived>& m) { - return Eigen::Block<Derived, 2, 2>(m.ref(), 0, 0); + return Eigen::Block<Derived, 2, 2>(m.asArg(), 0, 0); } template<typename Scalar, typename Derived> const Eigen::Block<Derived, 2, 2> topLeft2x2Corner(const MatrixBase<Scalar, Derived>& m) { - return Eigen::Block<Derived, 2, 2>(m.ref(), 0, 0); + return Eigen::Block<Derived, 2, 2>(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<typename Scalar, typename Derived> Eigen::Row<Derived> firstRow(MatrixBase<Scalar, Derived>& m) { - return Eigen::Row<Derived>(m.ref(), 0); + return Eigen::Row<Derived>(m.asArg(), 0); } template<typename Scalar, typename Derived> const Eigen::Row<Derived> firstRow(const MatrixBase<Scalar, Derived>& m) { - return Eigen::Row<Derived>(m.ref(), 0); + return Eigen::Row<Derived>(m.asArg(), 0); } int main(int, char**) |