aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/adjoint.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2011-01-27 09:59:19 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2011-01-27 09:59:19 +0100
commit0bfb78c8240525a8065e008efad08498d572ef81 (patch)
tree0f899ed3e3dceb9bfc2b1d356178a83d2999510f /test/adjoint.cpp
parentfe3bb545e0a1a1cfaf36f6e25a5cc0bfb00337c6 (diff)
allow mixed complex-real and real-complex dot products
Diffstat (limited to 'test/adjoint.cpp')
-rw-r--r--test/adjoint.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index 72cbf3406..47889591f 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -106,6 +106,11 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
m3.transposeInPlace();
VERIFY_IS_APPROX(m3,m1.conjugate());
+ // check mixed dot product
+ typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, 1> RealVectorType;
+ RealVectorType rv1 = RealVectorType::Random(rows);
+ VERIFY_IS_APPROX(v1.dot(rv1.template cast<Scalar>()), v1.dot(rv1));
+ VERIFY_IS_APPROX(rv1.template cast<Scalar>().dot(v1), rv1.dot(v1));
}
void test_adjoint()