aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/product_notemporary.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2019-02-18 14:43:07 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2019-02-18 14:43:07 +0100
commitc69d0d08d0d71c779a245babe80342f0cf1ea985 (patch)
treee31690b52ed0cb75e59fdb17a649abd0e45e9157 /test/product_notemporary.cpp
parent512b74aaa19fa12a05774dd30205d2c97e8bdef9 (diff)
Set cost of conjugate to 0 (in practice it boils down to a no-op).
This is also important to make sure that A.conjugate() * B.conjugate() does not evaluate its arguments into temporaries (e.g., if A and B are fixed and small, or * fall back to lazyProduct)
Diffstat (limited to 'test/product_notemporary.cpp')
-rw-r--r--test/product_notemporary.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp
index 7f169e6ae..8b6419d0c 100644
--- a/test/product_notemporary.cpp
+++ b/test/product_notemporary.cpp
@@ -134,7 +134,9 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
VERIFY_EVALUATION_COUNT( m3.noalias() = m1.block(r0,r0,r1,r1).template triangularView<UnitUpper>() * m2.block(r0,c0,r1,c1), 1);
// Zero temporaries for lazy products ...
+ m3.setRandom(rows,cols);
VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose().lazyProduct(m3)).diagonal().sum(), 0 );
+ VERIFY_EVALUATION_COUNT( m3.noalias() = m1.conjugate().lazyProduct(m2.conjugate()), 0);
// ... and even no temporary for even deeply (>=2) nested products
VERIFY_EVALUATION_COUNT( Scalar tmp = 0; tmp += Scalar(RealScalar(1)) / (m3.transpose() * m3).diagonal().sum(), 0 );