From 2dba4b7ce7f8198d1e3fd87deb5c625c18c1cb31 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 6 Jul 2010 20:54:14 +0200 Subject: add a unit test for conj_helper and ei_pconj --- test/packetmath.cpp | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 71 insertions(+), 2 deletions(-) diff --git a/test/packetmath.cpp b/test/packetmath.cpp index f8fb044cd..3ed378d22 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -167,6 +167,7 @@ template void packetmath() CHECK_CWISE2(REF_DIV, ei_pdiv); #endif CHECK_CWISE1(ei_negate, ei_pnegate); + CHECK_CWISE1(ei_conj, ei_pconj); for (int i=0; i void packetmath_real() VERIFY(ei_isApprox(ref[0], ei_predux_max(ei_pload(data1))) && "ei_predux_max"); } +template void packetmath_complex() +{ + typedef typename ei_packet_traits::type Packet; + const int PacketSize = ei_packet_traits::size; + + const int size = PacketSize*4; + EIGEN_ALIGN16 Scalar data1[PacketSize*4]; + EIGEN_ALIGN16 Scalar data2[PacketSize*4]; + EIGEN_ALIGN16 Scalar ref[PacketSize*4]; + EIGEN_ALIGN16 Scalar pval[PacketSize*4]; + + for (int i=0; i() * Scalar(1e2); + data2[i] = ei_random() * Scalar(1e2); + } + + { + ei_conj_helper cj; + ei_conj_helper pcj; + for(int i=0;i cj; + ei_conj_helper pcj; + for(int i=0;i cj; + ei_conj_helper pcj; + for(int i=0;i cj; + ei_conj_helper pcj; + for(int i=0;i() ); + CALL_SUBTEST_1( packetmath() ); CALL_SUBTEST_2( packetmath() ); CALL_SUBTEST_3( packetmath() ); CALL_SUBTEST_1( packetmath >() ); + CALL_SUBTEST_2( packetmath >() ); -// CALL_SUBTEST_1( packetmath_real() ); + CALL_SUBTEST_1( packetmath_real() ); CALL_SUBTEST_2( packetmath_real() ); + + CALL_SUBTEST_1( packetmath_complex >() ); + CALL_SUBTEST_2( packetmath_complex >() ); } } -- cgit v1.2.3