BinaryFunctor that computes the algebraic quotient i of a/b with any non zero fractional part discarded (truncation toward zero), and that returns i+1 (resp. i-1) if a is negative (resp. positive) if b divides a. Since we assume that a is not equal to 0, we have \( |i| < |a/b| \). See also LargeTruncationFunctor.
More...
#include <DGtal/geometry/curves/ArithmeticalDSSConvexHull.h>
template<typename
Integer>
struct DGtal::functors::StrictTruncationFunctor< Integer >
BinaryFunctor that computes the algebraic quotient i of a/b with any non zero fractional part discarded (truncation toward zero), and that returns i+1 (resp. i-1) if a is negative (resp. positive) if b divides a. Since we assume that a is not equal to 0, we have \( |i| < |a/b| \). See also LargeTruncationFunctor.
- Template Parameters
-
Integer | a model of integer used to store a and b |
Definition at line 130 of file ArithmeticalDSSConvexHull.h.
◆ operator()()
- Returns
- quotient i defined above
- Parameters
-
- Precondition
- a is not null
- Parameters
-
- Precondition
- b is not null
Definition at line 142 of file ArithmeticalDSSConvexHull.h.
143 {
144 ASSERT( a != NumberTraits<Integer>::ZERO );
145 ASSERT( b != NumberTraits<Integer>::ZERO );
146
148 if (a == i*b)
149 {
150 if (i >= NumberTraits<Integer>::ZERO)
151 --i;
152 else
153 ++i;
154 }
155 return i;
156 }
Point::Coordinate Integer
The documentation for this struct was generated from the following file: