conjugate expressions are now properly caught by Product

=> significant speedup in expr. like a.adjoint() * b,
   for complex scalar type (~ x3)
This commit is contained in:
Gael Guennebaud
2009-07-07 21:30:20 +02:00
parent 5ed6ce90d3
commit 13b2dafb50
4 changed files with 116 additions and 90 deletions

View File

@@ -28,19 +28,18 @@ void test_product_large()
{
for(int i = 0; i < g_repeat; i++) {
CALL_SUBTEST( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) );
//CALL_SUBTEST( product(MatrixXf(ei_random<int>(1,320), ei_random<int>(1,320))) );
// CALL_SUBTEST( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) );
// CALL_SUBTEST( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) );
// CALL_SUBTEST( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) );
// CALL_SUBTEST( product(Matrix<float,Dynamic,Dynamic,RowMajor>(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXd(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXi(ei_random<int>(1,320), ei_random<int>(1,320))) );
CALL_SUBTEST( product(MatrixXcf(ei_random<int>(1,50), ei_random<int>(1,50))) );
CALL_SUBTEST( product(Matrix<float,Dynamic,Dynamic,RowMajor>(ei_random<int>(1,320), ei_random<int>(1,320))) );
}
{
// test a specific issue in DiagonalProduct
// int N = 1000000;
// VectorXf v = VectorXf::Ones(N);
// MatrixXf m = MatrixXf::Ones(N,3);
// m = (v+v).asDiagonal() * m;
// VERIFY_IS_APPROX(m, MatrixXf::Constant(N,3,2));
int N = 1000000;
VectorXf v = VectorXf::Ones(N);
MatrixXf m = MatrixXf::Ones(N,3);
m = (v+v).asDiagonal() * m;
VERIFY_IS_APPROX(m, MatrixXf::Constant(N,3,2));
}
}