31#if defined(IntegerComputer_RECURSES)
32#error Recursive header files inclusion detected in IntegerComputer.h
35#define IntegerComputer_RECURSES
37#if !defined IntegerComputer_h
39#define IntegerComputer_h
44#include "DGtal/base/Common.h"
45#include "DGtal/kernel/NumberTraits.h"
46#include "DGtal/kernel/CUnsignedNumber.h"
47#include "DGtal/kernel/CIntegralNumber.h"
48#include "DGtal/kernel/CInteger.h"
49#include "DGtal/kernel/SpaceND.h"
81 template <
typename TInteger>
316 template <
typename OutputIterator>
331 unsigned int k )
const;
454 bool compute_v =
true )
const;
551 template <
typename TInteger>
560#include "DGtal/arithmetic/IntegerComputer.ih"
567#undef IntegerComputer_RECURSES
Aim: This class gathers several types and methods to make computation with integers.
Integer getCFrac(std::vector< Integer > "ients, IntegerParamType a, IntegerParamType b) const
SpaceND< 3, Integer >::Vector Vector3I
void reduce(Vector3I &p) const
static Integer staticGcd(IntegerParamType a, IntegerParamType b)
void getGcd(Integer &g, IntegerParamType a, IntegerParamType b) const
static Integer max(IntegerParamType a, IntegerParamType b, IntegerParamType c)
NumberTraits< TInteger >::SignedVersion Integer
Integer crossProduct(const Vector2I &u, const Vector2I &v) const
static bool isPositiveOrZero(IntegerParamType a)
Integer getCFrac(OutputIterator outIt, IntegerParamType a, IntegerParamType b) const
IntegerComputer< TInteger > Self
static bool isZero(IntegerParamType a)
static Integer min(IntegerParamType a, IntegerParamType b, IntegerParamType c)
static Integer abs(IntegerParamType a)
std::vector< Integer > _m_bezout[4]
Integer ceilDiv(IntegerParamType na, IntegerParamType nb) const
NumberTraits< TInteger >::UnsignedVersion UnsignedInteger
void reduce(Vector2I &p) const
SpaceND< 2, Integer >::Vector Vector2I
static bool isNegativeOrZero(IntegerParamType a)
Integer dotProduct(const Vector2I &u, const Vector2I &v) const
SpaceND< 2, Integer >::Point Point2I
static bool isNotZero(IntegerParamType a)
BOOST_CONCEPT_ASSERT((concepts::CInteger< Integer >))
void getDotProduct(Integer &dp, const Vector2I &u, const Vector2I &v) const
Point2I convergent(const std::vector< Integer > "ients, unsigned int k) const
Vector2I extendedEuclid(IntegerParamType a, IntegerParamType b, IntegerParamType c) const
void getCrossProduct(Integer &cp, const Vector2I &u, const Vector2I &v) const
static Integer min(IntegerParamType a, IntegerParamType b)
void getCoefficientIntersection(Integer &fl, Integer &ce, const Vector2I &p, const Vector2I &u, const Vector2I &N, IntegerParamType c) const
void selfDisplay(std::ostream &out) const
NumberTraits< UnsignedInteger >::ParamType UnsignedIntegerParamType
NumberTraits< Integer >::ParamType IntegerParamType
void getDotProduct(Integer &dp, const Vector3I &u, const Vector3I &v) const
void getValidBezout(Vector2I &v, const Point2I &A, const Vector2I &u, const Vector2I &N, IntegerParamType c, const Vector2I &N2, IntegerParamType c2, bool compute_v=true) const
static bool isPositive(IntegerParamType a)
void getFloorCeilDiv(Integer &fl, Integer &ce, IntegerParamType na, IntegerParamType nb) const
IntegerComputer(const Self &other)
void getEuclideanDiv(Integer &q, Integer &r, IntegerParamType a, IntegerParamType b) const
static bool isNegative(IntegerParamType a)
BOOST_CONCEPT_ASSERT((concepts::CIntegralNumber< UnsignedInteger >))
Integer dotProduct(const Vector3I &u, const Vector3I &v) const
Integer gcd(IntegerParamType a, IntegerParamType b) const
SpaceND< 3, Integer >::Point Point3I
static Integer max(IntegerParamType a, IntegerParamType b)
Integer floorDiv(IntegerParamType na, IntegerParamType nb) const
BOOST_CONCEPT_ASSERT((concepts::CUnsignedNumber< UnsignedInteger >))
Self & operator=(const Self &other)
PointVector< dim, Integer > Point
Points in DGtal::SpaceND.
PointVector< dim, Integer > Vector
Vectors in DGtal::SpaceND.
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
boost::call_traits< T >::param_type ParamType
Aim: Concept checking for Integer Numbers. More precisely, this concept is a refinement of both CEucl...
Aim: Concept checking for Integral Numbers. Models of this concept should be listed in NumberTraits c...
Aim: Concept checking for Unsigned numbers. Models of this concept should be listed in NumberTraits c...