aboutsummaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/cell_tool.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/cell_tool.c b/src/cell_tool.c
index d6c5b6cd..6d0c5f1e 100644
--- a/src/cell_tool.c
+++ b/src/cell_tool.c
@@ -92,7 +92,14 @@ static int comparecells(UnitCell *cell, const char *comparecell,
STATUS("No relationship found between lattices.\n");
return 0;
} else {
+ UnitCell *trans;
STATUS("Relationship found:\n");
+ rtnl_mtx_print(m);
+ STATUS("Transformed version of input unit cell:\n");
+ trans = cell_transform_rational(cell, m);
+ cell_print(trans);
+ cell_free(trans);
+
}
rtnl_mtx_free(m);
@@ -294,15 +301,19 @@ static int find_ambi(UnitCell *cell, SymOpList *sym, double ltl, double atl)
static int uncenter(UnitCell *cell, const char *out_file)
{
UnitCell *cnew;
- IntegerMatrix *m;
+ IntegerMatrix *C;
+ RationalMatrix *Ci;
- cnew = uncenter_cell(cell, &m);
+ cnew = uncenter_cell(cell, &C, &Ci);
STATUS("------------------> The primitive unit cell:\n");
cell_print(cnew);
STATUS("------------------> The centering transformation:\n");
- intmat_print(m);
+ intmat_print(C);
+
+ STATUS("------------------> The un-centering transformation:\n");
+ rtnl_mtx_print(Ci);
if ( out_file != NULL ) {
FILE *fh = fopen(out_file, "w");