mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Require recent GCC and MSCV and removed EIGEN_HAS_CXX14 and some other feature test macros
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
085c2fc5d5
commit
ec2fd0f7ed
@@ -90,8 +90,6 @@ void dense_storage_swap(int rows0, int cols0, int rows1, int cols1)
|
||||
template<typename T, int Size, std::size_t Alignment>
|
||||
void dense_storage_alignment()
|
||||
{
|
||||
#if EIGEN_HAS_ALIGNAS
|
||||
|
||||
struct alignas(Alignment) Empty1 {};
|
||||
VERIFY_IS_EQUAL(std::alignment_of<Empty1>::value, Alignment);
|
||||
|
||||
@@ -109,8 +107,6 @@ void dense_storage_alignment()
|
||||
VERIFY_IS_EQUAL( (std::alignment_of<Matrix<T,Size,1,AutoAlign> >::value), default_alignment);
|
||||
struct Nested2 { Matrix<T,Size,1,AutoAlign> mat; };
|
||||
VERIFY_IS_EQUAL(std::alignment_of<Nested2>::value, default_alignment);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -7,11 +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
|
||||
// Make sure we also check c++11 max implementation
|
||||
#define EIGEN_MAX_CPP_VER 11
|
||||
#endif
|
||||
|
||||
#include <valarray>
|
||||
#include <vector>
|
||||
#include "main.h"
|
||||
@@ -84,11 +79,7 @@ void check_indexed_view()
|
||||
ArrayXd a = ArrayXd::LinSpaced(n,0,n-1);
|
||||
Array<double,1,Dynamic> b = a.transpose();
|
||||
|
||||
#if EIGEN_COMP_CXXVER>=14
|
||||
ArrayXXi A = ArrayXXi::NullaryExpr(n,n, std::ref(encode));
|
||||
#else
|
||||
ArrayXXi A = ArrayXXi::NullaryExpr(n,n, std::ptr_fun(&encode));
|
||||
#endif
|
||||
|
||||
for(Index i=0; i<n; ++i)
|
||||
for(Index j=0; j<n; ++j)
|
||||
@@ -299,7 +290,6 @@ void check_indexed_view()
|
||||
|
||||
VERIFY_IS_APPROX( (A(std::array<int,3>{{1,3,5}}, std::array<int,4>{{9,6,3,0}})), A(seqN(1,3,2), seqN(9,4,-3)) );
|
||||
|
||||
#if EIGEN_HAS_STATIC_ARRAY_TEMPLATE
|
||||
VERIFY_IS_APPROX( A({3, 1, 6, 5}, all), A(std::array<int,4>{{3, 1, 6, 5}}, all) );
|
||||
VERIFY_IS_APPROX( A(all,{3, 1, 6, 5}), A(all,std::array<int,4>{{3, 1, 6, 5}}) );
|
||||
VERIFY_IS_APPROX( A({1,3,5},{3, 1, 6, 5}), A(std::array<int,3>{{1,3,5}},std::array<int,4>{{3, 1, 6, 5}}) );
|
||||
@@ -312,7 +302,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
|
||||
|
||||
// check mat(i,j) with weird types for i and j
|
||||
{
|
||||
@@ -438,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() );
|
||||
// }
|
||||
|
||||
// static checks of some internals:
|
||||
|
||||
@@ -114,13 +114,7 @@ EIGEN_DECLARE_TEST(meta)
|
||||
// So the following tests are expected to fail with recent compilers.
|
||||
|
||||
STATIC_CHECK(( !internal::is_convertible<MyInterface, MyImpl>::value ));
|
||||
#if (!EIGEN_COMP_GNUC_STRICT) || (EIGEN_GNUC_AT_LEAST(4,8))
|
||||
// GCC prior to 4.8 fails to compile this test:
|
||||
// error: cannot allocate an object of abstract type 'MyInterface'
|
||||
// In other word, it does not obey SFINAE.
|
||||
// Nevertheless, we don't really care about supporting abstract type as scalar type!
|
||||
STATIC_CHECK(( !internal::is_convertible<MyImpl, MyInterface>::value ));
|
||||
#endif
|
||||
STATIC_CHECK(( internal::is_convertible<MyImpl, const MyInterface&>::value ));
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
// Deal with i387 extended precision
|
||||
#if EIGEN_ARCH_i386 && !(EIGEN_ARCH_x86_64)
|
||||
|
||||
#if EIGEN_COMP_GNUC_STRICT && EIGEN_GNUC_AT_LEAST(4,4)
|
||||
#if EIGEN_COMP_GNUC_STRICT
|
||||
#pragma GCC optimize ("-ffloat-store")
|
||||
#else
|
||||
#undef VERIFY_IS_EQUAL
|
||||
|
||||
@@ -452,10 +452,8 @@ void test_stl_iterators(int rows=Rows, int cols=Cols)
|
||||
using VecOp = VectorwiseOp<ArrayXXi, 0>;
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cbegin())>::value ));
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::declval<const VecOp&>().cend ())>::value ));
|
||||
#if EIGEN_COMP_CXXVER>=14
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cbegin(std::declval<const VecOp&>()))>::value ));
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cend (std::declval<const VecOp&>()))>::value ));
|
||||
#endif
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cbegin(std::declval<const VecOp&>()))>::value ));
|
||||
STATIC_CHECK(( internal::is_same<VecOp::const_iterator, decltype(std::cend (std::declval<const VecOp&>()))>::value ));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user