aboutsummaryrefslogtreecommitdiff
path: root/src/post-refinement.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2017-02-22 15:08:24 +0100
committerThomas White <taw@physics.org>2018-02-27 17:12:41 +0100
commitf61a2210c6afd5ff222e271c450fdc08cf2b4475 (patch)
tree0d7419ac4a21013bca60aaa2d11e56afc1fcf373 /src/post-refinement.c
parentaccccf0bd80fb4395cb82c84b702c8a08939ecc6 (diff)
Horrible restraint to keep algorithm from drifting too far
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r--src/post-refinement.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 318d1733..da3f6683 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -294,6 +294,11 @@ static double residual_f(const gsl_vector *v, void *pp)
struct image im;
Crystal *cr;
double res;
+ int i;
+
+ for ( i=0; i<v->size; i++ ) {
+ if ( gsl_vector_get(v, i) > 100.0 ) return INFINITY;
+ }
cr = crystal_copy(pv->cr);
im = *crystal_get_image(cr);