From 147aefbcdc55ca9b33dcefcaa3f3ef86010b582b Mon Sep 17 00:00:00 2001 From: torset Date: Fri, 20 Feb 2009 10:20:08 +0000 Subject: change prototypes of matrixPow : if real on input, return real, not complex --- src/matrixOperations/powm/testDoublePowm.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/matrixOperations/powm/testDoublePowm.c') diff --git a/src/matrixOperations/powm/testDoublePowm.c b/src/matrixOperations/powm/testDoublePowm.c index 05cad5e5..1eb5a5e6 100644 --- a/src/matrixOperations/powm/testDoublePowm.c +++ b/src/matrixOperations/powm/testDoublePowm.c @@ -21,9 +21,7 @@ static void dpowmaTest(void){ double expand1=2.2; double result1R[4]={ 27.93459280052221771484 , 23.580294119266994812278 , 18.864235295413593007652 , 32.650651624375619519469 }; - double result1I[4]={ 3.6611113731522362257920 , - 3.6611113731522362257920 , - - 2.9288890985217883589087 , 2.9288890985217883589087 }; - doubleComplex out1[4]; + double out1[4]; int i; double in2[16]={ 2.5358983855694532394409 , 9.0725262500345706939697, 0.0026536155492067337036, 3.9639251008629798889160 , @@ -35,28 +33,21 @@ static void dpowmaTest(void){ 24728.411825244897045195 , 18392.823733925368287601 , 18631.05868385956637212 , 19357.84707477861229563 , 16169.682243927050876664 , 12258.542785024719705689 , 12630.164466338968850323 , 12827.915677254180991440 , 13742.841851328515986097 , 10198.0420642120679986 , 10658.784670951883526868 , 10839.51135004585739807 }; - double result2I[16]={ - 7.1981835972120027378196 , 1.9386514637886893552832, - 17.692616672339234185074 , 24.561537532538231687340 , - - 2.2418859631076406557781 , 0.6037961445855435371755, - 5.5103941755046683681485, 7.649730724813480264857 , - - 4.865855522250573272913 , 1.310496989059492634056 , - 11.95992230200565309417 , 16.603201547139228466676 , - 16.00935601900000193609 , - 4.3117212921047043394651 , 39.34984366402868971591 , - 54.626892107189902958453 }; - doubleComplex out2[16]; + double out2[16]; dpowma(in1, 2, expand1, out1); dpowma(in2, 4, expand2, out2); for (i=0;i<4;i++) { - assert( fabs(zreals(out1[i])-result1R[i]) / fabs(zreals(out1[i])) <1e-15); - assert( fabs(zimags(out1[i])-result1I[i]) / fabs(zimags(out1[i])) <1e-15); + assert( fabs(out1[i]-result1R[i]) / fabs(out1[i]) <1e-15); } /* FIXME : assert 1e-11 maybe due to spec2 */ for (i=0;i<16;i++) { - printf("out[%d] = %1.16f+%1.16f*i --- result = %1.16f+%1.16f*i\n",i,zreals(out2[i]),zimags(out2[i]),result2R[i],result2I[i]); - assert( fabs(zreals(out2[i])-result2R[i]) / fabs(zreals(out2[i])) <1e-14); - assert( fabs(zimags(out2[i])-result2I[i]) / fabs(zimags(out2[i])) <1e-11); + assert( fabs(out2[i]-result2R[i]) / fabs(out2[i]) <1e-14); } } -- cgit