diff options
author | Gael Guennebaud <g.gael@free.fr> | 2016-09-25 14:54:35 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2016-09-25 14:54:35 +0200 |
commit | 48dfe98abd00f2cb9b62d157f805f69d01b7892b (patch) | |
tree | e211b1d152c54f11f3941b0cf61e573ba252367b /test | |
parent | 86caba838db00ed977ed160a893d0a749856a215 (diff) |
bug #1308: fix compilation of vector * rowvector::nullary.
Diffstat (limited to 'test')
-rw-r--r-- | test/product_extra.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/product_extra.cpp b/test/product_extra.cpp index d253fd7ed..39abe82bb 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -256,6 +256,20 @@ Index compute_block_size() return ret; } + + +template<int> +void bug_1308() +{ + int n = 10; + MatrixXd r(n,n); + VectorXd v = VectorXd::Random(n); + r = v * RowVectorXd::Ones(n); + VERIFY_IS_APPROX(r, v.rowwise().replicate(n)); + r = VectorXd::Ones(n) * v.transpose(); + VERIFY_IS_APPROX(r, v.rowwise().replicate(n).transpose()); +} + void test_product_extra() { for(int i = 0; i < g_repeat; i++) { @@ -268,8 +282,10 @@ void test_product_extra() } CALL_SUBTEST_5( bug_127<0>() ); CALL_SUBTEST_5( bug_817<0>() ); + CALL_SUBTEST_5( bug_1308<0>() ); CALL_SUBTEST_6( unaligned_objects<0>() ); CALL_SUBTEST_7( compute_block_size<float>() ); CALL_SUBTEST_7( compute_block_size<double>() ); CALL_SUBTEST_7( compute_block_size<std::complex<double> >() ); + } |