Hugintrunk
0.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
hugin_base
hugin_math
hugin_math.cpp
Go to the documentation of this file.
1
// -*- c-basic-offset: 4 -*-
23
#include "
hugin_math.h
"
24
#include "
hugin_utils/utils.h
"
25
27
namespace
hugin_utils
28
{
29
int
_gcd
(
int
a,
int
b)
30
{
31
// calculate greated common divisor using Euclidean algorithm
32
return
b == 0 ? a :
_gcd
(b, a % b);
33
}
34
35
int
gcd
(
int
a,
int
b)
36
{
37
// enforce that both arguments are positive
38
return
_gcd
(abs(a), abs(b));
39
}
40
41
}
// namespace
hugin_utils::_gcd
int _gcd(int a, int b)
Definition:
hugin_math.cpp:29
hugin_utils::gcd
int gcd(int a, int b)
function to calculate greated common divisor using Euclidean algorithm both arguments should be >=0 ...
Definition:
hugin_math.cpp:35
utils.h
hugin_math.h
misc math function & classes used by other parts of the program
Generated on Sun Nov 10 2024 01:25:43 for Hugintrunk by
1.8.5