aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MatrixBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/MatrixBase.h')
-rw-r--r--Eigen/src/Core/MatrixBase.h19
1 files changed, 6 insertions, 13 deletions
diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h
index f89d861ea..d5f8decee 100644
--- a/Eigen/src/Core/MatrixBase.h
+++ b/Eigen/src/Core/MatrixBase.h
@@ -57,6 +57,12 @@ template<typename Derived> class MatrixBase
typedef typename ei_traits<Derived>::Scalar Scalar;
+ const Derived& derived() const { return *static_cast<const Derived*>(this); }
+ Derived& derived() { return *static_cast<Derived*>(this); }
+ Derived& const_cast_derived() const
+ { return *static_cast<Derived*>(const_cast<MatrixBase*>(this)); }
+
+
/** The number of rows at compile-time. This is just a copy of the value provided
* by the \a Derived type. If a value is not known at compile-time,
* it is set to the \a Dynamic constant.
@@ -125,15 +131,6 @@ template<typename Derived> class MatrixBase
= ei_traits<Derived>::RowsAtCompileTime == 1 || ei_traits<Derived>::ColsAtCompileTime == 1
};
- /** 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 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 AsArg is
- * a typedef to MatrixRef, which works as a reference, so that matrices and vectors
- * 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
* \a Scalar is \a std::complex<T> then RealScalar is \a T.
@@ -161,10 +158,6 @@ template<typename Derived> class MatrixBase
bool isVector() const { return rows()==1 || cols()==1; }
//@}
- /** \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. */
template<typename OtherDerived>
Derived& operator=(const MatrixBase<OtherDerived>& other);