Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
src
Lattices
LatticeGCD.cpp
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_LatticeGCD_cpp_
9
#define model_LatticeGCD_cpp_
10
11
#include <
LatticeGCD.h
>
12
#include <Eigen/Dense>
13
14
namespace
model
15
{
16
17
template
<
int
dim>
18
long
int
LatticeGCD<dim>::gcd
(
const
long
int
&
a
,
const
long
int
&
b
)
19
{
20
const
long
int
absA(abs(
a
));
21
const
long
int
absB(abs(
b
));
22
return
absB > 0 ?
gcd
(absB, absA % absB) : (absA > 0 ? absA : 1);
23
}
24
25
template
<
int
dim>
26
long
int
LatticeGCD<dim>::gcd
(
const
long
int
&
a
,
const
long
int
&
b
,
const
long
int
&
c
)
27
{
28
return
gcd
(
a
,
gcd
(
b
,
c
));
29
}
30
31
template
<
int
dim>
32
long
int
LatticeGCD<dim>::gcd
(
const
VectorDimI
&
v
)
33
{
34
return
gcd
(
v
(0),
v
(1),
v
(2));
35
}
36
37
template
struct
LatticeGCD<3>
;
38
}
// end namespace
39
#endif
LatticeGCD.h
c
c
Definition
int_R.m:15
a
a
Definition
int_R.m:14
b
b
Definition
int_R.m:16
model
Definition
DD_converter.dox:2
model::LatticeGCD
Definition
LatticeGCD.h:17
model::LatticeGCD::gcd
static long int gcd(const long int &a, const long int &b)
Definition
LatticeGCD.cpp:18
model::LatticeGCD::VectorDimI
Eigen::Matrix< long int, dim, 1 > VectorDimI
Definition
LatticeGCD.h:19
v
REAL v[4]
Definition
triangle.cpp:5345
Generated by
1.15.0