aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/asdf.c
diff options
context:
space:
mode:
authorAlexandra Tolstikova <alexandra.tolstikova@desy.de>2015-07-09 14:15:53 +0200
committerThomas White <taw@physics.org>2015-07-10 16:25:05 +0200
commit65b952d9d99f1a6b3ecf353f6725065b616f5609 (patch)
tree88e4f98bd9b897cd5970689e1fbb46b0fbb38856 /libcrystfel/src/asdf.c
parent235e8eb20240af5266b064ee931bc6723004bf4d (diff)
Temporary fix of infinite loop bug in asdf_reduce_cell()
Diffstat (limited to 'libcrystfel/src/asdf.c')
-rw-r--r--libcrystfel/src/asdf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcrystfel/src/asdf.c b/libcrystfel/src/asdf.c
index df6d7500..132db47d 100644
--- a/libcrystfel/src/asdf.c
+++ b/libcrystfel/src/asdf.c
@@ -597,7 +597,10 @@ static int reduce_asdf_cell(struct asdf_cell *cl)
gsl_vector *vc = gsl_vector_alloc(3);
int changed = 1;
+
+ int n = 0;
while ( changed ) {
+ n += 1;
changed = 0;
gsl_vector_memcpy(va, cl->axes[0]);
@@ -688,6 +691,8 @@ static int reduce_asdf_cell(struct asdf_cell *cl)
changed = 1;
}
}
+
+ if (n > 30) changed = 0;
}
cross_product(cl->axes[0], cl->axes[1], &vc);