diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-07-19 00:09:01 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-07-19 00:09:01 +0000 |
commit | 22a816ade884e3eee6a2f6a25f342e6a0d3448a0 (patch) | |
tree | becfc9016d9a7bdffdb30d15f99bf8aeed842a77 /Eigen/src/Core/Map.h | |
parent | 62ec1dd616377721d8be414911721bdc8967d677 (diff) |
* Fix a couple of issues related to the recent cache friendly products
* Improve the efficiency of matrix*vector in unaligned cases
* Trivial fixes in the destructors of MatrixStorage
* Removed the matrixNorm in test/product.cpp (twice faster and
that assumed the matrix product was ok while checking that !!)
Diffstat (limited to 'Eigen/src/Core/Map.h')
-rw-r--r-- | Eigen/src/Core/Map.h | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 92ac5f20b..13664eebc 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -66,6 +66,8 @@ template<typename MatrixType, int Alignment> class Map inline int rows() const { return m_rows.value(); } inline int cols() const { return m_cols.value(); } + inline int stride() const { return this->innerSize(); } + inline const Scalar& coeff(int row, int col) const { if(Flags & RowMajorBit) @@ -156,40 +158,6 @@ template<typename MatrixType, int Alignment> class Map const ei_int_if_dynamic<ColsAtCompileTime> m_cols; }; -/** Constructor copying an existing array of data. Only useful for dynamic-size matrices: - * for fixed-size matrices, it is redundant to pass the \a rows and \a cols parameters. - * \param data The array of data to copy - * \param rows The number of rows of the matrix to construct - * \param cols The number of columns of the matrix to construct - * - * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int, int) - */ -template<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags> -inline Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> - ::Matrix(const Scalar *data, int rows, int cols) - : m_storage(rows*cols, rows, cols) -{ - *this = Map<Matrix>(data, rows, cols); -} - -/** Constructor copying an existing array of data. Only useful for dynamic-size vectors: - * for fixed-size vectors, it is redundant to pass the \a size parameter. - * - * \only_for_vectors - * - * \param data The array of data to copy - * \param size The size of the vector to construct - * - * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int) - */ -template<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags> -inline Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> - ::Matrix(const Scalar *data, int size) - : m_storage(size, RowsAtCompileTime == 1 ? 1 : size, ColsAtCompileTime == 1 ? 1 : size) -{ - *this = Map<Matrix>(data, size); -} - /** Constructor copying an existing array of data. * Only for fixed-size matrices and vectors. * \param data The array of data to copy |