1 #ifndef UNITCELLCOORD_HH
2 #define UNITCELLCOORD_HH
6 #include "casm/external/Eigen/Dense"
33 template<
typename OtherDerived>
34 UnitCell(
const Eigen::MatrixBase<OtherDerived> &other) :
38 template<
typename OtherDerived>
40 this->Eigen::Vector3l::operator=(other);
62 template<
typename CoordType,
typename StrucType>
90 return sout << site.
sublat() <<
", " << site.
unitcell().transpose();
94 inline UnitCellCoord
operator+(UnitCell frac, UnitCellCoord site);
97 inline UnitCellCoord
operator+(UnitCellCoord site, UnitCell frac);
100 inline UnitCellCoord
operator-(UnitCellCoord site, UnitCell frac);
103 inline bool operator<(
const UnitCellCoord &A,
const UnitCellCoord &B);
106 inline bool operator>(
const UnitCellCoord &A,
const UnitCellCoord &B);
109 inline bool operator<=(
const UnitCellCoord &A,
const UnitCellCoord &B);
112 inline bool operator>=(
const UnitCellCoord &A,
const UnitCellCoord &B);
115 inline bool operator==(
const UnitCellCoord &A,
const UnitCellCoord &B);
118 inline bool operator!=(
const UnitCellCoord &A,
const UnitCellCoord &B);
121 jsonParser &
to_json(
const UnitCellCoord &ucc_val, jsonParser &fill_json);
124 void from_json(UnitCellCoord &fill_value,
const jsonParser &read_json);
130 m_unitcell(_unitcell),
138 template<
typename CoordType,
typename StrucType>
140 for(
Index b = 0; b < struc.basis.size(); ++b) {
143 if(struc.basis[b].compare(coord, tol)) {
149 throw std::runtime_error(
150 "Error in 'UnitCellCoord(CoordType coord, const StrucType& struc, double tol)'\n"
151 " No matching basis site found.");
219 for(
Index i = 0; i < 3; i++) {
277 fill_value.
unitcell()(0) = read_json[1].get<Index>();
278 fill_value.
unitcell()(1) = read_json[2].get<Index>();
279 fill_value.
unitcell()(2) = read_json[3].get<Index>();
void from_json(ClexDescription &desc, const jsonParser &json)
Matrix< long int, 3, 1 > Vector3l
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
UnitCellCoord & operator+=(UnitCell frac)
bool operator>(const UnitCellCoord &A, const UnitCellCoord &B)
Compare UnitCellCoord.
bool operator<(const ClexDescription &A, const ClexDescription &B)
Compare using name strings: A.name < B.name.
bool operator<=(const UnitCellCoord &A, const UnitCellCoord &B)
Compare UnitCellCoord.
Index & operator[](Index i)
UnitCell(const Eigen::MatrixBase< OtherDerived > &other)
bool operator>=(const UnitCellCoord &A, const UnitCellCoord &B)
Compare UnitCellCoord.
GenericCluster< CoordType > operator+(const GenericCluster< CoordType > &LHS, const Coordinate &RHS)
create translated cluster
T get(Args...args) const
Get data from json, using one of several alternatives.
bool operator!=(const UnitCellCoord &A, const UnitCellCoord &B)
Compare UnitCellCoord.
GenericCluster< CoordType > operator-(const GenericCluster< CoordType > &LHS, const Coordinate &RHS)
create translated cluster
std::ostream & operator<<(std::ostream &_stream, const FormattedPrintable &_formatted)
bool operator==(const UnitCellCoord &A, const UnitCellCoord &B)
Compare UnitCellCoord.
UnitCell(Index a, Index b, Index c)
EigenIndex Index
For long integer indexing:
UnitCellCoord & operator-=(UnitCell frac)
Eigen::CwiseUnaryOp< decltype(std::ptr_fun(boost::math::lround< typename Derived::Scalar >)), const Derived > lround(const Eigen::MatrixBase< Derived > &val)
Round Eigen::MatrixXd to Eigen::MatrixXl.
UnitCell & operator=(const Eigen::MatrixBase< OtherDerived > &other)
jsonParser & push_back(const T &value)
Puts new valued element at end of array of any type T for which 'jsonParser& to_json( const T &value...
jsonParser & put_array()
Puts new empty JSON array.