CASM  1.1.0
A Clusters Approach to Statistical Mechanics
SymBasisPermute.cc
Go to the documentation of this file.
2 
6 #include "casm/symmetry/SymOp.hh"
7 
8 namespace CASM {
9 
10 // ---- SymBasisPermute Definitions --------------------
11 
14  std::vector<UnitCellCoord> const &_ucc_permute)
15  : m_ucc_permute(_ucc_permute),
16  m_point_mat(lround(cart2frac(_op.matrix(), _lat))) {
17  if (!is_integer(cart2frac(_op.matrix(), _lat), _lat.tol())) {
18  throw std::runtime_error(
19  std::string("Error in 'SymBasisPermute(const SymOp& op, const "
20  "StrucType& struc, double tol)'\n") +
21  " Could not get integer point transformation matrix.");
22  }
23 }
24 
25 } // namespace CASM
SymBasisPermute(SymOp const &_op, Lattice const &_lat, std::vector< UnitCellCoord > const &_ucc_permute)
Construct SymBasisPermute.
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
Definition: SymOp.hh:28
const matrix_type & matrix() const
Const access of entire cartesian symmetry matrix.
Definition: SymOp.hh:60
double tol() const
Definition: Lattice.hh:195
Eigen::Matrix3d cart2frac(const Eigen::Ref< const Eigen::Matrix3d > &cart_mat, const Lattice &lat)
Returns 'frac_mat' which is transformation of 'cart_mat' if cart_vec_after = cart_mat*cart_vec then f...
Definition: Lattice.hh:258
Eigen::CwiseUnaryOp< decltype(Local::lround_l< typename Derived::Scalar >), const Derived > lround(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd to Eigen::MatrixXl.
bool is_integer(const Eigen::MatrixBase< Derived > &M, double tol)
Check if Eigen::Matrix is integer.
Main CASM namespace.
Definition: APICommand.hh:8