From 65b32c63b24b094d6a0457e801bd871958dd9ab6 Mon Sep 17 00:00:00 2001 From: eschnett Date: Fri, 8 Mar 2013 20:29:17 +0000 Subject: Replace Cactus complex number type with C/C++ complex numbers Map CCTK_COMPLEX to "double complex" in C, and "complex" in C++. (It is already mapped to "double complex" in Fortran.) Update type definitions. Re-implement Cactus complex number math functions by calling the respective C functions. Update thorn that access real and imaginary parts of complex numbers to use standard-conforming methods instead. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4979 17b73243-c579-4c4c-a9d2-2d5706c11dac --- src/util/Table.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/util') diff --git a/src/util/Table.c b/src/util/Table.c index 1c9a3db8..9a613a41 100644 --- a/src/util/Table.c +++ b/src/util/Table.c @@ -94,6 +94,7 @@ typedef int bool; #endif #include "cctk_Types.h" +#include "cctk_Complex.h" #include "cctk_Constants.h" #include "cctk_Groups.h" #include "cctk_Flesh.h" @@ -5591,8 +5592,8 @@ int Util_TablePrint(FILE *stream, int handle) for (i = 0 ; i < tep->N_elements ; ++i) { fprintf(stream, "\t(%g,%g)", - (double) value_ptr_complex[i].Re, - (double) value_ptr_complex[i].Im); + (double) CCTK_CmplxReal(value_ptr_complex[i]), + (double) CCTK_CmplxImag(value_ptr_complex[i])); } } break; @@ -5729,8 +5730,8 @@ int Util_TablePrintPretty(FILE *stream, int handle) fprintf(stream, " "); } fprintf(stream, "(%#.17g,%#.17g)", - (double)value_ptr_complex[i].Re, - (double)value_ptr_complex[i].Im); + (double)CCTK_CmplxReal(value_ptr_complex[i]), + (double)CCTK_CmplxImag(value_ptr_complex[i])); } if (tep->N_elements != 1) { -- cgit v1.2.3