aboutsummaryrefslogtreecommitdiff
path: root/src/likelihood.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-06-28 12:12:49 +0200
committerThomas White <taw@physics.org>2012-02-22 15:26:51 +0100
commite3f93b71683c4e65d5e351c54174df0fabc11905 (patch)
tree6d08e8f63f8965be59d4ff9e643e11620e11cf85 /src/likelihood.c
parentce87fce11cbbbdc1c8ff1611eaf3255809ab6c87 (diff)
process_hkl: Use a different (array) indexing method to speed it up lots
Diffstat (limited to 'src/likelihood.c')
-rw-r--r--src/likelihood.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index 95f005c7..98ffcba0 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -19,17 +19,20 @@
void detwin_intensities(const double *model, double *new_pattern,
const unsigned int *model_counts,
- unsigned int *new_counts)
+ ReflItemList *items)
{
/* Placeholder... */
}
void scale_intensities(const double *model, double *new_pattern,
const unsigned int *model_counts,
- unsigned int *new_counts, double f0, int f0_valid)
+ ReflItemList *items, double f0, int f0_valid)
{
double s;
unsigned int i;
+ unsigned int *new_counts;
+
+ new_counts = items_to_counts(items);
s = stat_scale_intensity(model, model_counts, new_pattern, new_counts);
if ( f0_valid ) printf("%f %f\n", s, f0);
@@ -41,4 +44,6 @@ void scale_intensities(const double *model, double *new_pattern,
for ( i=0; i<LIST_SIZE; i++ ) {
new_counts[i] *= s;
}
+
+ free(new_counts);
}