mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Move all, last, end from Eigen::placeholders namespace to Eigen::, and rename end to lastp1 to avoid conflicts with std::end.
This commit is contained in:
@@ -54,7 +54,6 @@ is_same_type(const T1&, const T2&)
|
||||
template<typename T1,typename T2>
|
||||
bool is_same_symb(const T1& a, const T2& b, Index size)
|
||||
{
|
||||
using Eigen::placeholders::last;
|
||||
return a.eval(last=size-1) == b.eval(last=size-1);
|
||||
}
|
||||
|
||||
@@ -72,14 +71,11 @@ void check_isnot_symbolic(const T&) {
|
||||
|
||||
void check_symbolic_index()
|
||||
{
|
||||
using Eigen::placeholders::last;
|
||||
using Eigen::placeholders::end;
|
||||
|
||||
check_is_symbolic(last);
|
||||
check_is_symbolic(end);
|
||||
check_is_symbolic(lastp1);
|
||||
check_is_symbolic(last+1);
|
||||
check_is_symbolic(last-end);
|
||||
check_is_symbolic(2*last-end/2);
|
||||
check_is_symbolic(last-lastp1);
|
||||
check_is_symbolic(2*last-lastp1/2);
|
||||
check_isnot_symbolic(fix<3>());
|
||||
|
||||
Index size=100;
|
||||
@@ -93,14 +89,14 @@ void check_symbolic_index()
|
||||
VERIFY( is_same_type( fix<9>()|fix<2>(), fix<9|2>() ) );
|
||||
VERIFY( is_same_type( fix<9>()/2, int(9/2) ) );
|
||||
|
||||
VERIFY( is_same_symb( end-1, last, size) );
|
||||
VERIFY( is_same_symb( end-fix<1>, last, size) );
|
||||
VERIFY( is_same_symb( lastp1-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*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 );
|
||||
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user