aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2013-02-06 20:07:56 +0100
committerThomas White <taw@bitwiz.org.uk>2013-02-06 20:07:56 +0100
commita1ee07e0887bd23491218301ad440a4ad2efb24f (patch)
tree855fcfa420bb3a7809773f8df41152d82f91dcf7 /src
parent53382f60c7f8955c016725885c04f510f7fe96ee (diff)
Stuff
Diffstat (limited to 'src')
-rw-r--r--src/partial_sim.c5
-rw-r--r--src/post-refinement.c6
-rw-r--r--src/post-refinement.h2
3 files changed, 5 insertions, 8 deletions
diff --git a/src/partial_sim.c b/src/partial_sim.c
index 4e96fbbc..502e7028 100644
--- a/src/partial_sim.c
+++ b/src/partial_sim.c
@@ -252,7 +252,6 @@ static void run_job(void *vwargs, int cookie)
struct queue_args *qargs = wargs->qargs;
int i;
Crystal *cr;
- UnitCell *cell;
RefList *reflections;
cr = crystal_new();
@@ -268,9 +267,7 @@ static void run_job(void *vwargs, int cookie)
/* Set up a random orientation */
orientation = random_quaternion();
- cell = cell_rotate(qargs->cell, orientation);
- crystal_set_cell(cr, cell);
- cell_free(cell);
+ crystal_set_cell(cr, cell_rotate(qargs->cell, orientation));
snprintf(wargs->image.filename, 255, "dummy.h5");
reflections = find_intersections(&wargs->image, cr);
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 31558ec7..1439b148 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -88,7 +88,7 @@ static double partiality_rgradient(double r, double profile_radius)
/* Return the gradient of parameter 'k' given the current status of 'image'. */
-double gradient(Crystal *cr, int k, Reflection *refl, double r)
+double gradient(Crystal *cr, int k, Reflection *refl)
{
double ds, azix, aziy;
double ttlow, tthigh, tt;
@@ -104,6 +104,7 @@ double gradient(Crystal *cr, int k, Reflection *refl, double r)
double klow, khigh;
double gr;
struct image *image = crystal_get_image(cr);
+ double r = crystal_get_profile_radius(cr);
get_symmetric_indices(refl, &hs, &ks, &ls);
@@ -419,8 +420,7 @@ static double pr_iterate(Crystal *cr, const RefList *full)
/* Calculate all gradients for this reflection */
for ( k=0; k<NUM_PARAMS; k++ ) {
double gr;
- gr = gradient(cr, k, refl,
- crystal_get_profile_radius(cr));
+ gr = gradient(cr, k, refl);
gradients[k] = gr;
}
diff --git a/src/post-refinement.h b/src/post-refinement.h
index 52e70b2b..fe171882 100644
--- a/src/post-refinement.h
+++ b/src/post-refinement.h
@@ -62,7 +62,7 @@ enum {
extern void pr_refine(Crystal *cr, const RefList *full);
/* Exported so it can be poked by tests/pr_gradient_check */
-extern double gradient(Crystal *cr, int k, Reflection *refl, double r);
+extern double gradient(Crystal *cr, int k, Reflection *refl);
#endif /* POST_REFINEMENT_H */