allow mixed complex-real and real-complex dot products

This commit is contained in:
Gael Guennebaud
2011-01-27 09:59:19 +01:00
parent fe3bb545e0
commit 0bfb78c824
5 changed files with 31 additions and 18 deletions

View File

@@ -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()