diff options
author | Gael Guennebaud <g.gael@free.fr> | 2019-02-20 15:18:48 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2019-02-20 15:18:48 +0100 |
commit | 302377110a26d88a9e0bad8322324227eda2e1c4 (patch) | |
tree | 4edc16f8c19cb202724fbf65876ad5ca6081bc41 | |
parent | 475295b5ff0c030fbed3127e2deaee77747d9833 (diff) |
Update documentation of Matrix and Array type aliases.
-rw-r--r-- | Eigen/src/Core/Array.h | 43 | ||||
-rw-r--r-- | Eigen/src/Core/Matrix.h | 14 |
2 files changed, 40 insertions, 17 deletions
diff --git a/Eigen/src/Core/Array.h b/Eigen/src/Core/Array.h index a85d5084b..ee12d96fc 100644 --- a/Eigen/src/Core/Array.h +++ b/Eigen/src/Core/Array.h @@ -304,7 +304,7 @@ class Array /** \defgroup arraytypedefs Global array typedefs * \ingroup Core_Module * - * Eigen defines several typedef shortcuts for most common 1D and 2D array types. + * %Eigen defines several typedef shortcuts for most common 1D and 2D array types. * * The general patterns are the following: * @@ -317,6 +317,12 @@ class Array * There are also \c ArraySizeType which are self-explanatory. For example, \c Array4cf is * a fixed-size 1D array of 4 complex floats. * + * With \cpp11, template alias are also defined for common sizes. + * They follow the same pattern as above except that the scalar type suffix is replaced by a + * template parameter, i.e.: + * - `ArrayRowsCols<Type>` where `Rows` and `Cols` can be \c 2,\c 3,\c 4, or \c X for fixed or dynamic size. + * - `ArraySize<Type>` where `Size` can be \c 2,\c 3,\c 4 or \c X for fixed or dynamic size 1D arrays. + * * \sa class Array */ @@ -349,35 +355,40 @@ EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd) #undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES #undef EIGEN_MAKE_ARRAY_TYPEDEFS +#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS #if EIGEN_HAS_CXX11 -#define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \ -/** \ingroup matrixtypedefs */ \ +#define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Array##SizeSuffix##SizeSuffix = Array<Type, Size, Size>; \ -/** \ingroup matrixtypedefs */ \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Array##SizeSuffix = Array<Type, Size, 1>; -#define EIGEN_MAKE_FIXED_TYPEDEFS(Size) \ -/** \ingroup matrixtypedefs */ \ +#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Size) \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Array##Size##X = Array<Type, Size, Dynamic>; \ -/** \ingroup matrixtypedefs */ \ +/** \ingroup arraytypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Array##X##Size = Array<Type, Dynamic, Size>; -EIGEN_MAKE_TYPEDEFS(2, 2) -EIGEN_MAKE_TYPEDEFS(3, 3) -EIGEN_MAKE_TYPEDEFS(4, 4) -EIGEN_MAKE_TYPEDEFS(Dynamic, X) -EIGEN_MAKE_FIXED_TYPEDEFS(2) -EIGEN_MAKE_FIXED_TYPEDEFS(3) -EIGEN_MAKE_FIXED_TYPEDEFS(4) +EIGEN_MAKE_ARRAY_TYPEDEFS(2, 2) +EIGEN_MAKE_ARRAY_TYPEDEFS(3, 3) +EIGEN_MAKE_ARRAY_TYPEDEFS(4, 4) +EIGEN_MAKE_ARRAY_TYPEDEFS(Dynamic, X) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(2) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(3) +EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(4) -#undef EIGEN_MAKE_TYPEDEFS -#undef EIGEN_MAKE_FIXED_TYPEDEFS +#undef EIGEN_MAKE_ARRAY_TYPEDEFS +#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS #endif // EIGEN_HAS_CXX11 diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 83cffc8e6..e7df4a901 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -450,7 +450,7 @@ class Matrix * * \ingroup Core_Module * - * Eigen defines several typedef shortcuts for most common matrix and vector types. + * %Eigen defines several typedef shortcuts for most common matrix and vector types. * * The general patterns are the following: * @@ -462,6 +462,13 @@ class Matrix * * There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is * a fixed-size vector of 4 complex floats. + * + * With \cpp11, template alias are also defined for common sizes. + * They follow the same pattern as above except that the scalar type suffix is replaced by a + * template parameter, i.e.: + * - `MatrixSize<Type>` where `Size` can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size. + * - `MatrixXSize<Type>`and `MatrixSizeX<Type>` where `Size` can be \c 2,\c 3,\c 4 for hybrid dynamic/fixed matrices. + * - `VectorSize<Type>` and `RowVectorSize<Type>` for column and row vectors. * * \sa class Matrix */ @@ -503,20 +510,25 @@ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd) #define EIGEN_MAKE_TYPEDEFS(Size, SizeSuffix) \ /** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Matrix##SizeSuffix = Matrix<Type, Size, Size>; \ /** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Vector##SizeSuffix = Matrix<Type, Size, 1>; \ /** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using RowVector##SizeSuffix = Matrix<Type, 1, Size>; #define EIGEN_MAKE_FIXED_TYPEDEFS(Size) \ /** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Matrix##Size##X = Matrix<Type, Size, Dynamic>; \ /** \ingroup matrixtypedefs */ \ +/** \brief \cpp11 */ \ template <typename Type> \ using Matrix##X##Size = Matrix<Type, Dynamic, Size>; |