8 m_metrical_matrix(init_lat_col_mat.transpose() * init_lat_col_mat) {
44 bool does_meet =
true;
60 bool does_meet =
true;
76 bool does_meet =
false;
87 bool does_meet =
false;
98 bool does_meet =
true;
119 bool does_meet =
true;
140 bool does_meet =
true;
161 bool does_meet =
true;
166 if(
compare(clobber,
C(), compare_tol)) {
187 bool totally_niggli =
false;
196 totally_niggli =
true;
199 return totally_niggli;
212 std::cout <<
A() <<
" " <<
B() <<
" " <<
C() <<
" "
213 <<
ksi() <<
" " <<
eta() <<
" " <<
zeta() << std::endl;
244 if(!keep_handedness) {
249 bool first_niggli =
true;
255 for(
auto it = candidate_trans_mats.begin(); it != candidate_trans_mats.end(); ++it) {
258 if(
is_niggli(candidate_lat_mat, compare_tol)) {
260 best_lat_mat = candidate_lat_mat;
261 first_niggli =
false;
284 for(
auto it = point_grp.
begin(); it != point_grp.
end(); ++it) {
289 Lattice transformed_lat(transformed_lat_mat);
293 if(candidate_lat_mat.determinant() < 0.0) {
298 most_canonical_lat_mat = candidate_lat_mat;
302 return Lattice(most_canonical_lat_mat);
322 int non_negatives = 0;
323 for(
int i = 0; i < 3; i++) {
324 for(
int j = 0; j < 3; j++) {
325 if(
float_sgn(lat_mat(i, j), compare_tol) != -1) {
334 lat_spatial_descriptor <<
344 -std::abs(lat_mat(2, 1)),
345 -std::abs(lat_mat(2, 0)),
346 -std::abs(lat_mat(1, 0)),
347 -std::abs(lat_mat(1, 2)),
348 -std::abs(lat_mat(0, 2)),
349 -std::abs(lat_mat(0, 1)),
359 return lat_spatial_descriptor;
399 if((low_score_is_bisymmetric && !high_score_is_bisymmetric) || (low_score_is_symmetric && !high_score_is_symmetric)) {
404 else if((!low_score_is_bisymmetric && high_score_is_bisymmetric) || (!low_score_is_symmetric && high_score_is_symmetric)) {
bool meets_criteria_2(double compare_tol) const
B<=C OR (B==C, |eta| <= |zeta|)
bool almost_zero(const T &val, double tol=TOL)
If T is not integral, use std::abs(val) < tol;.
bool standard_orientation_spatial_compare(const Eigen::Matrix3d &low_score_lat_mat, Eigen::Matrix3d &high_score_lat_mat, double compare_tol)
Compare the spatial orientation (ignoring matrix symmetry) and determine which one is oriented more s...
bool compare(const T &A, const T &B, double tol)
Floating point comparison with tol, return A < B.
double A() const
Square of lattice length a.
bool float_lexicographical_compare(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, double tol)
Floating point lexicographical comparison with tol.
bool meets_criteria_7(double compare_tol) const
|zeta|<=A OR (zeta==A, eta<=2*ksi) OR (zeta==-A, eta==0)
bool is_niggli_type2(double compare_tol) const
True if all conditions except 3 are true.
bool is_bisymmetric(const Eigen::MatrixBase< Derived > &test_mat, double test_tol=CASM::TOL)
bool standard_orientation_compare(const Eigen::Matrix3d &low_score_lat_mat, const Eigen::Matrix3d &high_score_lat_mat, double compare_tol)
Determine whether high_score has a more standard format than low_score.
Lattice get_reduced_cell() const
Find the lattice vectors which give most compact unit cell Compactness is measured by how close lat_c...
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
double C() const
Square of lattice length c.
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
bool is_niggli_type1(double compare_tol) const
True if all conditions except 4 are true.
Eigen::VectorXd spatial_unroll(const Eigen::Matrix3d &lat_mat, double compare_tol)
Generate a vector whose lexicographical value determines how well it's oriented in space...
bool meets_criteria_4(double compare_tol) const
For type II: ksi<=0 && eta<=0 && zeta<=0 (all angles >= 90)
double zeta() const
2ab*cos(gamma)
bool is_niggli(const Eigen::Matrix3d &test_lat_mat, double compare_tol)
Check whether the given lattice (represented as a matrix) is in niggli TYPE ?? reduced form (does not...
const std::vector< Eigen::Matrix3i > & positive_unimodular_matrices()
double B() const
Square of lattice length b.
int float_sgn(T val, double compare_tol=TOL)
Lattice canonical_equivalent_lattice(const Lattice &in_lat, const SymGroup &point_grp, double compare_tol)
Find the niggli, most standard oriented version of the given orbit (defined by the given SymGroup) of...
NiggliRep(const Lattice &init_lat)
const Eigen::Matrix3d & metrical_matrix() const
double ksi() const
2bc*cos(alpha)
bool meets_criteria_1(double compare_tol) const
A<=B OR (A==B, |ksi| <= |eta|)
bool meets_criteria_8(double compare_tol) const
const Eigen::Matrix3d m_metrical_matrix
Transpose of initialization lattice dotted with itself.
bool is_symmetric(const Eigen::MatrixBase< Derived > &test_mat, double test_tol=CASM::TOL)
bool is_niggli(double compare_tol) const
True if all conditions are true, and either 4 OR 3 is false.
void debug_criteria(double compare_tol) const
Lattice & make_right_handed()
Flip c vector if it's on the wrong side of a-b plane – return (*this)
bool meets_criteria_3(double compare_tol) const
For type I: ksi>0 && eta>0 && zeta>0 (all angles < 90)
double eta() const
2ac*cos(beta)
bool meets_criteria_6(double compare_tol) const
|eta|<=A OR (eta==A, zeta<=2*ksi) OR (eta==-A, zeta==0)
Lattice niggli(const Lattice &in_lat, double compare_tol, bool keep_handedness=false)
Convert the given lattice into it's niggli reduced form, with the most standard orientation possilbe...
bool meets_criteria_5(double compare_tol) const
|ksi|<=B OR (ksi==B, zeta<=2*eta) OR (ksi==-B, zeta==0)
bool almost_equal(const GenericCluster< CoordType > &LHS, const GenericCluster< CoordType > &RHS, double tol)