remove EIGEN_HAS_CXX11

This commit is contained in:
Erik Schultheis 2021-11-24 20:08:49 +00:00 committed by Rasmus Munk Larsen
parent cfdb3ce3f0
commit ec4efbd696
30 changed files with 14 additions and 629 deletions

View File

@ -94,9 +94,7 @@
// for min/max:
#include <algorithm>
#if EIGEN_HAS_CXX11
#include <array>
#endif
// for std::is_nothrow_move_assignable
#ifdef EIGEN_INCLUDE_TYPE_TRAITS

View File

@ -16,7 +16,7 @@ namespace Eigen {
namespace internal {
#if (!EIGEN_HAS_CXX11) || !((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
#if !((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
template<typename T> struct aseq_negate {};
template<> struct aseq_negate<Index> {
@ -140,7 +140,7 @@ protected:
public:
#if EIGEN_HAS_CXX11 && ((!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48)
#if (!EIGEN_COMP_GNUC) || EIGEN_COMP_GNUC>=48
auto reverse() const -> decltype(Eigen::seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr)) {
return seqN(m_first+(m_size+fix<-1>())*m_incr,m_size,-m_incr);
}
@ -202,7 +202,6 @@ auto seq(FirstType f, LastType l);
#else // EIGEN_PARSED_BY_DOXYGEN
#if EIGEN_HAS_CXX11
template<typename FirstType,typename LastType>
auto seq(FirstType f, LastType l) -> decltype(seqN(typename internal::cleanup_index_type<FirstType>::type(f),
( typename internal::cleanup_index_type<LastType>::type(l)
@ -228,102 +227,11 @@ auto seq(FirstType f, LastType l, IncrType incr)
CleanedIncrType(incr));
}
#else // EIGEN_HAS_CXX11
template<typename FirstType,typename LastType>
typename internal::enable_if<!(symbolic::is_symbolic<FirstType>::value || symbolic::is_symbolic<LastType>::value),
ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,Index> >::type
seq(FirstType f, LastType l)
{
return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
Index((typename internal::cleanup_index_type<LastType>::type(l)-typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>())));
}
template<typename FirstTypeDerived,typename LastType>
typename internal::enable_if<!symbolic::is_symbolic<LastType>::value,
ArithmeticSequence<FirstTypeDerived, symbolic::AddExpr<symbolic::AddExpr<symbolic::NegateExpr<FirstTypeDerived>,symbolic::ValueExpr<> >,
symbolic::ValueExpr<internal::FixedInt<1> > > > >::type
seq(const symbolic::BaseExpr<FirstTypeDerived> &f, LastType l)
{
return seqN(f.derived(),(typename internal::cleanup_index_type<LastType>::type(l)-f.derived()+fix<1>()));
}
template<typename FirstType,typename LastTypeDerived>
typename internal::enable_if<!symbolic::is_symbolic<FirstType>::value,
ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::ValueExpr<> >,
symbolic::ValueExpr<internal::FixedInt<1> > > > >::type
seq(FirstType f, const symbolic::BaseExpr<LastTypeDerived> &l)
{
return seqN(typename internal::cleanup_index_type<FirstType>::type(f),(l.derived()-typename internal::cleanup_index_type<FirstType>::type(f)+fix<1>()));
}
template<typename FirstTypeDerived,typename LastTypeDerived>
ArithmeticSequence<FirstTypeDerived,
symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::NegateExpr<FirstTypeDerived> >,symbolic::ValueExpr<internal::FixedInt<1> > > >
seq(const symbolic::BaseExpr<FirstTypeDerived> &f, const symbolic::BaseExpr<LastTypeDerived> &l)
{
return seqN(f.derived(),(l.derived()-f.derived()+fix<1>()));
}
template<typename FirstType,typename LastType, typename IncrType>
typename internal::enable_if<!(symbolic::is_symbolic<FirstType>::value || symbolic::is_symbolic<LastType>::value),
ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,Index,typename internal::cleanup_seq_incr<IncrType>::type> >::type
seq(FirstType f, LastType l, IncrType incr)
{
typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
Index((typename internal::cleanup_index_type<LastType>::type(l)-typename internal::cleanup_index_type<FirstType>::type(f)+CleanedIncrType(incr))/CleanedIncrType(incr)), incr);
}
template<typename FirstTypeDerived,typename LastType, typename IncrType>
typename internal::enable_if<!symbolic::is_symbolic<LastType>::value,
ArithmeticSequence<FirstTypeDerived,
symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<symbolic::NegateExpr<FirstTypeDerived>,
symbolic::ValueExpr<> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
typename internal::cleanup_seq_incr<IncrType>::type> >::type
seq(const symbolic::BaseExpr<FirstTypeDerived> &f, LastType l, IncrType incr)
{
typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
return seqN(f.derived(),(typename internal::cleanup_index_type<LastType>::type(l)-f.derived()+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
}
template<typename FirstType,typename LastTypeDerived, typename IncrType>
typename internal::enable_if<!symbolic::is_symbolic<FirstType>::value,
ArithmeticSequence<typename internal::cleanup_index_type<FirstType>::type,
symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,symbolic::ValueExpr<> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
typename internal::cleanup_seq_incr<IncrType>::type> >::type
seq(FirstType f, const symbolic::BaseExpr<LastTypeDerived> &l, IncrType incr)
{
typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
return seqN(typename internal::cleanup_index_type<FirstType>::type(f),
(l.derived()-typename internal::cleanup_index_type<FirstType>::type(f)+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
}
template<typename FirstTypeDerived,typename LastTypeDerived, typename IncrType>
ArithmeticSequence<FirstTypeDerived,
symbolic::QuotientExpr<symbolic::AddExpr<symbolic::AddExpr<LastTypeDerived,
symbolic::NegateExpr<FirstTypeDerived> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
symbolic::ValueExpr<typename internal::cleanup_seq_incr<IncrType>::type> >,
typename internal::cleanup_seq_incr<IncrType>::type>
seq(const symbolic::BaseExpr<FirstTypeDerived> &f, const symbolic::BaseExpr<LastTypeDerived> &l, IncrType incr)
{
typedef typename internal::cleanup_seq_incr<IncrType>::type CleanedIncrType;
return seqN(f.derived(),(l.derived()-f.derived()+CleanedIncrType(incr))/CleanedIncrType(incr), incr);
}
#endif // EIGEN_HAS_CXX11
#endif // EIGEN_PARSED_BY_DOXYGEN
namespace placeholders {
#if EIGEN_HAS_CXX11 || defined(EIGEN_PARSED_BY_DOXYGEN)
/** \cpp11
* \returns a symbolic ArithmeticSequence representing the last \a size elements with increment \a incr.
*
@ -349,7 +257,6 @@ auto lastN(SizeType size)
{
return seqN(Eigen::placeholders::last+fix<1>()-size, size);
}
#endif
} // namespace placeholders
@ -407,9 +314,7 @@ namespace indexing {
using Eigen::seqN;
using Eigen::placeholders::all;
using Eigen::placeholders::last;
#if EIGEN_HAS_CXX11
using Eigen::placeholders::lastN;
#endif
using Eigen::placeholders::lastp1;
}

View File

@ -161,7 +161,6 @@ class Array
}
#endif
#if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar& a0, const Scalar& a1, const Scalar& a2, const Scalar& a3, const ArgTypes&... args)
*
* Example: \include Array_variadic_ctor_cxx11.cpp
@ -198,7 +197,6 @@ class Array
*/
EIGEN_DEVICE_FUNC
EIGEN_STRONG_INLINE Array(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
#endif // end EIGEN_HAS_CXX11
#ifndef EIGEN_PARSED_BY_DOXYGEN
template<typename T>
@ -354,8 +352,6 @@ EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex<double>, cd)
#undef EIGEN_MAKE_ARRAY_TYPEDEFS
#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
#if EIGEN_HAS_CXX11
#define EIGEN_MAKE_ARRAY_TYPEDEFS(Size, SizeSuffix) \
/** \ingroup arraytypedefs */ \
/** \brief \cpp11 */ \
@ -387,8 +383,6 @@ EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(4)
#undef EIGEN_MAKE_ARRAY_TYPEDEFS
#undef EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS
#endif // EIGEN_HAS_CXX11
#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \
using Eigen::Matrix##SizeSuffix##TypeSuffix; \
using Eigen::Vector##SizeSuffix##TypeSuffix; \

View File

@ -105,7 +105,7 @@ class CwiseBinaryOp :
typedef typename internal::remove_reference<LhsNested>::type _LhsNested;
typedef typename internal::remove_reference<RhsNested>::type _RhsNested;
#if EIGEN_COMP_MSVC && EIGEN_HAS_CXX11
#if EIGEN_COMP_MSVC
//Required for Visual Studio or the Copy constructor will probably not get inlined!
EIGEN_STRONG_INLINE
CwiseBinaryOp(const CwiseBinaryOp<BinaryOp,LhsType,RhsType>&) = default;

View File

@ -216,7 +216,7 @@ template<typename T, int Size, int Rows_, int Cols_, int Options_> class DenseSt
EIGEN_DEVICE_FUNC
explicit DenseStorage(internal::constructor_without_unaligned_array_assert)
: m_data(internal::constructor_without_unaligned_array_assert()) {}
#if !EIGEN_HAS_CXX11 || defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
#if defined(EIGEN_DENSE_STORAGE_CTOR_PLUGIN)
EIGEN_DEVICE_FUNC
DenseStorage(const DenseStorage& other) : m_data(other.m_data) {
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN(Index size = Size)
@ -224,32 +224,10 @@ template<typename T, int Size, int Rows_, int Cols_, int Options_> class DenseSt
#else
EIGEN_DEVICE_FUNC DenseStorage(const DenseStorage&) = default;
#endif
#if !EIGEN_HAS_CXX11
EIGEN_DEVICE_FUNC
DenseStorage& operator=(const DenseStorage& other)
{
if (this != &other) m_data = other.m_data;
return *this;
}
#else
EIGEN_DEVICE_FUNC DenseStorage& operator=(const DenseStorage&) = default;
#endif
#if EIGEN_HAS_RVALUE_REFERENCES
#if !EIGEN_HAS_CXX11
EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&& other) EIGEN_NOEXCEPT
: m_data(std::move(other.m_data))
{
}
EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&& other) EIGEN_NOEXCEPT
{
if (this != &other)
m_data = std::move(other.m_data);
return *this;
}
#else
EIGEN_DEVICE_FUNC DenseStorage(DenseStorage&&) = default;
EIGEN_DEVICE_FUNC DenseStorage& operator=(DenseStorage&&) = default;
#endif
#endif
EIGEN_DEVICE_FUNC DenseStorage(Index size, Index rows, Index cols) {
EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN({})

View File

@ -180,7 +180,6 @@ class DiagonalMatrix
EIGEN_DEVICE_FUNC
inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x,y,z) {}
#if EIGEN_HAS_CXX11
/** \brief Construct a diagonal matrix with fixed size from an arbitrary number of coefficients. \cpp11
*
* There exists C++98 anologue constructors for fixed-size diagonal matrices having 2 or 3 coefficients.
@ -202,7 +201,6 @@ class DiagonalMatrix
EIGEN_DEVICE_FUNC
explicit EIGEN_STRONG_INLINE DiagonalMatrix(const std::initializer_list<std::initializer_list<Scalar>>& list)
: m_diagonal(list) {}
#endif // EIGEN_HAS_CXX11
/** Copy constructor. */
template<typename OtherDerived>

View File

@ -281,7 +281,6 @@ class Matrix
}
#endif
#if EIGEN_HAS_CXX11
/** \copydoc PlainObjectBase(const Scalar&, const Scalar&, const Scalar&, const Scalar&, const ArgTypes&... args)
*
* Example: \include Matrix_variadic_ctor_cxx11.cpp
@ -317,7 +316,6 @@ class Matrix
*/
EIGEN_DEVICE_FUNC
explicit EIGEN_STRONG_INLINE Matrix(const std::initializer_list<std::initializer_list<Scalar>>& list) : Base(list) {}
#endif // end EIGEN_HAS_CXX11
#ifndef EIGEN_PARSED_BY_DOXYGEN
@ -505,8 +503,6 @@ 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 */ \
@ -552,8 +548,6 @@ 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

View File

@ -527,7 +527,6 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
}
#if EIGEN_HAS_CXX11
/** \brief Construct a row of column vector with fixed size from an arbitrary number of coefficients. \cpp11
*
* \only_for_vectors
@ -587,7 +586,6 @@ class PlainObjectBase : public internal::dense_xpr_base<Derived>::type
}
}
}
#endif // end EIGEN_HAS_CXX11
/** \sa PlainObjectBase::operator=(const EigenBase<OtherDerived>&) */
template<typename OtherDerived>

View File

@ -116,7 +116,6 @@
// static alignment is completely disabled with GCC 3, Sun Studio, and QCC/QNX
#if !EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT \
&& !EIGEN_GCC3_OR_OLDER \
&& !EIGEN_COMP_SUNCC \
&& !EIGEN_OS_QNX
#define EIGEN_ARCH_WANTS_STACK_ALIGNMENT 1

View File

@ -88,9 +88,7 @@ public:
FixedInt ( FixedInt<N> (*)() ) {}
#endif
#if EIGEN_HAS_CXX11
FixedInt(std::integral_constant<int,N>) {}
#endif
};
/** \internal
@ -178,9 +176,7 @@ template<int N, int DynamicKey> struct cleanup_index_type<VariableAndFixedInt<N>
// If VariableAndFixedInt matches DynamicKey, then we turn it to a pure runtime-value (aka Index):
template<int DynamicKey> struct cleanup_index_type<VariableAndFixedInt<DynamicKey>, DynamicKey> { typedef Index type; };
#if EIGEN_HAS_CXX11
template<int N, int DynamicKey> struct cleanup_index_type<std::integral_constant<int,N>, DynamicKey> { typedef FixedInt<N> type; };
#endif
} // end namespace internal

View File

@ -10,7 +10,6 @@
#ifndef EIGEN_MACROS_H
#define EIGEN_MACROS_H
#include "../InternalHeaderCheck.h"
//------------------------------------------------------------------------------------------
@ -214,14 +213,6 @@
#define EIGEN_GNUC_AT(x,y) 0
#endif
// FIXME: could probably be removed as we do not support gcc 3.x anymore
#if EIGEN_COMP_GNUC && (__GNUC__ <= 3)
#define EIGEN_GCC3_OR_OLDER 1
#else
#define EIGEN_GCC3_OR_OLDER 0
#endif
//------------------------------------------------------------------------------------------
// Architecture identification, EIGEN_ARCH_*
@ -577,13 +568,6 @@
// Detect Compiler/Architecture/OS specific features
//------------------------------------------------------------------------------------------
#if EIGEN_GNUC_AT_MOST(4,3) && !EIGEN_COMP_CLANG
// see bug 89
#define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 0
#else
#define EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO 1
#endif
// Cross compiler wrapper around LLVM's __has_builtin
#ifdef __has_builtin
# define EIGEN_HAS_BUILTIN(x) __has_builtin(x)
@ -652,11 +636,10 @@
// but in practice we should not rely on them but rather on the availability of
// individual features as defined later.
// This is why there is no EIGEN_HAS_CXX17.
// FIXME: get rid of EIGEN_HAS_CXX14 and maybe even EIGEN_HAS_CXX11.
// FIXME: get rid of EIGEN_HAS_CXX14.
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_COMP_CXXVER>=11
#define EIGEN_HAS_CXX11 1
#else
#define EIGEN_HAS_CXX11 0
#error This compiler appears to be too old to be supported by Eigen
#endif
#if EIGEN_MAX_CPP_VER>=14 && EIGEN_COMP_CXXVER>=14
@ -694,7 +677,7 @@
// Does the compiler support result_of?
// result_of was deprecated in c++17 and removed in c++ 20
#ifndef EIGEN_HAS_STD_RESULT_OF
#if EIGEN_HAS_CXX11 && EIGEN_COMP_CXXVER < 17
#if EIGEN_COMP_CXXVER < 17
#define EIGEN_HAS_STD_RESULT_OF 1
#else
#define EIGEN_HAS_STD_RESULT_OF 0
@ -705,7 +688,7 @@
#ifndef EIGEN_HAS_STD_HASH
// The std::hash struct is defined in C++11 but is not labelled as a __device__
// function and is not constexpr, so cannot be used on device.
#if EIGEN_HAS_CXX11 && !defined(EIGEN_GPU_COMPILE_PHASE)
#if !defined(EIGEN_GPU_COMPILE_PHASE)
#define EIGEN_HAS_STD_HASH 1
#else
#define EIGEN_HAS_STD_HASH 0
@ -721,7 +704,7 @@
#endif
#ifndef EIGEN_HAS_ALIGNAS
#if EIGEN_MAX_CPP_VER>=11 && EIGEN_HAS_CXX11 && \
#if EIGEN_MAX_CPP_VER>=11 && \
( __has_feature(cxx_alignas) \
|| EIGEN_HAS_CXX14 \
|| (EIGEN_COMP_MSVC >= 1800) \
@ -740,7 +723,7 @@
// - full support of type traits was added only to GCC 5.1.0.
// - 20150626 corresponds to the last release of 4.x libstdc++
#ifndef EIGEN_HAS_TYPE_TRAITS
#if EIGEN_MAX_CPP_VER>=11 && (EIGEN_HAS_CXX11 || EIGEN_COMP_MSVC >= 1700) \
#if EIGEN_MAX_CPP_VER>=11 \
&& ((!EIGEN_COMP_GNUC_STRICT) || EIGEN_GNUC_AT_LEAST(5, 1)) \
&& ((!defined(__GLIBCXX__)) || __GLIBCXX__ > 20150626)
#define EIGEN_HAS_TYPE_TRAITS 1
@ -1000,38 +983,12 @@
#define eigen_plain_assert(x)
#endif
#else
#if EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO
namespace Eigen {
namespace internal {
inline bool copy_bool(bool b) { return b; }
}
}
#define eigen_plain_assert(x) assert(x)
#else
// work around bug 89
#include <cstdlib> // for abort
#include <iostream> // for std::cerr
namespace Eigen {
namespace internal {
// trivial function copying a bool. Must be EIGEN_DONT_INLINE, so we implement it after including Eigen headers.
// see bug 89.
namespace {
EIGEN_DONT_INLINE bool copy_bool(bool b) { return b; }
}
inline void assert_fail(const char *condition, const char *function, const char *file, int line)
{
std::cerr << "assertion failed: " << condition << " in function " << function << " at " << file << ":" << line << std::endl;
abort();
}
}
}
#define eigen_plain_assert(x) \
do { \
if(!Eigen::internal::copy_bool(x)) \
Eigen::internal::assert_fail(EIGEN_MAKESTRING(x), __PRETTY_FUNCTION__, __FILE__, __LINE__); \
} while(false)
#endif
#endif
// eigen_assert can be overridden
@ -1226,11 +1183,7 @@ namespace Eigen {
* \brief Macro to explicitly define the default copy constructor.
* This is necessary, because the implicit definition is deprecated if the copy-assignment is overridden.
*/
#if EIGEN_HAS_CXX11
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS) EIGEN_DEVICE_FUNC CLASS(const CLASS&) = default;
#else
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
#endif
@ -1250,15 +1203,9 @@ namespace Eigen {
*
* Hiding the default destructor lead to problems in C++03 mode together with boost::multiprecision
*/
#if EIGEN_HAS_CXX11
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
EIGEN_DEVICE_FUNC Derived() = default; \
EIGEN_DEVICE_FUNC ~Derived() = default;
#else
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived) \
EIGEN_DEVICE_FUNC Derived() {}; \
/* EIGEN_DEVICE_FUNC ~Derived() {}; */
#endif

View File

@ -31,7 +31,6 @@
#define EIGEN_ICC_NEEDS_CSTDINT (EIGEN_COMP_ICC>=1600 && EIGEN_COMP_CXXVER >= 11)
// Define portable (u)int{32,64} types
#if EIGEN_HAS_CXX11 || EIGEN_ICC_NEEDS_CSTDINT
#include <cstdint>
namespace Eigen {
@ -46,24 +45,6 @@ typedef std::uint64_t uint64_t;
typedef std::int64_t int64_t;
}
}
#else
// Without c++11, all compilers able to compile Eigen also
// provide the C99 stdint.h header file.
#include <stdint.h>
namespace Eigen {
namespace numext {
typedef ::uint8_t uint8_t;
typedef ::int8_t int8_t;
typedef ::uint16_t uint16_t;
typedef ::int16_t int16_t;
typedef ::uint32_t uint32_t;
typedef ::int32_t int32_t;
typedef ::uint64_t uint64_t;
typedef ::int64_t int64_t;
}
}
#endif
namespace Eigen {
@ -155,59 +136,11 @@ template<typename T> struct is_same<T,T> { enum { value = 1 }; };
template< class T >
struct is_void : is_same<void, typename remove_const<T>::type> {};
#if EIGEN_HAS_CXX11
template<> struct is_arithmetic<signed long long> { enum { value = true }; };
template<> struct is_arithmetic<unsigned long long> { enum { value = true }; };
using std::is_integral;
#else
template<typename T> struct is_integral { enum { value = false }; };
template<> struct is_integral<bool> { enum { value = true }; };
template<> struct is_integral<char> { enum { value = true }; };
template<> struct is_integral<signed char> { enum { value = true }; };
template<> struct is_integral<unsigned char> { enum { value = true }; };
template<> struct is_integral<signed short> { enum { value = true }; };
template<> struct is_integral<unsigned short> { enum { value = true }; };
template<> struct is_integral<signed int> { enum { value = true }; };
template<> struct is_integral<unsigned int> { enum { value = true }; };
template<> struct is_integral<signed long> { enum { value = true }; };
template<> struct is_integral<unsigned long> { enum { value = true }; };
#if EIGEN_COMP_MSVC
template<> struct is_integral<signed __int64> { enum { value = true }; };
template<> struct is_integral<unsigned __int64> { enum { value = true }; };
#endif
#endif
#if EIGEN_HAS_CXX11
using std::make_unsigned;
#else
// TODO: Possibly improve this implementation of make_unsigned.
// It is currently used only by
// template<typename Scalar> struct random_default_impl<Scalar, false, true>.
template<typename> struct make_unsigned;
template<> struct make_unsigned<char> { typedef unsigned char type; };
template<> struct make_unsigned<signed char> { typedef unsigned char type; };
template<> struct make_unsigned<unsigned char> { typedef unsigned char type; };
template<> struct make_unsigned<signed short> { typedef unsigned short type; };
template<> struct make_unsigned<unsigned short> { typedef unsigned short type; };
template<> struct make_unsigned<signed int> { typedef unsigned int type; };
template<> struct make_unsigned<unsigned int> { typedef unsigned int type; };
template<> struct make_unsigned<signed long> { typedef unsigned long type; };
template<> struct make_unsigned<unsigned long> { typedef unsigned long type; };
#if EIGEN_COMP_MSVC
template<> struct make_unsigned<signed __int64> { typedef unsigned __int64 type; };
template<> struct make_unsigned<unsigned __int64> { typedef unsigned __int64 type; };
#endif
// Some platforms define int64_t as `long long` even for C++03, where
// `long long` is not guaranteed by the standard. In this case we are missing
// the definition for make_unsigned. If we just define it, we run into issues
// where `long long` doesn't exist in some compilers for C++03. We therefore add
// the specialization for these platforms only.
#if EIGEN_OS_MAC || EIGEN_COMP_MINGW
template<> struct make_unsigned<unsigned long long> { typedef unsigned long long type; };
template<> struct make_unsigned<long long> { typedef unsigned long long type; };
#endif
#endif
template <typename T> struct add_const { typedef const T type; };
template <typename T> struct add_const<T&> { typedef T& type; };
@ -221,56 +154,8 @@ template<typename T> struct add_const_on_value_type<T*> { typedef T const
template<typename T> struct add_const_on_value_type<T* const> { typedef T const* const type; };
template<typename T> struct add_const_on_value_type<T const* const> { typedef T const* const type; };
#if EIGEN_HAS_CXX11
using std::is_convertible;
#else
template<typename From, typename To>
struct is_convertible_impl
{
private:
struct any_conversion
{
template <typename T> any_conversion(const volatile T&);
template <typename T> any_conversion(T&);
};
struct yes {int a[1];};
struct no {int a[2];};
template<typename T>
static yes test(T, int);
template<typename T>
static no test(any_conversion, ...);
public:
static typename internal::remove_reference<From>::type* ms_from;
#ifdef __INTEL_COMPILER
#pragma warning push
#pragma warning ( disable : 2259 )
#endif
enum { value = sizeof(test<To>(*ms_from, 0))==sizeof(yes) };
#ifdef __INTEL_COMPILER
#pragma warning pop
#endif
};
template<typename From, typename To>
struct is_convertible
{
enum { value = is_convertible_impl<From,To>::value };
};
template<typename T>
struct is_convertible<T,T&> { enum { value = false }; };
template<typename T>
struct is_convertible<const T,const T&> { enum { value = true }; };
#endif
/** \internal Allows to enable/disable an overload
* according to a compile time condition.
*/
@ -279,147 +164,6 @@ template<bool Condition, typename T=void> struct enable_if;
template<typename T> struct enable_if<true,T>
{ typedef T type; };
#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
#if !defined(__FLT_EPSILON__)
#define __FLT_EPSILON__ FLT_EPSILON
#define __DBL_EPSILON__ DBL_EPSILON
#endif
namespace device {
template<typename T> struct numeric_limits
{
EIGEN_DEVICE_FUNC
static EIGEN_CONSTEXPR T epsilon() { return 0; }
static T (max)() { assert(false && "Highest not supported for this type"); }
static T (min)() { assert(false && "Lowest not supported for this type"); }
static T infinity() { assert(false && "Infinity not supported for this type"); }
static T quiet_NaN() { assert(false && "quiet_NaN not supported for this type"); }
};
template<> struct numeric_limits<float>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static float epsilon() { return __FLT_EPSILON__; }
EIGEN_DEVICE_FUNC
static float (max)() {
#if defined(EIGEN_CUDA_ARCH)
return CUDART_MAX_NORMAL_F;
#else
return HIPRT_MAX_NORMAL_F;
#endif
}
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static float (min)() { return FLT_MIN; }
EIGEN_DEVICE_FUNC
static float infinity() {
#if defined(EIGEN_CUDA_ARCH)
return CUDART_INF_F;
#else
return HIPRT_INF_F;
#endif
}
EIGEN_DEVICE_FUNC
static float quiet_NaN() {
#if defined(EIGEN_CUDA_ARCH)
return CUDART_NAN_F;
#else
return HIPRT_NAN_F;
#endif
}
};
template<> struct numeric_limits<double>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static double epsilon() { return __DBL_EPSILON__; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static double (max)() { return DBL_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static double (min)() { return DBL_MIN; }
EIGEN_DEVICE_FUNC
static double infinity() {
#if defined(EIGEN_CUDA_ARCH)
return CUDART_INF;
#else
return HIPRT_INF;
#endif
}
EIGEN_DEVICE_FUNC
static double quiet_NaN() {
#if defined(EIGEN_CUDA_ARCH)
return CUDART_NAN;
#else
return HIPRT_NAN;
#endif
}
};
template<> struct numeric_limits<int>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static int epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static int (max)() { return INT_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static int (min)() { return INT_MIN; }
};
template<> struct numeric_limits<unsigned int>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned int epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned int (max)() { return UINT_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned int (min)() { return 0; }
};
template<> struct numeric_limits<long>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long (max)() { return LONG_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long (min)() { return LONG_MIN; }
};
template<> struct numeric_limits<unsigned long>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long (max)() { return ULONG_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long (min)() { return 0; }
};
template<> struct numeric_limits<long long>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long long epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long long (max)() { return LLONG_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static long long (min)() { return LLONG_MIN; }
};
template<> struct numeric_limits<unsigned long long>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long long epsilon() { return 0; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long long (max)() { return ULLONG_MAX; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static unsigned long long (min)() { return 0; }
};
template<> struct numeric_limits<bool>
{
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static bool epsilon() { return false; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static bool (max)() { return true; }
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
static bool (min)() { return false; }
};
}
#endif // defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
/** \internal
* A base class do disable default copy ctor and copy assignment operator.
*/
@ -461,14 +205,12 @@ template<typename T, int N> struct array_size<T (&)[N]> {
enum { value = N };
};
#if EIGEN_HAS_CXX11
template<typename T, std::size_t N> struct array_size<const std::array<T,N> > {
enum { value = N };
};
template<typename T, std::size_t N> struct array_size<std::array<T,N> > {
enum { value = N };
};
#endif
/** \internal
* Analogue of the std::size free function.
@ -620,36 +362,12 @@ struct invoke_result {
typedef typename std::invoke_result<F, ArgTypes...>::type type1;
typedef typename remove_all<type1>::type type;
};
#elif EIGEN_HAS_CXX11
#else
template<typename F, typename... ArgTypes>
struct invoke_result {
typedef typename result_of<F(ArgTypes...)>::type type1;
typedef typename remove_all<type1>::type type;
};
#else
template<typename F, typename ArgType0 = void, typename ArgType1 = void, typename ArgType2 = void>
struct invoke_result {
typedef typename result_of<F(ArgType0, ArgType1, ArgType2)>::type type1;
typedef typename remove_all<type1>::type type;
};
template<typename F>
struct invoke_result<F, void, void, void> {
typedef typename result_of<F()>::type type1;
typedef typename remove_all<type1>::type type;
};
template<typename F, typename ArgType0>
struct invoke_result<F, ArgType0, void, void> {
typedef typename result_of<F(ArgType0)>::type type1;
typedef typename remove_all<type1>::type type;
};
template<typename F, typename ArgType0, typename ArgType1>
struct invoke_result<F, ArgType0, ArgType1, void> {
typedef typename result_of<F(ArgType0, ArgType1)>::type type1;
typedef typename remove_all<type1>::type type;
};
#endif
// C++14 integer/index_sequence.
@ -824,11 +542,7 @@ template<typename T> EIGEN_DEVICE_FUNC void swap(T &a, T &b) { T tmp = b; b =
template<typename T> EIGEN_STRONG_INLINE void swap(T &a, T &b) { std::swap(a,b); }
#endif
#if defined(EIGEN_GPU_COMPILE_PHASE) && !EIGEN_HAS_CXX11
using internal::device::numeric_limits;
#else
using std::numeric_limits;
#endif
// Integer division with rounding up.
// T is assumed to be an integer type with a>=0, and b>0

View File

@ -1600,7 +1600,6 @@ PREDEFINED = EIGEN_EMPTY_STRUCT \
EIGEN_QT_SUPPORT \
EIGEN_STRONG_INLINE=inline \
EIGEN_DEVICE_FUNC= \
EIGEN_HAS_CXX11=1 \
EIGEN_HAS_CXX11_MATH=1 \
"EIGEN_MAKE_CWISE_BINARY_OP(METHOD,FUNCTOR)=template<typename OtherDerived> const CwiseBinaryOp<FUNCTOR<Scalar>, const Derived, const OtherDerived> METHOD(const EIGEN_CURRENT_STORAGE_BASE_CLASS<OtherDerived> &other) const;" \
"EIGEN_CWISE_PRODUCT_RETURN_TYPE(LHS,RHS)=CwiseBinaryOp<internal::scalar_product_op<LHS::Scalar,RHS::Scalar>, const LHS, const RHS>"\

View File

@ -37,9 +37,7 @@ class AnnoyingScalar
AnnoyingScalar(float _v) { init(); *v = _v; }
AnnoyingScalar(int _v) { init(); *v = _v; }
AnnoyingScalar(long _v) { init(); *v = _v; }
#if EIGEN_HAS_CXX11
AnnoyingScalar(long long _v) { init(); *v = _v; }
#endif
AnnoyingScalar(const AnnoyingScalar& other) { init(); *v = *(other.v); }
~AnnoyingScalar() {
if(v!=&data)

View File

@ -176,7 +176,6 @@ template<typename ArrayType> void array(const ArrayType& m)
FixedArrayType f4(f1.data());
VERIFY_IS_APPROX(f4, f1);
}
#if EIGEN_HAS_CXX11
{
FixedArrayType f1{s1};
VERIFY_IS_APPROX(f1, FixedArrayType::Constant(s1));
@ -188,7 +187,6 @@ template<typename ArrayType> void array(const ArrayType& m)
FixedArrayType f4{f1.data()};
VERIFY_IS_APPROX(f4, f1);
}
#endif
// pow
VERIFY_IS_APPROX(m1.pow(2), m1.square());
@ -214,14 +212,12 @@ template<typename ArrayType> void array(const ArrayType& m)
OneDArrayType o2(static_cast<int>(rows));
VERIFY(o2.size()==rows);
}
#if EIGEN_HAS_CXX11
{
OneDArrayType o1{rows};
VERIFY(o1.size()==rows);
OneDArrayType o4{int(rows)};
VERIFY(o4.size()==rows);
}
#endif
// Check possible conflicts with 2D ctor
typedef Array<Scalar, Dynamic, Dynamic> TwoDArrayType;
typedef Array<Scalar, 2, 1> ArrayType2;
@ -238,7 +234,6 @@ template<typename ArrayType> void array(const ArrayType& m)
ArrayType2 o4(static_cast<int>(rows),static_cast<int>(cols));
VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
}
#if EIGEN_HAS_CXX11
{
TwoDArrayType o1{rows,cols};
VERIFY(o1.rows()==rows);
@ -252,7 +247,6 @@ template<typename ArrayType> void array(const ArrayType& m)
ArrayType2 o4{int(rows),int(cols)};
VERIFY(o4(0)==Scalar(rows) && o4(1)==Scalar(cols));
}
#endif
}
template<typename ArrayType> void comparisons(const ArrayType& m)

View File

@ -69,10 +69,8 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
x = v1(static_cast<unsigned int>(r1));
x = v1(static_cast<signed long>(r1));
x = v1(static_cast<unsigned long>(r1));
#if EIGEN_HAS_CXX11
x = v1(static_cast<long long int>(r1));
x = v1(static_cast<unsigned long long int>(r1));
#endif
VERIFY_IS_APPROX( v1, v1);
VERIFY_IS_NOT_APPROX( v1, 2*v1);
@ -231,10 +229,8 @@ struct casting_test_runner {
casting_test<SrcScalar, uint16_t>::run();
casting_test<SrcScalar, int32_t>::run();
casting_test<SrcScalar, uint32_t>::run();
#if EIGEN_HAS_CXX11
casting_test<SrcScalar, int64_t>::run();
casting_test<SrcScalar, uint64_t>::run();
#endif
casting_test<SrcScalar, half>::run();
casting_test<SrcScalar, bfloat16>::run();
casting_test<SrcScalar, float>::run();
@ -264,10 +260,8 @@ void casting_all() {
casting_test_runner<uint16_t>::run();
casting_test_runner<int32_t>::run();
casting_test_runner<uint32_t>::run();
#if EIGEN_HAS_CXX11
casting_test_runner<int64_t>::run();
casting_test_runner<uint64_t>::run();
#endif
casting_test_runner<half>::run();
casting_test_runner<bfloat16>::run();
casting_test_runner<float>::run();

View File

@ -196,12 +196,7 @@ EIGEN_DECLARE_TEST(blasutil)
// TODO: Replace this by a call to numext::int64_t as soon as we have a way to
// detect the typedef for int64_t on all platforms
#if EIGEN_HAS_CXX11
CALL_SUBTEST_4(run_test<signed long long>());
#else
CALL_SUBTEST_4(run_test<signed long>());
#endif
CALL_SUBTEST_5(run_test<float_t>());
CALL_SUBTEST_6(run_test<double_t>());
CALL_SUBTEST_7(run_test<std::complex<float> >());

View File

@ -13,7 +13,7 @@
#include <Eigen/Core>
#if EIGEN_HAS_TYPE_TRAITS && EIGEN_HAS_CXX11
#if EIGEN_HAS_TYPE_TRAITS
using DenseStorageD3x3 = Eigen::DenseStorage<double, 3, 3, 3, 3>;
static_assert(std::is_trivially_move_constructible<DenseStorageD3x3>::value, "DenseStorage not trivially_move_constructible");
static_assert(std::is_trivially_move_assignable<DenseStorageD3x3>::value, "DenseStorage not trivially_move_assignable");

View File

@ -12,26 +12,6 @@
#define EIGEN_MAX_CPP_VER 11
#endif
#ifdef EIGEN_TEST_PART_3
// Make sure we also check c++98 max implementation
#define EIGEN_MAX_CPP_VER 03
// We need to disable this warning when compiling with c++11 while limiting Eigen to c++98
// Ideally we would rather configure the compiler to build in c++98 mode but this needs
// to be done at the CMakeLists.txt level.
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
#if defined(__GNUC__) && (__GNUC__ >=9)
#pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#if defined(__clang__) && (__clang_major__ >= 10)
#pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif
#endif
#include <valarray>
#include <vector>
#include "main.h"
@ -39,11 +19,8 @@
using Eigen::placeholders::all;
using Eigen::placeholders::last;
using Eigen::placeholders::lastp1;
#if EIGEN_HAS_CXX11
using Eigen::placeholders::lastN;
#include <array>
#endif
typedef std::pair<Index,Index> IndexPair;
@ -225,7 +202,6 @@ void check_indexed_view()
VERIFY( is_same_seq_type( seqN(2,fix<5>(5),fix<-2>), seqN(2,fix<5>,fix<-2>()) ) );
VERIFY( is_same_seq_type( seq(2,fix<5>), seqN(2,4) ) );
#if EIGEN_HAS_CXX11
VERIFY( is_same_seq_type( seq(fix<2>,fix<5>), seqN(fix<2>,fix<4>) ) );
VERIFY( is_same_seq( seqN(2,std::integral_constant<int,5>(),std::integral_constant<int,-2>()), seqN(2,fix<5>,fix<-2>()) ) );
VERIFY( is_same_seq( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>(),std::integral_constant<int,2>()),
@ -236,10 +212,6 @@ void check_indexed_view()
VERIFY( is_same_seq_type( seqN(2,std::integral_constant<int,5>()), seqN(2,fix<5>) ) );
VERIFY( is_same_seq_type( seq(std::integral_constant<int,1>(),std::integral_constant<int,5>()), seq(fix<1>,fix<5>) ) );
#else
// sorry, no compile-time size recovery in c++98/03
VERIFY( is_same_seq( seq(fix<2>,fix<5>), seqN(fix<2>,fix<4>) ) );
#endif
VERIFY( (A(seqN(2,fix<5>), 5)).RowsAtCompileTime == 5);
VERIFY( (A(4, all)).ColsAtCompileTime == Dynamic);
@ -315,7 +287,6 @@ void check_indexed_view()
A(seq(last-5,last-1,2), seqN(last-3,3,fix<-2>)).reverse() );
}
#if EIGEN_HAS_CXX11
// check lastN
VERIFY_IS_APPROX( a(lastN(3)), a.tail(3) );
VERIFY( MATCH( a(lastN(3)), "7\n8\n9" ) );
@ -341,8 +312,6 @@ void check_indexed_view()
VERIFY_IS_APPROX( b({3, 1, 6, 5}), b(std::array<int,4>{{3, 1, 6, 5}}) );
VERIFY_IS_EQUAL( b({1,3,5}).SizeAtCompileTime, 3 );
#endif
#endif
// check mat(i,j) with weird types for i and j
@ -401,13 +370,11 @@ void check_indexed_view()
a(XX) = 1;
A(XX,YY) = 1;
// Anonymous enums only work with C++11
#if EIGEN_HAS_CXX11
enum { X=0, Y=1 };
a(X) = 1;
A(X,Y) = 1;
A(XX,Y) = 1;
A(X,YY) = 1;
#endif
// Check compilation of varying integer types as index types:
Index i = n/2;
@ -447,13 +414,11 @@ void check_indexed_view()
VERIFY( MATCH( A(all,1)(1), "101"));
}
#if EIGEN_HAS_CXX11
//Bug IndexView with a single static row should be RowMajor:
{
// A(1, seq(0,2,1)).cwiseAbs().colwise().replicate(2).eval();
STATIC_CHECK(( (internal::evaluator<decltype( A(1,seq(0,2,1)) )>::Flags & RowMajorBit) == RowMajorBit ));
}
#endif
}
@ -462,7 +427,6 @@ EIGEN_DECLARE_TEST(indexed_view)
// for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST_1( check_indexed_view() );
CALL_SUBTEST_2( check_indexed_view() );
CALL_SUBTEST_3( check_indexed_view() );
// }
// static checks of some internals:

View File

@ -160,12 +160,10 @@ EIGEN_DECLARE_TEST(integer_types)
CALL_SUBTEST_6( integer_type_tests(Matrix<unsigned short, 4, 4>()) );
#if EIGEN_HAS_CXX11
CALL_SUBTEST_7( integer_type_tests(Matrix<long long, 11, 13>()) );
CALL_SUBTEST_7( signed_integer_type_tests(Matrix<long long, 11, 13>()) );
CALL_SUBTEST_8( integer_type_tests(Matrix<unsigned long long, Dynamic, 5>(1, 5)) );
#endif
}
CALL_SUBTEST_9( integer_types_extra<0>() );
}

View File

@ -433,10 +433,8 @@ EIGEN_TEST_SCALAR_TEST_OVERLOAD(int)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned int)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(long)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned long)
#if EIGEN_HAS_CXX11
EIGEN_TEST_SCALAR_TEST_OVERLOAD(long long)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(unsigned long long)
#endif
EIGEN_TEST_SCALAR_TEST_OVERLOAD(float)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(double)
EIGEN_TEST_SCALAR_TEST_OVERLOAD(half)

View File

@ -15,7 +15,6 @@ void check_dim(const Xpr& ) {
STATIC_CHECK( Xpr::NumDimensions == ExpectedDim );
}
#if EIGEN_HAS_CXX11
template<template <typename,int,int> class Object>
void map_num_dimensions()
{
@ -58,8 +57,6 @@ using TArray = Array<Scalar,Rows,Cols>;
template<typename Scalar, int Rows, int Cols>
using TMatrix = Matrix<Scalar,Rows,Cols>;
#endif
EIGEN_DECLARE_TEST(num_dimensions)
{
int n = 10;
@ -81,10 +78,7 @@ EIGEN_DECLARE_TEST(num_dimensions)
SparseVector<double> s(n);
CALL_SUBTEST( check_dim<1>(s) );
CALL_SUBTEST( check_dim<1>(s.head(2)) );
#if EIGEN_HAS_CXX11
CALL_SUBTEST( map_num_dimensions<TArray>() );
CALL_SUBTEST( map_num_dimensions<TMatrix>() );
#endif
}

View File

@ -10,9 +10,7 @@
#define EIGEN_RUNTIME_NO_MALLOC
#include "main.h"
#if EIGEN_HAS_CXX11
#include "MovableScalar.h"
#endif
#include "SafeScalar.h"
#include <Eigen/Core>
@ -148,10 +146,8 @@ EIGEN_DECLARE_TEST(rvalue_types)
CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, int> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
CALL_SUBTEST_4((rvalue_transpositions<Transpositions<Dynamic, Dynamic, Index> >(internal::random<int>(1,EIGEN_TEST_MAX_SIZE))));
#if EIGEN_HAS_CXX11
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<MovableScalar<float>,1,3>::Random().eval()));
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,1,3>::Random().eval()));
CALL_SUBTEST_5(rvalue_move(Eigen::Matrix<SafeScalar<float>,Eigen::Dynamic,Eigen::Dynamic>::Random(1,3).eval()));
#endif
}
}

View File

@ -14,8 +14,6 @@
#include "main.h"
#if EIGEN_HAS_CXX11
#ifdef min
#undef min
#endif
@ -27,8 +25,6 @@
#include <unordered_map>
#define EIGEN_UNORDERED_MAP_SUPPORT
#endif
#include <Eigen/Cholesky>
#include <Eigen/LU>
#include <Eigen/Sparse>

View File

@ -18,28 +18,7 @@ make_reverse_iterator( Iterator i )
return std::reverse_iterator<Iterator>(i);
}
#if !EIGEN_HAS_CXX11
template<class ForwardIt>
ForwardIt is_sorted_until(ForwardIt firstIt, ForwardIt lastIt)
{
if (firstIt != lastIt) {
ForwardIt next = firstIt;
while (++next != lastIt) {
if (*next < *firstIt)
return next;
firstIt = next;
}
}
return lastIt;
}
template<class ForwardIt>
bool is_sorted(ForwardIt firstIt, ForwardIt lastIt)
{
return ::is_sorted_until(firstIt, lastIt) == lastIt;
}
#else
using std::is_sorted;
#endif
template<typename XprType>
bool is_pointer_based_stl_iterator(const internal::pointer_based_stl_iterator<XprType> &) { return true; }
@ -50,10 +29,8 @@ bool is_generic_randaccess_stl_iterator(const internal::generic_randaccess_stl_i
template<typename Iter>
bool is_default_constructible_and_assignable(const Iter& it)
{
#if EIGEN_HAS_CXX11
VERIFY(std::is_default_constructible<Iter>::value);
VERIFY(std::is_nothrow_default_constructible<Iter>::value);
#endif
Iter it2;
it2 = it;
return (it==it2);
@ -82,12 +59,10 @@ void check_begin_end_for_loop(Xpr xpr)
typename Xpr::const_iterator cit = xpr.begin();
cit = xpr.cbegin();
#if EIGEN_HAS_CXX11
auto tmp1 = xpr.begin();
VERIFY(tmp1==xpr.begin());
auto tmp2 = xpr.cbegin();
VERIFY(tmp2==xpr.cbegin());
#endif
}
VERIFY( xpr.end() -xpr.begin() == xpr.size() );
@ -123,9 +98,7 @@ template<typename Scalar, int Rows, int Cols>
void test_stl_iterators(int rows=Rows, int cols=Cols)
{
typedef Matrix<Scalar,Rows,1> VectorType;
#if EIGEN_HAS_CXX11
typedef Matrix<Scalar,1,Cols> RowVectorType;
#endif
typedef Matrix<Scalar,Rows,Cols,ColMajor> ColMatrixType;
typedef Matrix<Scalar,Rows,Cols,RowMajor> RowMatrixType;
VectorType v = VectorType::Random(rows);
@ -191,7 +164,6 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
check_begin_end_for_loop(v+v);
}
#if EIGEN_HAS_CXX11
// check swappable
{
using std::swap;
@ -326,8 +298,6 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
}
}
#endif
if(rows>=3) {
VERIFY_IS_EQUAL((v.begin()+rows/2)[1], v(rows/2+1));
@ -344,11 +314,7 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
if(rows>=2)
{
v(1) = v(0)-Scalar(1);
#if EIGEN_HAS_CXX11
VERIFY(!is_sorted(std::begin(v),std::end(v)));
#else
VERIFY(!is_sorted(v.cbegin(),v.cend()));
#endif
}
// on a vector
@ -428,7 +394,6 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
VERIFY_IS_APPROX(v1(rows/4), v(rows/4));
}
#if EIGEN_HAS_CXX11
// check rows/cols iterators with range-for loops
{
j = 0;
@ -492,12 +457,9 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cend (std::declval<const VecOp&>()))>::value ));
#endif
}
#endif
}
#if EIGEN_HAS_CXX11
// When the compiler sees expression IsContainerTest<C>(0), if C is an
// STL-style container class, the first overload of IsContainerTest
// will be viable (since both C::iterator* and C::const_iterator* are
@ -545,7 +507,6 @@ void test_stl_container_detection(int rows=Rows, int cols=Cols)
VERIFY_IS_EQUAL(IsContainerType<ColMatrixType>(0), rows == 1 || cols == 1);
VERIFY_IS_EQUAL(IsContainerType<RowMatrixType>(0), rows == 1 || cols == 1);
}
#endif
EIGEN_DECLARE_TEST(stl_iterators)
{
@ -555,9 +516,7 @@ EIGEN_DECLARE_TEST(stl_iterators)
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(5,10), internal::random<int>(5,10)) ));
CALL_SUBTEST_1(( test_stl_iterators<int,Dynamic,Dynamic>(internal::random<int>(10,200), internal::random<int>(10,200)) ));
}
#if EIGEN_HAS_CXX11
CALL_SUBTEST_1(( test_stl_container_detection<float,1,1>() ));
CALL_SUBTEST_1(( test_stl_container_detection<float,5,5>() ));
#endif
}

View File

@ -7,16 +7,6 @@
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifdef EIGEN_TEST_PART_2
#define EIGEN_MAX_CPP_VER 03
// see indexed_view.cpp
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif
#endif
#include "main.h"
using Eigen::placeholders::last;
@ -84,5 +74,4 @@ void check_symbolic_index()
EIGEN_DECLARE_TEST(symbolic_index)
{
CALL_SUBTEST_1( check_symbolic_index() );
CALL_SUBTEST_2( check_symbolic_index() );
}

View File

@ -18,8 +18,6 @@ EIGEN_DECLARE_TEST(type_alias)
STATIC_CHECK((is_same<Matrix2f,Matrix<float,2,2> >::value));
STATIC_CHECK((is_same<Array33i,Array<int,3,3> >::value));
#if EIGEN_HAS_CXX11
STATIC_CHECK((is_same<MatrixX<double>, MatrixXd>::value));
STATIC_CHECK((is_same<MatrixX<int>, MatrixXi>::value));
STATIC_CHECK((is_same<Matrix2<int>, Matrix2i>::value));
@ -42,7 +40,4 @@ EIGEN_DECLARE_TEST(type_alias)
STATIC_CHECK((is_same<RowVector<float,3>, RowVector3f>::value));
STATIC_CHECK((is_same<RowVector<int,Dynamic>, RowVectorXi>::value));
#else
std::cerr << "WARNING: c++11 type aliases not tested.\n";
#endif
}

View File

@ -13,8 +13,6 @@
#include "../../../Eigen/Core"
#if EIGEN_HAS_CXX11
#include "../SpecialFunctions"
#include "../../../Eigen/src/Core/util/DisableStupidWarnings.h"
@ -137,5 +135,4 @@
#include "../../../Eigen/src/Core/util/ReenableStupidWarnings.h"
#endif // EIGEN_HAS_CXX11
//#endif // EIGEN_CXX11_TENSOR_MODULE_H

View File

@ -84,9 +84,7 @@ void check_limits_specialization()
// workaround "unused typedef" warning:
VERIFY(!bool(internal::is_same<B, A>::value));
#if EIGEN_HAS_CXX11
VERIFY(bool(std::is_base_of<B, A>::value));
#endif
}
EIGEN_DECLARE_TEST(autodiff_scalar)

View File

@ -17,7 +17,7 @@
#include <unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h>
#define EIGEN_GPU_TEST_C99_MATH EIGEN_HAS_CXX11
#define EIGEN_GPU_TEST_C99_MATH 1
using Eigen::Tensor;