aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-06-18 17:05:31 +0200
committerThomas White <taw@physics.org>2019-06-19 10:56:23 +0200
commitc5ab9ad56d759ee6c22ed46dc4831196cbf98b12 (patch)
treed749f7004f13973dff284eee2ba75fd9e8a06ba8 /src
parentbedd8dd7dc896775408e0badbbdb1768b28d8d74 (diff)
pattern_sim: Fix uninitialised value
Diffstat (limited to 'src')
-rw-r--r--src/diffraction-gpu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c
index 4ecf0558..3feba50b 100644
--- a/src/diffraction-gpu.c
+++ b/src/diffraction-gpu.c
@@ -344,6 +344,7 @@ int get_diffraction_gpu(struct gpu_context *gctx, struct image *image,
/* Determine normalisation factor such that weights add up to 1 after
* sampling (bins must have constant width) */
+ norm = 0.0;
for ( i=1; i<=n_samples; i++ ) {
double k = kmin + i*step;
norm += spectrum_get_density_at_k(image->spectrum, k);