ADD: added other eigen lib
This commit is contained in:
@@ -7,18 +7,12 @@
|
||||
// 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;
|
||||
using Eigen::placeholders::lastp1;
|
||||
using Eigen::placeholders::all;
|
||||
|
||||
template<typename T1,typename T2>
|
||||
bool is_same_symb(const T1& a, const T2& b, Index size)
|
||||
{
|
||||
@@ -58,15 +52,14 @@ void check_symbolic_index()
|
||||
VERIFY( is_same_type( fix<9>()/2, int(9/2) ) );
|
||||
|
||||
VERIFY( is_same_symb( lastp1-1, last, size) );
|
||||
VERIFY( is_same_symb( lastp1-fix<1>, last, size) );
|
||||
VERIFY( is_same_symb( lastp1-fix<1>(), last, size) );
|
||||
|
||||
VERIFY_IS_EQUAL( ( (last*5-2)/3 ).eval(last=size-1), ((size-1)*5-2)/3 );
|
||||
VERIFY_IS_EQUAL( ( (last*fix<5>-fix<2>)/fix<3> ).eval(last=size-1), ((size-1)*5-2)/3 );
|
||||
VERIFY_IS_EQUAL( ( (last*fix<5>()-fix<2>())/fix<3>() ).eval(last=size-1), ((size-1)*5-2)/3 );
|
||||
VERIFY_IS_EQUAL( ( -last*lastp1 ).eval(last=size-1), -(size-1)*size );
|
||||
VERIFY_IS_EQUAL( ( lastp1-3*last ).eval(last=size-1), size- 3*(size-1) );
|
||||
VERIFY_IS_EQUAL( ( (lastp1-3*last)/lastp1 ).eval(last=size-1), (size- 3*(size-1))/size );
|
||||
|
||||
#if EIGEN_HAS_CXX14
|
||||
{
|
||||
struct x_tag {}; static const symbolic::SymbolExpr<x_tag> x;
|
||||
struct y_tag {}; static const symbolic::SymbolExpr<y_tag> y;
|
||||
@@ -74,11 +67,9 @@ void check_symbolic_index()
|
||||
|
||||
VERIFY_IS_APPROX( int(((x+3)/y+z).eval(x=6,y=3,z=-13)), (6+3)/3+(-13) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
EIGEN_DECLARE_TEST(symbolic_index)
|
||||
{
|
||||
CALL_SUBTEST_1( check_symbolic_index() );
|
||||
CALL_SUBTEST_2( check_symbolic_index() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user