aboutsummaryrefslogtreecommitdiff
path: root/src/ReductionNorm4.c
diff options
context:
space:
mode:
authoreschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb>2013-03-08 20:31:28 +0000
committereschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb>2013-03-08 20:31:28 +0000
commit67672101e3ec78be4ff80ac5cadf701b521e1a12 (patch)
tree6684a6851845d6e8710308349b435e97ad7ad4ae /src/ReductionNorm4.c
parentd41baa4c819a5f3c51d03ce7372286589bce563c (diff)
Replace Cactus complex number type with C/C++ complex numbersHEADmaster
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/arrangements/CactusPUGH/PUGHReduce/trunk@105 d60812e6-3970-4df4-986e-c251b06effeb
Diffstat (limited to 'src/ReductionNorm4.c')
-rw-r--r--src/ReductionNorm4.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ReductionNorm4.c b/src/ReductionNorm4.c
index a95c345..bba43ce 100644
--- a/src/ReductionNorm4.c
+++ b/src/ReductionNorm4.c
@@ -313,8 +313,9 @@ static int ReductionNorm4 (const cGH *GH,
case CCTK_VARIABLE_COMPLEX:
#undef REDUCTION_OPERATION
-#define REDUCTION_OPERATION(norm4, scalar) \
- norm4 += POWER2 (POWER2 ((scalar).Re) + POWER2 ((scalar).Im))
+#define REDUCTION_OPERATION(norm4, scalar) \
+ norm4 += POWER2 (POWER2 (CCTK_CmplxReal(scalar)) + \
+ POWER2 (CCTK_CmplxImag(scalar)))
ITERATE_ARRAY (CCTK_COMPLEX, num_dims, inarrays[i],
from, to, iterator, points_per_dim,
CCTK_REAL, outvals, num_outvals, total_outvals);