mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +08:00
Add test for multiple symbols
This commit is contained in:
parent
c43d254d13
commit
bc10201854
@ -235,7 +235,7 @@ public:
|
||||
|
||||
Index eval_impl(const SymbolValue<Tag> &values) const { return values.value(); }
|
||||
|
||||
#if __cplusplus > 201103L
|
||||
#if EIGEN_HAS_CXX14
|
||||
// C++14 versions suitable for multiple symbols
|
||||
template<typename... Types>
|
||||
Index eval_impl(const std::tuple<Types...>& values) const { return std::get<SymbolValue<Tag> >(values).value(); }
|
||||
|
@ -85,6 +85,16 @@ void check_symbolic_index()
|
||||
VERIFY_IS_EQUAL( ( -last*end ).eval(last=size-1), -(size-1)*size );
|
||||
VERIFY_IS_EQUAL( ( end-3*last ).eval(last=size-1), size- 3*(size-1) );
|
||||
VERIFY_IS_EQUAL( ( (end-3*last)/end ).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;
|
||||
struct z_tag {}; static const Symbolic::SymbolExpr<z_tag> z;
|
||||
|
||||
VERIFY_IS_APPROX( int(((x+3)/y+z).eval(x=6,y=3,z=-13)), (6+3)/3+(-13) );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void test_symbolic_index()
|
||||
|
Loading…
x
Reference in New Issue
Block a user