aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/product_notemporary.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-11-30 17:59:13 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-11-30 17:59:13 +0100
commitc927af60edbf7dd859fc8057151e40b0fe2de661 (patch)
tree2be21cf94a2a3ae83242d651d5900ec303f7ced6 /test/product_notemporary.cpp
parentab4ef5e66e33dd585bed2207c7c53948e30b2875 (diff)
Fix a performance regression in (mat*mat)*vec for which mat*mat was evaluated multiple times.
Diffstat (limited to 'test/product_notemporary.cpp')
-rw-r--r--test/product_notemporary.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp
index 2bb19a681..8bf71b4f2 100644
--- a/test/product_notemporary.cpp
+++ b/test/product_notemporary.cpp
@@ -136,6 +136,10 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
VERIFY_EVALUATION_COUNT( rm3.noalias() -= (cv1) * (rv1 * m1), 1 );
VERIFY_EVALUATION_COUNT( rm3.noalias() = (m1*cv1) * (rv1 * m1), 2 );
VERIFY_EVALUATION_COUNT( rm3.noalias() += (m1*cv1) * (rv1 * m1), 2 );
+
+ // Check nested products
+ VERIFY_EVALUATION_COUNT( cvres.noalias() = m1.adjoint() * m1 * cv1, 1 );
+ VERIFY_EVALUATION_COUNT( rvres.noalias() = rv1 * (m1 * m2.adjoint()), 1 );
}
void test_product_notemporary()