diff options
Diffstat (limited to 'src/whirligig.c')
-rw-r--r-- | src/whirligig.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/whirligig.c b/src/whirligig.c index f5a435c2..cc2b531e 100644 --- a/src/whirligig.c +++ b/src/whirligig.c @@ -84,7 +84,7 @@ static void do_op(const IntegerMatrix *op, v[0] = h; v[1] = k; v[2] = l; - ans = intmat_intvec_mult(op, v); + ans = transform_indices(op, v); assert(ans != NULL); *he = ans[0]; *ke = ans[1]; *le = ans[2]; @@ -309,9 +309,9 @@ static IntegerMatrix *try_all(struct window *win, int n1, int n2, for ( i=0; i<i1->n_crystals; i++ ) { for ( j=0; j<i2->n_crystals; j++ ) { - if ( compare_cells(crystal_get_cell(i1->crystals[i]), - crystal_get_cell(i2->crystals[j]), - 0.1, deg2rad(5.0), &m) ) + if ( compare_reindexed_cell_parameters_and_orientation(crystal_get_cell(i1->crystals[i]), + crystal_get_cell(i2->crystals[j]), + 0.1, deg2rad(5.0), &m) ) { if ( !crystal_used(win, n1, i) && !crystal_used(win, n2, j) ) @@ -364,22 +364,20 @@ static int try_join(struct window *win, int sn) int j; Crystal *cr; UnitCell *ref; - UnitCellTransformation *tfn; const int sp = win->join_ptr - 1; /* Get the appropriately transformed cell from the last crystal in this * series */ - tfn = tfn_from_intmat(win->mat[sn][sp]); cr = win->img[sp].crystals[win->ser[sn][sp]]; - ref = cell_transform(crystal_get_cell(cr), tfn); - tfn_free(tfn); + ref = cell_transform_intmat(crystal_get_cell(cr), win->mat[sn][sp]); for ( j=0; j<win->img[win->join_ptr].n_crystals; j++ ) { Crystal *cr2; cr2 = win->img[win->join_ptr].crystals[j]; - if ( compare_cells(ref, crystal_get_cell(cr2), - 0.1, deg2rad(5.0), - &win->mat[sn][win->join_ptr]) ) { + if ( compare_reindexed_cell_parameters_and_orientation(ref, crystal_get_cell(cr2), + 0.1, deg2rad(5.0), + &win->mat[sn][win->join_ptr]) ) + { win->ser[sn][win->join_ptr] = j; cell_free(ref); return 1; |