Commit e5bd22e5 authored by Thomas White's avatar Thomas White
Browse files

Add some warnings and assertions

parent 883e2676
...@@ -1842,6 +1842,9 @@ static void mult_in_place(IntegerMatrix *T, IntegerMatrix *M) ...@@ -1842,6 +1842,9 @@ static void mult_in_place(IntegerMatrix *T, IntegerMatrix *M)
{ {
int i, j; int i, j;
IntegerMatrix *tmp = intmat_times_intmat(T, M); 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 ( i=0; i<3; i++ ) {
for ( j=0; j<3; j++ ) { for ( j=0; j<3; j++ ) {
intmat_set(T, i, j, intmat_get(tmp, i, j)); intmat_set(T, i, j, intmat_get(tmp, i, j));
...@@ -1934,6 +1937,7 @@ IntegerMatrix *reduce_g6(struct g6 g, double epsrel) ...@@ -1934,6 +1937,7 @@ IntegerMatrix *reduce_g6(struct g6 g, double epsrel)
intmat_set(M, 2, 2, LT(g.F, 0.0) ? -1 : 1); intmat_set(M, 2, 2, LT(g.F, 0.0) ? -1 : 1);
mult_in_place(T, M); mult_in_place(T, M);
assert(intmat_det(M) == 1);
g.D = fabs(g.D); g.D = fabs(g.D);
g.E = fabs(g.E); g.E = fabs(g.E);
g.F = fabs(g.F); g.F = fabs(g.F);
......
...@@ -592,6 +592,7 @@ static int check_cell(IndexingFlags flags, Crystal *cr, UnitCell *target, ...@@ -592,6 +592,7 @@ static int check_cell(IndexingFlags flags, Crystal *cr, UnitCell *target,
cell_free(crystal_get_cell(cr)); cell_free(crystal_get_cell(cr));
crystal_set_cell(cr, out); crystal_set_cell(cr, out);
rtnl_mtx_free(rm); rtnl_mtx_free(rm);
if ( !right_handed(out) ) STATUS("WARNING: left handed\n");
/* Copy the target cell's lattice type and unique axis /* Copy the target cell's lattice type and unique axis
* onto the crystal's cell. The cell from compare_r_c_p doesn't * onto the crystal's cell. The cell from compare_r_c_p doesn't
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment