10 #include "casm/external/Eigen/Core"
18 if (transformation_matrix.determinant() == 0) {
19 throw std::runtime_error(
20 "The transformation matrix that converts the tiling unit to the "
21 "superlattice is singular, and therefore not valid.");
32 vec2[0] = ((vec2[0] % vol) + std::abs(vol)) % vol;
33 vec2[1] = ((vec2[1] % vol) + std::abs(vol)) % vol;
34 vec2[2] = ((vec2[2] % vol) + std::abs(vol)) % vol;
48 : m_bring_within_f(transformation_matrix),
49 m_total_lattice_points(
std::abs(transformation_matrix.determinant())) {
56 m_stride[1] = S_diagonal[0] * S_diagonal[1];
58 assert(transformation_matrix ==
80 throw std::runtime_error(
81 "Lattice point index out of range! Specified index " +
92 std::vector<UnitCell> all_lattice_points;
95 auto total_lattice_points = generate_point.
size();
97 for (
int i = 0; i < total_lattice_points; ++i) {
98 all_lattice_points.emplace_back(generate_point(i));
101 return all_lattice_points;
matrix_type m_transformation_matrix
Eigen::Matrix< long, 3, 3 > matrix_type
vector_type operator()(const vector_type &ijk) const
Brings the given lattice point within the superlattice.
static void _throw_if_bad_transformation_matrix(const matrix_type &transformation_matrix)
Throws exception if the transformation matrix has determinant 0.
matrix_type m_transformation_matrix_adjugate
Eigen::Matrix< long, 3, 1 > vector_type
const UnitCell & unitcell() const
IntegralCoordinateWithin_f::vector_type vector_type
std::array< int, 2 > m_stride
long int m_total_lattice_points
matrix_type m_smith_normal_V
vector_type _make_smith_normal_form_lattice_point(Index ix) const
vector_type _normalize_lattice_point(const vector_type &mnp) const
IntegralCoordinateWithin_f m_bring_within_f
IntegralCoordinateWithin_f::matrix_type matrix_type
vector_type operator()(Index ix) const
OrderedLatticePointGenerator(const matrix_type &transformation_matrix)
long int size() const
Returns the total number of unique lattice points that can be generated.
matrix_type m_smith_normal_S
matrix_type m_smith_normal_U
std::string to_string(ENUM val)
Return string representation of enum class.
void smith_normal_form(const Eigen::MatrixBase< DerivedIn > &M, Eigen::MatrixBase< DerivedOut > &U, Eigen::MatrixBase< DerivedOut > &S, Eigen::MatrixBase< DerivedOut > &V)
Return the smith normal form, M == U*S*V.
std::vector< UnitCell > make_lattice_points(const OrderedLatticePointGenerator::matrix_type &transformation_matrix)
std::vector< UnitCell > make_lattice_points(const Eigen::Matrix3l &transformation_matrix)
Eigen::Matrix3l make_transformation_matrix_to_super(const Lattice &tiling_unit, const Lattice &superlattice, double tol)
INDEX_TYPE Index
For long integer indexing:
Matrix< long int, 3, 3 > Matrix3l