diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-12-10 19:02:13 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-12-10 19:02:13 +0000 |
commit | beabf008b04dc9b449b23f082bab76d384983b73 (patch) | |
tree | ec4e0ddcbd24bbc2cb8fe5d94cda65f7b38cf622 /test/product_large.cpp | |
parent | ba9a53f9c69f90ccf7e6d70c6109380d40c6c4e5 (diff) |
bugfix in DiagonalProduct: a "DiagonalProduct<SomeXpr>" expression
is now evaluated as a "DiagonalProduct<Matrix<SomeXpr::Eval> >".
Note that currently this only happens in DiagonalProduct.
Diffstat (limited to 'test/product_large.cpp')
-rw-r--r-- | test/product_large.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/product_large.cpp b/test/product_large.cpp index a1e187889..1c33578be 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -33,4 +33,13 @@ void test_product_large() 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)); + } } |