diff options
author | Lev Proleev <levp@google.com> | 2020-02-16 11:17:28 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-02-16 11:17:28 +0000 |
commit | dc803e1bf606441494878f63109a7be0a934b08e (patch) | |
tree | 7c10c361fd10f85311c4d84e62855d90050e67f3 | |
parent | e6f2900ed700950ba2092ac4709c33f9b994de15 (diff) | |
parent | 34853b07c310d25108ee87cac7d86556e2058503 (diff) | |
download | eigen-dc803e1bf606441494878f63109a7be0a934b08e.tar.gz |
Merge "Add type aliases required by TF rebase"
-rw-r--r-- | Eigen/src/Core/Matrix.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index 90c336d8c..42a107f99 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -456,6 +456,55 @@ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex<double>, cd) #undef EIGEN_MAKE_TYPEDEFS #undef EIGEN_MAKE_FIXED_TYPEDEFS +#if EIGEN_HAS_CXX11 + +#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>; + +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) + +/** \ingroup matrixtypedefs + * \brief \cpp11 */ +template <typename Type, int Size> +using Vector = Matrix<Type, Size, 1>; + +/** \ingroup matrixtypedefs + * \brief \cpp11 */ +template <typename Type, int Size> +using RowVector = Matrix<Type, 1, Size>; + +#undef EIGEN_MAKE_TYPEDEFS +#undef EIGEN_MAKE_FIXED_TYPEDEFS + +#endif // EIGEN_HAS_CXX11 + } // end namespace Eigen #endif // EIGEN_MATRIX_H |