aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/MapBase.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-08-31 17:07:54 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-08-31 17:07:54 +0200
commit095809edda92cb149cf3f558f2263a8dd3881da8 (patch)
treef56a1699965703c33302787a32b389a25320c082 /Eigen/src/Core/MapBase.h
parent27c9ecc50f2d6514a0cc570edecb982162fdca37 (diff)
fix issue #45 and document the .data() and .stride() functions
Diffstat (limited to 'Eigen/src/Core/MapBase.h')
-rw-r--r--Eigen/src/Core/MapBase.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h
index a0311ffcf..404fa176e 100644
--- a/Eigen/src/Core/MapBase.h
+++ b/Eigen/src/Core/MapBase.h
@@ -62,7 +62,21 @@ template<typename Derived> class MapBase
inline int rows() const { return m_rows.value(); }
inline int cols() const { return m_cols.value(); }
+ /** Returns the leading dimension (for matrices) or the increment (for vectors) to be used with data().
+ *
+ * More precisely:
+ * - for a column major matrix it returns the number of elements between two successive columns
+ * - for a row major matrix it returns the number of elements between two successive rows
+ * - for a vector it returns the number of elements between two successive coefficients
+ * This function has to be used together with the MapBase::data() function.
+ *
+ * \sa MapBase::data() */
inline int stride() const { return derived().stride(); }
+
+ /** Returns a pointer to the first coefficient of the matrix or vector.
+ * This function has to be used together with the stride() function.
+ *
+ * \sa MapBase::stride() */
inline const Scalar* data() const { return m_data; }
template<bool IsForceAligned,typename Dummy> struct force_aligned_impl {
@@ -167,9 +181,9 @@ template<typename Derived> class MapBase
}
#ifndef _MSC_VER
- Derived& operator=(const MapBase& other)
- {
- return Base::operator=(other);
+ Derived& operator=(const MapBase& other)
+ {
+ return Base::operator=(other);
}
#endif