diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-05-08 13:45:31 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-05-08 13:45:31 -0400 |
commit | bfdc1c49730c79e6058ba1506628341559670c25 (patch) | |
tree | cff450947e3fe4dabc07a382061c4664970a3a90 /Eigen/src/Core/EigenBase.h | |
parent | d03779f75f3a29b6cc76299f511aefc902771e4c (diff) |
introduce DenseCoeffsBase: this is where the coeff / coeffRef / etc... methods go.
Rationale: coeffRef() methods should only exist when we have DirectAccess. So a natural thing to do would have been to use enable_if, but since there are many methods it made more sense to do the "enable_if" for the whole group by introducing a new class. And that also that the benefit of not changing method prototypes.
Diffstat (limited to 'Eigen/src/Core/EigenBase.h')
-rw-r--r-- | Eigen/src/Core/EigenBase.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Eigen/src/Core/EigenBase.h b/Eigen/src/Core/EigenBase.h index cf1ce4376..e583fddc3 100644 --- a/Eigen/src/Core/EigenBase.h +++ b/Eigen/src/Core/EigenBase.h @@ -51,6 +51,9 @@ template<typename Derived> struct EigenBase inline int rows() const { return derived().rows(); } /** \returns the number of columns. \sa rows(), ColsAtCompileTime*/ inline int cols() const { return derived().cols(); } + /** \returns the number of coefficients, which is rows()*cols(). + * \sa rows(), cols(), SizeAtCompileTime. */ + inline int size() const { return rows() * cols(); } /** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */ template<typename Dest> inline void evalTo(Dest& dst) const |