oILAB
Loading...
Searching...
No Matches
LatticeCore.h
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_LatticeCore_h_
8#define gbLAB_LatticeCore_h_
9
10#include <iostream>
11#include <cfloat> // FLT_EPSILON
12#include <Eigen/Dense>
13#include "../Math/IntegerMath.h"
14
15namespace oILAB {
16template <int dim> struct LatticeCore {
17 static_assert(dim > 0, "dim must be > 0.");
18 static constexpr double roundTol = FLT_EPSILON;
19
20 typedef Eigen::Matrix<double, dim, 1> VectorDimD;
21 typedef Eigen::Matrix<double, dim, dim> MatrixDimD;
22 typedef long long int IntScalarType;
23 typedef Eigen::Matrix<IntScalarType, dim, 1> VectorDimI;
24 typedef Eigen::Matrix<IntScalarType, dim, dim> MatrixDimI;
25
32
41 const MatrixDimD &invA);
42 };
43 } // namespace oILAB
44#endif
Eigen::Matrix< IntScalarType, dim, 1 > VectorDimI
Definition LatticeCore.h:23
static constexpr double roundTol
Definition LatticeCore.h:18
long long int IntScalarType
Definition LatticeCore.h:22
Eigen::Matrix< IntScalarType, dim, dim > MatrixDimI
Definition LatticeCore.h:24
Eigen::Matrix< double, dim, 1 > VectorDimD
Definition LatticeCore.h:20
static VectorDimI rationalApproximation(VectorDimD v)
Approximates a direction in terms of integer coordinates.
Eigen::Matrix< double, dim, dim > MatrixDimD
Definition LatticeCore.h:21
static VectorDimI integerCoordinates(const VectorDimD &d, const MatrixDimD &invA)
Returns the integer coordinates of a vector with respect to a lattices with structure matrix .