From 4f6fdb75716cc884ce0db7ce9970574e23af3bc8 Mon Sep 17 00:00:00 2001 From: cppxfel Date: Sat, 1 Jul 2017 13:44:53 +0100 Subject: Adding a cutoff for maximum allowed vectors (100,000) to stop Tom's computer (and others) falling apart again. --- libcrystfel/src/taketwo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c index 2984959f..4cd90cd4 100644 --- a/libcrystfel/src/taketwo.c +++ b/libcrystfel/src/taketwo.c @@ -110,6 +110,10 @@ struct TakeTwoCell /* Maximum dead ends for a single branch extension during indexing */ #define MAX_DEAD_ENDS (10) +/* Maximum observed vectors before TakeTwo gives up and deals with + * what is already there. */ +#define MAX_OBS_VECTORS 100000 + /* Tolerance for two angles to be considered the same */ #define ANGLE_TOLERANCE (deg2rad(0.6)) @@ -1291,7 +1295,7 @@ static int gen_observed_vecs(struct rvec *rlps, int rlp_count, /* maximum distance squared for comparisons */ double max_sq_length = pow(MAX_RECIP_DISTANCE, 2); - for ( i=0; i