11#include <LatticeModule.h>
25 const typename CSL<dim>::LatticeType &
A,
26 const typename CSL<dim>::LatticeType &
B,
55 MatrixInt
M(MatrixInt::Identity());
56 MatrixInt
N(MatrixInt::Identity());
57 for (
int i = 0;
i <
dim; ++
i)
59 const IntValueType &dii = sd.matrixD()(
i,
i);
60 M(
i,
i) = dii / rm.gcd(rm.sigma, dii);
61 N(
i,
i) = rm.sigma / rm.gcd(rm.sigma, dii);
64 const MatrixDimD C1 =
A.latticeBasis * (sd.matrixX() *
M).template cast<double>();
65 const MatrixDimD C2 =
B.latticeBasis * (sd.matrixV() *
N).template cast<double>();
66 assert((
C1 -
C2).norm() < FLT_EPSILON &&
"CSL calculation failed.");
74 return 0.5 * (
C1 +
C2);
83 const typename CSL<dim>::LatticeType& B_in,
84 const bool& useRLLL) :
86 ,
Lattice<dim>(getLatticeBasis(*this,A_in,B_in,useRLLL),MatrixDimD::Identity())
92 const MatrixDimD tempA(A_in.
reciprocalBasis.transpose() * this->latticeBasis);
93 assert((tempA - tempA.array().round().matrix()).norm() < FLT_EPSILON &&
"CSL is not a multiple of A");
95 const MatrixDimD tempB(B_in.
reciprocalBasis.transpose() * this->latticeBasis);
96 assert((tempB - tempB.array().round().matrix()).norm() < FLT_EPSILON &&
"CSL is not a multiple of B");
CSL(const LatticeType &A_in, const LatticeType &B_in, const bool &useRLLL=true)
Lattice(const MatrixDimD &A, const MatrixDimD &Q)
const MatrixDimD reciprocalBasis
const MatrixType & reducedBasis() const
initial point of the source segment B
function infiniteDisplacement syms Ax Ay Az Bx By Bz qx qy qz u L x y z real A
LatticeTransitionMatrix(const LatticeType &A_in, const LatticeType &B_in)