diff options
author | eschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb> | 2013-03-08 20:31:28 +0000 |
---|---|---|
committer | eschnett <eschnett@d60812e6-3970-4df4-986e-c251b06effeb> | 2013-03-08 20:31:28 +0000 |
commit | 67672101e3ec78be4ff80ac5cadf701b521e1a12 (patch) | |
tree | 6684a6851845d6e8710308349b435e97ad7ad4ae /src/ReductionNorm2.c | |
parent | d41baa4c819a5f3c51d03ce7372286589bce563c (diff) |
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/ReductionNorm2.c')
-rw-r--r-- | src/ReductionNorm2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ReductionNorm2.c b/src/ReductionNorm2.c index a93e279..5eb9c3b 100644 --- a/src/ReductionNorm2.c +++ b/src/ReductionNorm2.c @@ -315,8 +315,8 @@ static int ReductionNorm2 (const cGH *GH, case CCTK_VARIABLE_COMPLEX: #undef REDUCTION_OPERATION -#define REDUCTION_OPERATION(norm2, scalar) norm2 += SQR ((scalar).Re) + \ - SQR ((scalar).Im) +#define REDUCTION_OPERATION(norm2, scalar) \ + norm2 += SQR (CCTK_CmplxReal(scalar)) + SQR (CCTK_CmplxImag(scalar)) ITERATE_ARRAY (CCTK_COMPLEX, num_dims, inarrays[i], from, to, iterator, points_per_dim, CCTK_REAL, outvals, num_outvals, total_outvals); |