BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
anonymous_namespace{ILatticeOrientation.cpp} Namespace Reference

Functions

bool ValidMillerIndex (MillerIndex index)
 
bool ParallelMillerIndices (MillerIndex index1, MillerIndex index2)
 
double SignForCrossProduct (MillerIndexOrientation::QComponent q1, MillerIndexOrientation::QComponent q2)
 
MillerIndexOrientation::QComponent ThirdQComponent (MillerIndexOrientation::QComponent q1, MillerIndexOrientation::QComponent q2)
 
void FillVectorInRow (Eigen::Matrix3d &matrix, kvector_t vec, MillerIndexOrientation::QComponent row)
 

Function Documentation

◆ ValidMillerIndex()

bool anonymous_namespace{ILatticeOrientation.cpp}::ValidMillerIndex ( MillerIndex  index)

Definition at line 87 of file ILatticeOrientation.cpp.

88 {
89  return (index.h != 0.0 || index.k != 0.0 || index.l != 0.0);
90 }

References MillerIndex::h, MillerIndex::k, and MillerIndex::l.

Referenced by MillerIndexOrientation::checkAlignment().

◆ ParallelMillerIndices()

bool anonymous_namespace{ILatticeOrientation.cpp}::ParallelMillerIndices ( MillerIndex  index1,
MillerIndex  index2 
)

Definition at line 91 of file ILatticeOrientation.cpp.

92 {
93  double ratio = 0.0;
94  if (index2.h != 0.0) {
95  ratio = index1.h / index2.h;
96  } else if (index2.k != 0.0) {
97  ratio = index1.k / index2.k;
98  } else if (index2.l != 0.0) {
99  ratio = index1.l / index2.l;
100  }
101  if (ratio == 0.0)
102  return false;
103  return (index1.h == ratio * index2.h && index1.k == ratio * index2.k
104  && index1.l == ratio * index2.l);
105 }

References MillerIndex::h, MillerIndex::k, and MillerIndex::l.

Referenced by MillerIndexOrientation::checkAlignment().

◆ SignForCrossProduct()

◆ ThirdQComponent()

◆ FillVectorInRow()

void anonymous_namespace{ILatticeOrientation.cpp}::FillVectorInRow ( Eigen::Matrix3d &  matrix,
kvector_t  vec,
MillerIndexOrientation::QComponent  row 
)

Definition at line 124 of file ILatticeOrientation.cpp.

125 {
126  int i = row == MillerIndexOrientation::QX ? 0 : row == MillerIndexOrientation::QY ? 1 : 2;
127  for (int j = 0; j < 3; ++j)
128  mat(i, j) = vec[j];
129 }

References MillerIndexOrientation::QX, and MillerIndexOrientation::QY.

Referenced by MillerIndexOrientation::transformationMatrix().