oILAB
Loading...
Searching...
No Matches
RationalReciprocalLatticeDirection.cpp
Go to the documentation of this file.
1/* This file is part of gbLAB.
2 *
3 * gbLAB is distributed without any warranty under the MIT License.
4 */
5
6
7#ifndef gbLAB_RationalReciprocalLatticeDirection_cpp_
8#define gbLAB_RationalReciprocalLatticeDirection_cpp_
9
10#include <LatticeModule.h>
12
13namespace gbLAB
14{
15 /**********************************************************************/
16 template <int dim>
18 /* init */,
19 dir(_dir)
20 {
21 }
22
23 /**********************************************************************/
24 template <int dim>
29
30 /**********************************************************************/
31 template <int dim>
37
38 /**********************************************************************/
39
40 template <int dim>
42 {
43 return dir.cartesian() * rat.asDouble();
44 }
45
46 /**********************************************************************/
47 template <int dim>
52
53 /**********************************************************************/
54 template <int dim>
59
60 /**********************************************************************/
61 template <int dim>
66
67 /**********************************************************************/
68 template <int dim>
70 {
71 assert(&dir.lattice == &other.dir.lattice && "Rational Lattice Vector Type belong to different Lattices.");
72 const VectorDimI temp(rat.n * other.rat.d * dir.reciprocalLatticeVector() + other.rat.n * rat.d * other.dir.reciprocalLatticeVector());
74 const ReciprocalLatticeVector<dim> v((temp / gcd).eval(), dir.lattice);
76 }
77
78 /**********************************************************************/
79 template <int dim>
81 {
82 assert(&dir.lattice == &other.dir.lattice && "ReciprocalLatticeVectorType belong to different Lattices.");
83 const VectorDimI temp(rat.n * other.rat.d * dir.reciprocalLatticeVector() - other.rat.n * rat.d * other.dir.reciprocalLatticeVector());
85 const ReciprocalLatticeVector<dim> v((temp / gcd).eval(), dir.lattice);
87 }
88
89 /**********************************************************************/
90 template <int dim>
92 {
93 assert(&dir.lattice == &other.lattice && "ReciprocalLatticeVectorType belong to different Lattices.");
96 }
97
98 /**********************************************************************/
99 template <int dim>
101 {
102 assert(&dir.lattice == &other.lattice && "ReciprocalLatticeVectorType belong to different Lattices.");
105 }
106
107 /**********************************************************************/
108 template <int dim>
110 {
111 return dir.reciprocalLatticeVector().squaredNorm() * std::pow(rat.asDouble(), 2);
112 }
113
114 template<int dim>
119
120 template struct RationalReciprocalLatticeDirection<1>;
130
131} // end namespace
132#endif
LatticeVector class.
IntScalarType dot(const ReciprocalLatticeVector< dim > &other) const
OperatorSum< E1, E2, dim > operator+(const Operator< E1, dim > &u, const Operator< E2, dim > &v)
Definition Operator.h:65
LatticeVector< dim > operator*(const typename LatticeVector< dim >::IntScalarType &scalar, const LatticeVector< dim > &L)
RationalReciprocalLatticeDirection< dim > operator/(const IntScalarType &scalar) const
RationalReciprocalLatticeDirection(const Rational< IntScalarType > &_rat, const ReciprocalLatticeDirection< dim > &_dir)
RationalReciprocalLatticeDirection< dim > operator*(const IntScalarType &scalar) const
Rational< IntScalarType > dot(const LatticeVector< dim > &other) const
RationalReciprocalLatticeDirection< dim > operator-(const RationalReciprocalLatticeDirection< dim > &other) const
RationalReciprocalLatticeDirection< dim > operator+(const RationalReciprocalLatticeDirection< dim > &other) const