aboutsummaryrefslogtreecommitdiff
path: root/tests/centering_check.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-03-06 11:40:37 +0100
committerThomas White <taw@physics.org>2019-03-11 16:49:37 +0100
commit4f11a9f8530178cfb510f11c7bc4b1829bbd0be4 (patch)
treece4e620e54773e0f17fb653ccfe21f0490e3e373 /tests/centering_check.c
parent68061d0e3c42f61fa7664e0f0996cade13057391 (diff)
Keep track of the "un-centering" matrix, as well as the "centering"
This makes it easy to reverse the transformation, if required, which it is when comparing centered cells.
Diffstat (limited to 'tests/centering_check.c')
-rw-r--r--tests/centering_check.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/centering_check.c b/tests/centering_check.c
index 774af66b..cc553dd0 100644
--- a/tests/centering_check.c
+++ b/tests/centering_check.c
@@ -61,7 +61,8 @@ static int check_centering(double a, double b, double c,
{
UnitCell *cell, *cref;
UnitCell *n;
- IntegerMatrix *t;
+ IntegerMatrix *C;
+ RationalMatrix *Ci;
int fail = 0;
int i;
double asx, asy, asz;
@@ -86,12 +87,12 @@ static int check_centering(double a, double b, double c,
cell_free(cref);
check_cell(cell, "Input");
- n = uncenter_cell(cell, &t);
+ n = uncenter_cell(cell, &C, &Ci);
if ( n != NULL ) {
STATUS("The back transformation is:\n");
- intmat_print(t);
+ intmat_print(C);
if ( check_cell(n, "Output") ) fail = 1;
- if ( intmat_is_identity(t) && ((cen=='P') || (cen=='R')) ) {
+ if ( intmat_is_identity(C) && ((cen=='P') || (cen=='R')) ) {
STATUS("Identity, as expected.\n");
} else {
cell_print(n);