17 namespace Coordinate_impl {
61 const vector_type &
frac()
const {
74 const double &
frac(size_type index)
const {
87 const vector_type &
cart()
const {
100 const double &
cart(size_type index)
const {
121 return !(*
this == RHS);
196 assert(
m_home &&
"Coordinate doesn't have valid home lattice");
202 void print(std::ostream &stream,
COORD_TYPE mode,
char term = 0,
int prec = 7,
int pad = 5)
const;
203 void print(std::ostream &stream,
char term = 0,
int prec = 7,
int pad = 5)
const;
237 double min_dist2(
const Coordinate &neighbor,
const Eigen::Ref<const Eigen::Matrix3d> &metric)
const;
260 void _set_frac(
const Eigen::Ref<const vector_type> &f) {
272 void _set_cart(
const Eigen::Ref<const vector_type> &c) {
319 namespace Coordinate_impl {
373 operator const Eigen::MatrixBase<Eigen::Vector3d> &()
const {
377 operator const Eigen::Vector3d &()
const {
381 operator Eigen::Ref<const Eigen::Vector3d> ()
const {
440 operator const double &()
const {
500 operator const Eigen::MatrixBase<Eigen::Vector3d> &()
const {
504 operator const Eigen::Vector3d &()
const {
508 operator Eigen::Ref<const Eigen::Vector3d> ()
const {
567 operator const double &()
const {
607 struct is_floating_point<
CASM::Coordinate_impl::FracCoordinateComponent> {
608 static const bool value =
true;
612 struct is_floating_point<
CASM::Coordinate_impl::CartCoordinateComponent> {
613 static const bool value =
true;
FracCoordinate & operator+=(const Eigen::Ref< const Coordinate::vector_type > &vec)
A class to enable assignment to a component of the Cartesian vector of a Coordinate.
Coordinate & operator-=(const Coordinate &RHS)
Negative translation of this coordinate by RHS.cart()
const vector_type & frac() const
const Access the fractional coordinate vector
Eigen::MatrixXd pad(const Eigen::MatrixXd &M, int n)
Construct a matrix consisting of blocks M and Identity(n,n)
FracCoordinateComponent & operator/=(double val)
jsonParser & to_json(jsonParser &json) const
CartCoordinate & operator*=(double val)
const double & const_cart(size_type index) const
const Access a component of the Cartesian coordinate vector
void set_basis_ind(Index _basis_ind)
Set basis Index.
bool voronoi_within()
Map coordinate into the voronoi cell using a lattice translation.
FracCoordinate & operator*=(double val)
void from_json(ClexDescription &desc, const jsonParser &json)
Coordinate_impl::CartCoordinate cart()
Set Cartesian coordinate vector and update fractional coordinate vector.
bool is_lattice_shift(double tol=TOL) const
Checks to see if coordinate is at a lattice translation with respect to the origin.
Coordinate operator-() const
unary minus of this coordinate
const double & frac(size_type index) const
const Access a component of the fractional coordinate vector
FracCoordinate & operator=(const Eigen::Ref< const Coordinate::vector_type > &vec)
CartCoordinateComponent & operator/=(double val)
jsonParser & to_json(const ClexDescription &desc, jsonParser &json)
CartCoordinate & operator=(const CartCoordinate &RHS)
double dist(const Coordinate &neighbor) const
distance (in Angstr) of neighbor from *this
CartCoordinate & operator+=(const Eigen::Ref< const Coordinate::vector_type > &vec)
FracCoordinate & operator=(const FracCoordinate &RHS)
FracCoordinateComponent & operator-=(double val)
Coordinate & apply_sym(const SymOp &op)
Transform coordinate by symmetry operation (including translation)
CartCoordinate & operator/=(double val)
const Eigen::Matrix3d & lat_column_mat() const
3x3 matrix with lattice vectors as its columne
void from_json(const jsonParser &json)
const vector_type & const_cart() const
user override to force const Access the Cartesian coordinate vector
FracCoordinateComponent & operator+=(double val)
GenericCluster< CoordType > operator+(const GenericCluster< CoordType > &LHS, const Coordinate &RHS)
create translated cluster
const double & const_frac(size_type index) const
user override to force const Access the fractional coordinate vector
const vector_type & const_frac() const
user override to force const Access the fractional coordinate vector
GenericCluster< CoordType > operator-(const GenericCluster< CoordType > &LHS, const Coordinate &RHS)
create translated cluster
static Coordinate origin(const Lattice &_home)
construct a coordinate describing origin of _home lattice
void _set_cart(size_type ind, double val)
CartCoordinateComponent & operator+=(double val)
CartCoordinate & operator-=(const Eigen::Ref< const Coordinate::vector_type > &vec)
FracCoordinateComponent & operator=(double val)
int voronoi_number() const
const Eigen::Matrix3d & inv_lat_column_mat() const
Inverse of Lattice::lat_column_mat() It is the transformation matrix 'C2F', such that f = C2F * c whe...
A class to enable assignment to a component of the fractional vector of a Coordinate.
CartCoordinateComponent & operator=(const CartCoordinateComponent &RHS)
bool operator==(const Coordinate &RHS) const
double min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
void _set_frac(const Eigen::Ref< const vector_type > &f)
SymOp is the Coordinate representation of a symmetry operation it keeps fraction (FRAC) and Cartesian...
BasisSet operator*(const SymOp &LHS, const BasisSet &RHS)
Represents cartesian and fractional coordinates.
Coordinate & apply_sym_no_trans(const SymOp &op)
Transform coordinate by symmetry operation (without translation)
EigenIndex Index
For long integer indexing:
FracCoordinate(Coordinate &coord)
A class to enable vector assignment to the Cartesian vector of a Coordinate.
FracCoordinateComponent(Coordinate &coord, Coordinate::size_type index)
void print(std::ostream &stream, COORD_TYPE mode, char term=0, int prec=7, int pad=5) const
Eigen::Vector3d vector_type
CartCoordinateComponent(Coordinate &coord, Coordinate::size_type index)
Coordinate & operator+=(const Coordinate &RHS)
Positive translation of this coordinate by RHS.cart()
double robust_min_dist(const Coordinate &neighbor) const
Returns distance (in Angstr) to nearest periodic image of neighbor.
FracCoordinateComponent & operator*=(double val)
bool is_within() const
Checks to see if coordinate is in the unit cell, but does not translate it.
void read(std::istream &stream, COORD_TYPE mode)
void set_lattice(const Lattice &new_lat, COORD_TYPE mode)
Change the home lattice of the coordinate, selecting one representation (either CART or FRAC) that re...
void _set_cart(const Eigen::Ref< const vector_type > &c)
FracCoordinate & operator-=(const Eigen::Ref< const Coordinate::vector_type > &vec)
bool operator!=(const Coordinate &RHS) const
CartCoordinateComponent & operator=(double val)
CartCoordinateComponent & operator-=(double val)
bool compare_type(const Coordinate &RHS) const
Return true – Exists to allow duck-typing with Site.
vector_type::Index size_type
bool compare(const Coordinate &RHS, double tol=TOL) const
Returns true if this->min_dist(RHS)
const double & cart(size_type index) const
const Access a component of the Cartesian coordinate vector
CartCoordinate(Coordinate &coord)
Index basis_ind() const
Access basis Index.
bool almost_equal(const Coordinate &RHS, double tol) const
const vector_type & cart() const
const Access the Cartesian coordinate vector
FracCoordinateComponent & operator=(const FracCoordinateComponent &RHS)
A class to enable vector assignment to the fractional vector of a Coordinate.
Coordinate_impl::FracCoordinate frac()
Set the fractional coordinate vector.
void print_axis(std::ostream &stream, COORD_TYPE mode, char term=0, int prec=7, int pad=5) const
Print normalized vector.
const Lattice & home() const
Access the home lattice of the coordinate.
FracCoordinate & operator/=(double val)
Coordinate::size_type m_index
double min_dist2(const Coordinate &neighbor, const Eigen::Ref< const Eigen::Matrix3d > &metric) const
Finds same shift as min_dist but returns shift(CART).transpose()*metric*shift(CART) ...
Coordinate::size_type m_index
Coordinate(const Lattice &_home)
Minimal constructor only takes a lattice.
CartCoordinateComponent & operator*=(double val)
void _set_frac(size_type ind, double val)
CartCoordinate & operator=(const Eigen::Ref< const Coordinate::vector_type > &vec)