diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 1eb879193..f4c660af9 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -97,17 +97,17 @@ template class Map }; /** This is the const version of map(Scalar*,int,int). */ -template -inline const Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data, int rows, int cols) +template +inline const Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(const Scalar* data, int rows, int cols) { return Map(data, rows, cols); } /** This is the const version of map(Scalar*,int). */ -template -inline const Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data, int size) +template +inline const Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(const Scalar* data, int size) { ei_assert(_Cols == 1 || _Rows ==1); if(_Cols == 1) @@ -117,9 +117,9 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* dat } /** This is the const version of map(Scalar*). */ -template -inline const Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* data) +template +inline const Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(const Scalar* data) { return Map(data, _Rows, _Cols); } @@ -135,9 +135,9 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(const Scalar* dat * * \sa map(const Scalar*, int, int), map(Scalar*, int), map(Scalar*), class Map */ -template -inline Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int rows, int cols) +template +inline Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(Scalar* data, int rows, int cols) { return Map(data, rows, cols); } @@ -154,9 +154,9 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int * * \sa map(const Scalar*, int), map(Scalar*, int, int), map(Scalar*), class Map */ -template -inline Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int size) +template +inline Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(Scalar* data, int size) { ei_assert(_Cols == 1 || _Rows ==1); if(_Cols == 1) @@ -174,9 +174,9 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data, int * * \sa map(const Scalar*), map(Scalar*, int), map(Scalar*, int, int), class Map */ -template -inline Map > -Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data) +template +inline Map > +Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::map(Scalar* data) { return Map(data, _Rows, _Cols); } @@ -189,8 +189,8 @@ Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols>::map(Scalar* data) * * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int, int) */ -template -inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +template +inline Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> ::Matrix(const Scalar *data, int rows, int cols) : m_storage(rows*cols, rows, cols) { @@ -207,8 +207,8 @@ inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> * * \sa Matrix(const Scalar *), Matrix::map(const Scalar *, int) */ -template -inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +template +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) { @@ -225,8 +225,8 @@ inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> * \sa Matrix(const Scalar *, int), Matrix(const Scalar *, int, int), * Matrix::map(const Scalar *) */ -template -inline Matrix<_Scalar, _Rows, _Cols, _Flags, _MaxRows, _MaxCols> +template +inline Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags> ::Matrix(const Scalar *data) { *this = map(data); diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 6c7a42f94..75e2c67b0 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -35,7 +35,15 @@ * specify that the number of rows is dynamic, i.e. is not fixed at compile-time. * \param _Cols the number of columns at compile-time. Use the special value \a Dynamic to * specify that the number of columns is dynamic, i.e. is not fixed at compile-time. - * \param _SuggestedFlags allows to control certain features such as storage order. See MatrixBase::Flags. + * \param _MaxRows the maximum number of rows at compile-time. By default this is equal to \a _Rows. + * The most common exception is when you don't know the exact number of rows, but know that + * it is smaller than some given value. Then you can set \a _MaxRows to that value, and set + * _Rows to \a Dynamic. + * \param _MaxCols the maximum number of cols at compile-time. By default this is equal to \a _Cols. + * The most common exception is when you don't know the exact number of cols, but know that + * it is smaller than some given value. Then you can set \a _MaxCols to that value, and set + * _Cols to \a Dynamic. + * \param _Flags allows to control certain features such as storage order. See the \ref flags "list of flags". * * This single class template covers all kinds of matrix and vectors that Eigen can handle. * All matrix and vector types are just typedefs to specializations of this class template. @@ -70,8 +78,8 @@ * * Note that most of the API is in the base class MatrixBase. */ -template -struct ei_traits > +template +struct ei_traits > { typedef _Scalar Scalar; enum { @@ -79,13 +87,13 @@ struct ei_traits::ret, _SuggestedFlags>::ret, + Flags = _Flags, CoeffReadCost = NumTraits::ReadCost }; }; -template -class Matrix : public MatrixBase > +template +class Matrix : public MatrixBase > { public: diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index 7af1bb3ed..39bda7e6e 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -163,9 +163,14 @@ template class ei_product_eval_to_column_major typedef Matrix<_Scalar, ei_traits::RowsAtCompileTime, ei_traits::ColsAtCompileTime, - ei_corrected_matrix_flags<_Scalar, ei_size_at_compile_time<_MaxRows,_MaxCols>::ret, _Flags>::ret & ~RowMajorBit, ei_traits::MaxRowsAtCompileTime, - ei_traits::MaxColsAtCompileTime> type; + ei_traits::MaxColsAtCompileTime, + ei_corrected_matrix_flags< + _Scalar, + ei_size_at_compile_time<_MaxRows,_MaxCols>::ret, + _Flags + >::ret & ~RowMajorBit + > type; }; // as ei_nested, but evaluate to a column-major matrix if an evaluation is required diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index f9370ada9..9d09a2aa6 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -28,10 +28,18 @@ template struct ei_traits; template struct ei_product_eval_mode; template struct NumTraits; +template class ei_corrected_matrix_flags; + +template struct ei_size_at_compile_time; template + int _MaxRows = _Rows, int _MaxCols = _Cols, + unsigned int _Flags = ei_corrected_matrix_flags< + _Scalar, + ei_size_at_compile_time<_MaxRows,_MaxCols>::ret, + EIGEN_DEFAULT_MATRIX_FLAGS + >::ret +> class Matrix; template class Flagged; diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index 5611ad3b0..5df6d89d0 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -180,9 +180,14 @@ template class ei_eval typedef Matrix<_Scalar, ei_traits::RowsAtCompileTime, ei_traits::ColsAtCompileTime, - ei_corrected_matrix_flags<_Scalar, ei_size_at_compile_time<_MaxRows,_MaxCols>::ret, _Flags>::ret, ei_traits::MaxRowsAtCompileTime, - ei_traits::MaxColsAtCompileTime> type; + ei_traits::MaxColsAtCompileTime, + ei_corrected_matrix_flags< + _Scalar, + ei_size_at_compile_time<_MaxRows,_MaxCols>::ret, + _Flags + >::ret + > type; }; template struct ei_unref { typedef T type; };