mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Add a unit test for large chains of products
This commit is contained in:
@@ -56,5 +56,16 @@ void test_product_small()
|
||||
VERIFY_IS_APPROX(B * A.inverse(), B * A.inverse()[0]);
|
||||
VERIFY_IS_APPROX(A.inverse() * C, A.inverse()[0] * C);
|
||||
}
|
||||
|
||||
{
|
||||
Eigen::Matrix<double, 100, 100> A, B, C;
|
||||
A.setRandom();
|
||||
C = A;
|
||||
for(int k=0; k<79; ++k)
|
||||
C = C * A;
|
||||
B.noalias() = (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)))
|
||||
* (((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)) * ((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A))*((A*A)*(A*A)));
|
||||
VERIFY_IS_APPROX(B,C);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user