aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/cell-utils.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-10-22 10:55:52 +0200
committerThomas White <taw@physics.org>2019-10-22 10:55:52 +0200
commite5bd22e532c65c4980f8fcda566e9228f730a743 (patch)
tree8affa9de050f785a9e83e4030eff6a6f1dd36946 /libcrystfel/src/cell-utils.c
parent883e26767fb61d6af5381cbecf8fb2ff33210be7 (diff)
Add some warnings and assertions
Diffstat (limited to 'libcrystfel/src/cell-utils.c')
-rw-r--r--libcrystfel/src/cell-utils.c4
1 files changed, 4 insertions, 0 deletions
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);