Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
Lattices/RationalMatrix.h
Go to the documentation of this file.
1/* This file is part of PIL, the Particle Interaction Library.
2 *
3 *
4 * MODEL is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_RationalMatrix_h_
9#define model_RationalMatrix_h_
10
11#include <iomanip>
12#include <cfloat> // FLT_EPSILON
13#include <assert.h> // FLT_EPSILON
14#include <utility>
15#include <Eigen/Dense>
16//#include <RoundEigen.h>
18#include <iostream>
19
20namespace model
21{
22
23 template <int dim>
25 {
26 static_assert(dim>0,"dim must be > 0.");
27 typedef long long int IntValueType;
28 typedef Eigen::Matrix<double,dim,dim> MatrixDimD;
29 typedef Eigen::Matrix<int,dim,dim> MatrixDimI;
30 typedef Eigen::Matrix<IntValueType,dim,dim> MatrixInt;
31
32 static constexpr int64_t maxDen=100000;
33
34 /**********************************************************************/
35 static IntValueType gcd(const IntValueType& a,const IntValueType& b);
36
37 /**********************************************************************/
38 static IntValueType lcm(const IntValueType& a,const IntValueType& b);
39
40 /**********************************************************************/
41 static std::pair<MatrixInt,IntValueType> compute(const MatrixDimD& R);
42
43 const std::pair<MatrixInt,IntValueType> returnPair;
44
45 public:
46
47 const MatrixInt& integerMatrix;
48 const IntValueType& sigma;
49
50 /**********************************************************************/
51 RationalMatrix(const MatrixDimD& R) ;
52 };
53
54
55} // end namespace
56#endif
57
58
RationalMatrix(const MatrixDimD &R)
a
Definition int_R.m:14
b
Definition int_R.m:16