bug #1736: fix compilation issue with A(all,{1,2}).col(j) by implementing true compile-time "if" for block_evaluator<>::coeff(i)/coeffRef(i)

This commit is contained in:
Gael Guennebaud
2019-09-11 15:40:07 +02:00
parent 031f17117d
commit 747c6a51ca
3 changed files with 41 additions and 10 deletions

View File

@@ -419,6 +419,12 @@ void check_indexed_view()
VERIFY_IS_EQUAL( A3(ind,ind).eval(), MatrixXi::Constant(5,5,A3(1,1)) );
}
// Regression for bug 1736
{
VERIFY_IS_APPROX(A(all, eii).col(0).eval(), A.col(eii(0)));
A(all, eii).col(0) = A.col(eii(0));
}
}
EIGEN_DECLARE_TEST(indexed_view)