From a8c08e8b8e8bdd486a5a27b9f1e92c48ef4361cd Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 14 Jun 2016 12:06:10 +0200 Subject: Implement expr+scalar, scalar+expr, expr-scalar, and scalar-expr as binary expressions, and generalize supported scalar types. The following functors are now deprecated: scalar_add_op, scalar_sub_op, and scalar_rsub_op. --- test/mixingtypes.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/mixingtypes.cpp') diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp index dee4f35df..cf2207114 100644 --- a/test/mixingtypes.cpp +++ b/test/mixingtypes.cpp @@ -75,6 +75,18 @@ template void mixingtypes(int size = SizeAtCompileType) VERIFY_IS_APPROX(vcf / sf , vcf / complex(sf)); VERIFY_IS_APPROX(vf / scf , vf.template cast >() / scf); + // check scalar increment + VERIFY_IS_APPROX(vcf.array() + sf , vcf.array() + complex(sf)); + VERIFY_IS_APPROX(sd + vcd.array(), complex(sd) + vcd.array()); + VERIFY_IS_APPROX(vf.array() + scf, vf.template cast >().array() + scf); + VERIFY_IS_APPROX(scd + vd.array() , scd + vd.template cast >().array()); + + // check scalar subtractions + VERIFY_IS_APPROX(vcf.array() - sf , vcf.array() - complex(sf)); + VERIFY_IS_APPROX(sd - vcd.array(), complex(sd) - vcd.array()); + VERIFY_IS_APPROX(vf.array() - scf, vf.template cast >().array() - scf); + VERIFY_IS_APPROX(scd - vd.array() , scd - vd.template cast >().array()); + // check dot product vf.dot(vf); #if 0 // we get other compilation errors here than just static asserts -- cgit v1.2.3