diff options
author | Thomas White <taw@bitwiz.org.uk> | 2010-02-27 11:35:12 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2010-02-27 11:35:12 +0100 |
commit | 6170796e45768ed01b93304c1e363ef4a2b5a8fe (patch) | |
tree | 66ec526417a89af4d64355695eb490b7f51cb208 /src/pattern_sim.c | |
parent | 6b345bb3ab13139cff8ca5b7fdc551110eaaddea (diff) |
Do powder pattern as double precision floating point
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r-- | src/pattern_sim.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c index 59e5adb5..a29a8f0e 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) int c; struct image image; struct gpu_context *gctx = NULL; - long long int *powder; + double *powder; int config_simdetails = 0; int config_nearbragg = 0; int config_randomquat = 0; @@ -306,9 +306,10 @@ int main(int argc, char *argv[]) for ( x=0; x<image.width; x++ ) { for ( y=0; y<image.height; y++ ) { - powder[x+w*y] += image.data[x+w*y]; + powder[x+w*y] += (double)image.data[x+w*y]; if ( image.data[x+w*y] < 0 ) { - STATUS("Negative! %f %i %i\n", image.data[x+w*y], x, y); + STATUS("Negative! %f %i %i\n", + image.data[x+w*y], x, y); } } } @@ -316,7 +317,7 @@ int main(int argc, char *argv[]) if ( !(ndone % 10) ) { hdf5_write("results/integr.h5", powder, image.width, image.height, - H5T_NATIVE_LLONG); + H5T_NATIVE_DOUBLE); } } |