LatticeSearch: Return reindex matrix

This commit is contained in:
2026-06-04 21:22:46 +02:00
parent 56144a6e5f
commit fd9a9429b5
2 changed files with 6 additions and 0 deletions
@@ -339,6 +339,7 @@ LatticeSearchResult LatticeSearch(const CrystalLattice &L, double dist_tolerance
.conventional = L_niggli.Multiply(c.reindex),
.system = c.system,
.centering = c.centering,
.reindex = c.reindex,
};
}
}
@@ -349,5 +350,6 @@ LatticeSearchResult LatticeSearch(const CrystalLattice &L, double dist_tolerance
.conventional = L_niggli,
.system = gemmi::CrystalSystem::Triclinic,
.centering = 'P',
.reindex = gemmi::Mat33(1, 0, 0, 0, 1, 0, 0, 0, 1),
};
}
@@ -16,6 +16,10 @@ struct LatticeSearchResult {
CrystalLattice conventional;
gemmi::CrystalSystem system = gemmi::CrystalSystem::Triclinic;
char centering = 'P'; // 'P','A','B','C','I','F','R'
// Change-of-basis from primitive_reduced to conventional:
// conventional = primitive_reduced.Multiply(reindex)
gemmi::Mat33 reindex = gemmi::Mat33(1, 0, 0, 0, 1, 0, 0, 0, 1);
};
LatticeSearchResult LatticeSearch(const CrystalLattice& L, double dist_tolerance = 0.03, double angle_tolerance_deg = 3);