bool _canonical_compare(const Eigen::MatrixXi &H0, const Eigen::MatrixXi &H1)
Compare two integer matrices and see which one is lexicographically greatest. Returns true if H0
pointer operator->() const
Access the supercell.
SupercellIterator< UnitType > const_iterator
Eigen::MatrixXi _zip_matrix(const Eigen::VectorXi ¤t_diag, const Eigen::VectorXi ¤t_upper_tri)
Assemble a matrix diagonal and unrolled upper triangle values into a matrix.
const_iterator end() const
A const iterator to the past-the-last volume.
Eigen::Matrix3i enforce_min_volume(const UnitType &unit, const Eigen::Matrix3i &T, const SymGroup &point_grp, Index volume, bool fix_shape=false)
Return a transformation matrix that ensures a supercell of at least some volume.
Lattice make_supercell(const Lattice &lat, const Eigen::Matrix3i &transf_mat)
Returns a super Lattice.
Eigen::MatrixXi _expand_dims_old(const Eigen::MatrixXi &hermit_mat, const Eigen::VectorXi &active_dims)
Expand a n x n Hermite normal matrix into a m x m one (e.g. for 2D supercells)
A fake container of supercell matrices.
void jump_to_determinant(value_type new_det)
Reset the diagonal to the specified determinant and set the other elements to zero.
const int m_end_volume
The past-the-last volume supercells to be iterated over (what cend uses)
const UnitType m_unit
The unit cell of the supercells.
Eigen::Matrix3i enforce_min_volume< Lattice >(const Lattice &unit, const Eigen::Matrix3i &T, const SymGroup &point_grp, Index volume, bool fix_shape)
Index dim() const
Get the dimensions of *this.
Eigen::MatrixXi operator()() const
Get the current matrix the counter is on.
const_iterator cend() const
A const iterator to the past-the-last volume.
Eigen::Matrix3i matrix() const
constructed supercell matrix
SymGroup is a collection of symmetry operations that satisfy the group property The symmetry operatio...
void _update_super()
Update m_super when required.
UnitType m_super
A supercell, stored here so that iterator dereferencing will be OK. Only used when requested...
size_type begin_volume() const
ScelEnumProps(size_type begin_volume, size_type end_volume, std::string dirs="abc", Eigen::Matrix3i generating_matrix=Eigen::Matrix3i::Identity())
Constructor.
const_iterator begin() const
A const iterator to the beginning volume, specify here how the iterator should jump through the enume...
cloneable_ptr< T > make_cloneable(Args &&...args)
make a cloneable_ptr via T(Args... args)
Eigen::VectorXi _canonical_unroll(const Eigen::MatrixXi &hermit_mat)
Unroll a Hermit normal form square matrix into a vector such that it's canonical form is easy to comp...
ScelEnumProps make_scel_enum_props(PrimClex &primclex, const jsonParser &input)
Make a ScelEnumProps object from JSON input.
const int m_begin_volume
The first volume supercells to be iterated over (what cbegin uses)
SymGroup m_point_group
The point group of the unit cell.
EigenIndex Index
For long integer indexing:
HermiteCounter & operator++()
Jump to the next available HNF matrix.
size_type end_volume() const
Eigen::Matrix3i generating_matrix() const
const_iterator cbegin() const
A const iterator to the beginning volume.
Iterator find(Iterator begin, Iterator end, const T &value, BinaryCompare q)
Equivalent to std::find(begin, end, value), but with custom comparison.
PrimClex is the top-level data structure for a CASM project.
size_type begin_volume() const
Get the beginning volume.
HermiteCounter(int init_determinant, int init_dim)
constructor to satisfy iterator requirements. Do not recommend.
HermiteCounter::value_type volume() const
current volume
void _increment()
Postfix increment operator. Increment to next unique supercell.
void _try_increment()
Check if the current supercell matrix hermite normal form is in a canonical form. ...
std::vector< Eigen::Matrix3i > m_canon_hist
Keep track of the HNF matrices for the current determinant value.
EigenVectorXiCounter m_upper_tri
unrolled vector of the upper triangle (does not include diagonal elements)
Non-std smart pointer classes and functions.
void reset_current()
reset the counter to the first iteration of the current determinant
const Lattice & lattice() const
Access the unit lattice.
notstd::cloneable_ptr< HermiteCounter > m_current
Current supercell matrix in HermitCounter form.
SupercellIterator< UnitType > & operator++()
Prefix increment operator. Increment to next unique supercell.
Iterators used with SupercellEnumerator.
const SymGroup & point_group() const
Access the unit point group.
void next_determinant()
Skip the remaining iterations and start at the next determinant value.
Eigen::VectorXi m_diagonal
Vector holding diagonal element values.
void begin_volume(size_type _begin_volume)
Set the beginning volume.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::forward_iterator_tag iterator_category
fixes alignment of m_deformation
bool operator==(const SupercellIterator< UnitType > &B) const
Iterator comparison.
Eigen::Matrix3i m_gen_mat
const int m_dims
The number of lattice directions the enumeration is being done in.
int dimension() const
Get the dimensions of the enumerator (1D, 2D or 3D)
HermiteCounter::Index upper_size(HermiteCounter::Index init_dim)
Determine the number of elements in the upper triangular matrix (excluding diagonal) ...
void error(const std::string &what)
double volume(const Lattice &lat)
Returns the volume of a Lattice.
A 'cloneable_ptr' can be used in place of 'unique_ptr'.
const UnitType & reference
const UnitType & unit() const
Access the unit the is being made into supercells.
const_iterator citerator(size_type volume) const
A const iterator to a specified volume.
HermiteCounter::Index next_spill_position(Eigen::VectorXi &diag, HermiteCounter::Index position)
Spill the next factor of the specified element with its neighbor, and return new position.
EigenVectorXiCounter _upper_tri_counter(const Eigen::VectorXi ¤t_diag)
Create a counter for the elements above the diagonal based on the current diagonal value...
bool m_super_updated
Indicates if m_super reflects the current m_current supercell matrix.
Eigen::VectorXi::Scalar value_type
const SupercellEnumerator< UnitType > & enumerator() const
const reference to the SupercellEnumerator this is iterating with
const Eigen::Matrix3i m_gen_mat
This matrix (G) specifies new lattice vectors to enumerate over column-wise, such that the resulting ...
Eigen::MatrixXi current() const
Get the current matrix the counter is on.
SupercellEnumerator(UnitType unit, const ScelEnumProps &enum_props, double tol)
Construct a SupercellEnumerator.
Eigen::Matrix3i make_unit_cell(PrimClex &primclex, const jsonParser &json)
Read unit cell transformation matrix from JSON input.