From c2671e53158ed36776bd4003473d525c98a58afa Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Fri, 12 Jul 2019 19:43:32 +0200 Subject: [PATCH] Build deprecated snippets with -DEIGEN_NO_DEPRECATED_WARNING Also, document LinSpaced only where it is implemented --- Eigen/src/Core/CwiseNullaryOp.h | 9 +++++++-- Eigen/src/Core/DenseBase.h | 7 ------- doc/snippets/CMakeLists.txt | 3 +++ ...ed_seq.cpp => DenseBase_LinSpaced_seq_deprecated.cpp} | 0 4 files changed, 10 insertions(+), 9 deletions(-) rename doc/snippets/{DenseBase_LinSpaced_seq.cpp => DenseBase_LinSpaced_seq_deprecated.cpp} (100%) diff --git a/Eigen/src/Core/CwiseNullaryOp.h b/Eigen/src/Core/CwiseNullaryOp.h index 8612c27b9..ddac9df78 100644 --- a/Eigen/src/Core/CwiseNullaryOp.h +++ b/Eigen/src/Core/CwiseNullaryOp.h @@ -232,7 +232,12 @@ DenseBase::Constant(const Scalar& value) /** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&) * - * \sa LinSpaced(Index,Scalar,Scalar), setLinSpaced(Index,const Scalar&,const Scalar&) + * \only_for_vectors + * + * Example: \include DenseBase_LinSpaced_seq_deprecated.cpp + * Output: \verbinclude DenseBase_LinSpaced_seq_deprecated.out + * + * \sa LinSpaced(Index,const Scalar&, const Scalar&), setLinSpaced(Index,const Scalar&,const Scalar&) */ template EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType @@ -244,7 +249,7 @@ DenseBase::LinSpaced(Sequential_t, Index size, const Scalar& low, const /** \deprecated because of accuracy loss. In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&) * - * \sa LinSpaced(Scalar,Scalar) + * \sa LinSpaced(const Scalar&, const Scalar&) */ template EIGEN_DEPRECATED EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index bc0186cd8..bd4dd691e 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -337,15 +337,8 @@ template class DenseBase EIGEN_DEVICE_FUNC static const ConstantReturnType Constant(const Scalar& value); - /** \deprecated because of accuracy loss. - * In Eigen 3.3, it is an alias for LinSpaced(Index,const Scalar&,const Scalar&) - */ EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high); - - /** \deprecated because of accuracy loss. - * In Eigen 3.3, it is an alias for LinSpaced(const Scalar&,const Scalar&) - */ EIGEN_DEPRECATED EIGEN_DEVICE_FUNC static const RandomAccessLinSpacedReturnType LinSpaced(Sequential_t, const Scalar& low, const Scalar& high); diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt index cf3f6de4f..88ed3419f 100644 --- a/doc/snippets/CMakeLists.txt +++ b/doc/snippets/CMakeLists.txt @@ -18,6 +18,9 @@ foreach(snippet_src ${snippets_SRCS}) if(${snippet_src} MATCHES "cxx11") set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-std=c++11") endif() + if(${snippet_src} MATCHES "deprecated") + set_target_properties(${compile_snippet_target} PROPERTIES COMPILE_FLAGS "-DEIGEN_NO_DEPRECATED_WARNING") + endif() add_custom_command( TARGET ${compile_snippet_target} POST_BUILD diff --git a/doc/snippets/DenseBase_LinSpaced_seq.cpp b/doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp similarity index 100% rename from doc/snippets/DenseBase_LinSpaced_seq.cpp rename to doc/snippets/DenseBase_LinSpaced_seq_deprecated.cpp