From e5bd22e532c65c4980f8fcda566e9228f730a743 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 22 Oct 2019 10:55:52 +0200 Subject: Add some warnings and assertions --- libcrystfel/src/cell-utils.c | 4 ++++ libcrystfel/src/index.c | 1 + 2 files changed, 5 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c index f96554dd..f9ef3218 100644 --- a/libcrystfel/src/cell-utils.c +++ b/libcrystfel/src/cell-utils.c @@ -1842,6 +1842,9 @@ static void mult_in_place(IntegerMatrix *T, IntegerMatrix *M) { int i, j; IntegerMatrix *tmp = intmat_times_intmat(T, M); + assert(intmat_det(M) == 1); + assert(intmat_det(T) == 1); + assert(intmat_det(tmp) == 1); for ( i=0; i<3; i++ ) { for ( j=0; j<3; j++ ) { intmat_set(T, i, j, intmat_get(tmp, i, j)); @@ -1934,6 +1937,7 @@ IntegerMatrix *reduce_g6(struct g6 g, double epsrel) intmat_set(M, 2, 2, LT(g.F, 0.0) ? -1 : 1); mult_in_place(T, M); + assert(intmat_det(M) == 1); g.D = fabs(g.D); g.E = fabs(g.E); g.F = fabs(g.F); diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c index d24e8355..2dead425 100644 --- a/libcrystfel/src/index.c +++ b/libcrystfel/src/index.c @@ -592,6 +592,7 @@ static int check_cell(IndexingFlags flags, Crystal *cr, UnitCell *target, cell_free(crystal_get_cell(cr)); crystal_set_cell(cr, out); rtnl_mtx_free(rm); + if ( !right_handed(out) ) STATUS("WARNING: left handed\n"); /* Copy the target cell's lattice type and unique axis * onto the crystal's cell. The cell from compare_r_c_p doesn't -- cgit v1.2.3