diff options
author | Thomas White <taw@physics.org> | 2016-10-19 15:31:53 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2016-10-19 15:31:53 +0200 |
commit | dc3a150fd217c58b9d1ab9107b9ba216801be090 (patch) | |
tree | 01939926b7943ace0551f778c1657c17765ae92a /libcrystfel/src | |
parent | fa07eee6efd51a224a528f0d0fcc23c194c0fec0 (diff) |
Minor cleanups
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/taketwo.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c index 0e999a0e..581c676d 100644 --- a/libcrystfel/src/taketwo.c +++ b/libcrystfel/src/taketwo.c @@ -465,18 +465,14 @@ static int find_next_index(gsl_matrix *rot, struct SpotVec *obs_vecs, int shared = obs_shares_spot_w_array(obs_vecs, i, members, member_num); - if ( !shared ) { - continue; - } + if ( !shared ) continue; /* now we check that angles between all vectors match */ int matches = obs_angles_match_array(obs_vecs, i, members, member_num); - if ( !matches ) { - continue; - } + if ( !matches ) continue; /* final test: does the corresponding rotation matrix * match the others? NOTE: have not tested to see if @@ -502,7 +498,7 @@ static int find_next_index(gsl_matrix *rot, struct SpotVec *obs_vecs, */ int ok = 1; - for ( j=0; j<2 && ok; j++ ) { + for ( j=0; j<2; j++ ) { gsl_matrix *test_rot = gsl_matrix_calloc(3, 3); int j_idx = members[j]; @@ -512,11 +508,10 @@ static int find_next_index(gsl_matrix *rot, struct SpotVec *obs_vecs, *test_match); ok = rot_mats_are_similar(rot, test_rot); + if ( !ok ) break; } - if ( !ok ) { - continue; - } + if ( !ok ) continue; /* successful branch - return to calling function...*/ @@ -548,9 +543,7 @@ static int grow_network(gsl_matrix *rot, struct SpotVec *obs_vecs, int start = obs_idx2 + 1; while ( 1 ) { - /* There must be a better way of passing int *[100] pointer - * to an int ** parameter, but I don't know... - **/ + int next_index = find_next_index(rot, obs_vecs, obs_vec_count, members, start, member_num); |