diff options
author | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-03-08 20:29:17 +0000 |
---|---|---|
committer | eschnett <eschnett@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2013-03-08 20:29:17 +0000 |
commit | 65b32c63b24b094d6a0457e801bd871958dd9ab6 (patch) | |
tree | b773659f86fdc0c7edfddc9773d7f23b34f9e138 /src/util/Table.c | |
parent | 33ba7bb1a810b1965a4dee0039871236edbb5035 (diff) |
Replace Cactus complex number type with C/C++ complex numbers
Map CCTK_COMPLEX to "double complex" in C, and "complex<double>" 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
Diffstat (limited to 'src/util/Table.c')
-rw-r--r-- | src/util/Table.c | 9 |
1 files changed, 5 insertions, 4 deletions
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) { |