7#ifndef gbLAB_RationalLatticeDirection_cpp_
8#define gbLAB_RationalLatticeDirection_cpp_
10#include "../../include/Lattices/RationalLatticeDirection.h"
11#include "../../include/Lattices/LatticeModule.h"
41 return dir.cartesian() * rat.asDouble();
48 return rat * dir.dot(other);
69 assert(&dir.lattice == &other.
dir.lattice &&
"Rational Lattice Vector Type belong to different Lattices.");
71 const VectorDimI temp(rat.n * other.
rat.d * dir.latticeVector() + other.
rat.n * rat.d * other.
dir.latticeVector());
81 assert(&dir.lattice == &other.
dir.lattice &&
"ReciprocalLatticeVectorType belong to different Lattices.");
83 const VectorDimI temp(rat.n * other.
rat.d * dir.latticeVector() - other.
rat.n * rat.d * other.
dir.latticeVector());
93 assert(&dir.lattice == &other.
lattice &&
"ReciprocalLatticeVectorType belong to different Lattices.");
102 assert(&dir.lattice == &other.
lattice &&
"ReciprocalLatticeVectorType belong to different Lattices.");
112 return dir.latticeVector().squaredNorm() * std::pow(rat.asDouble(), 2);
121 template struct RationalLatticeDirection<1>;
const Lattice< dim > & lattice
OperatorSum< E1, E2, dim > operator+(const Operator< E1, dim > &u, const Operator< E2, dim > &v)
LatticeVector< dim > operator*(const typename LatticeVector< dim >::IntScalarType &scalar, const LatticeVector< dim > &L)
double squaredNorm() const
Rational< IntScalarType > dot(const ReciprocalLatticeVector< dim > &other) const
const Rational< IntScalarType > rat
RationalLatticeDirection< dim > operator+(const RationalLatticeDirection< dim > &other) const
LatticeCore< dim >::IntScalarType IntScalarType
RationalLatticeDirection(const Rational< IntScalarType > &_rat, const LatticeDirection< dim > &_dir)
RationalLatticeDirection< dim > operator-(const RationalLatticeDirection< dim > &other) const
LatticeCore< dim >::VectorDimD VectorDimD
VectorDimD cartesian() const
RationalLatticeDirection< dim > operator*(const IntScalarType &scalar) const
LatticeCore< dim >::VectorDimI VectorDimI
RationalLatticeDirection< dim > operator/(const IntScalarType &scalar) const
const LatticeDirection< dim > dir