mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-24 19:40:45 +08:00
Add a unit test for large chains of products
This commit is contained in:
parent
902c2db5a5
commit
1f11dd6ced
@ -61,6 +61,17 @@ void test_product_large()
|
|||||||
MatrixXf r2 = mat1.row(2)*mat2;
|
MatrixXf r2 = mat1.row(2)*mat2;
|
||||||
VERIFY_IS_APPROX(r2, (mat1.row(2)*mat2).eval());
|
VERIFY_IS_APPROX(r2, (mat1.row(2)*mat2).eval());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
Eigen::MatrixXd A(10,10), 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
|
#endif
|
||||||
|
|
||||||
// Regression test for bug 714:
|
// Regression test for bug 714:
|
||||||
|
@ -56,5 +56,16 @@ void test_product_small()
|
|||||||
VERIFY_IS_APPROX(B * A.inverse(), B * A.inverse()[0]);
|
VERIFY_IS_APPROX(B * A.inverse(), B * A.inverse()[0]);
|
||||||
VERIFY_IS_APPROX(A.inverse() * C, A.inverse()[0] * C);
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user