The class Fixed_precision_nt provides 24-bit numbers in fixed point representation. Basically these numbers are integers in the range with a multiplying factor . The multiplying factor has to be initialized by the user before the construction of the first Fixed_precision_nt and is common to all variables.
The interest of such a number type is that geometric predicates can be overloaded to get exact and very efficient predicates. The drawback is that any Fixed_precision_nt is rounded to the nearest multiple of , which yields to a very poor arithmetic. The idea is to not use the arithmetic on Fixed_precision_nt but only the specialized predicates.
Note: you must call CGAL::force_ieee_double_precision() in order for the Fixed_precision_nt to work properly on Intel platforms. This initializes the FPU to an IEEE compliant rounding mode which is not the default.
#include <CGAL/Fixed_precision_nt.h>
| |
Declaration.
| |
| |
Initialization of a variable. The variable is rounded to the
nearest legal fixed number (i.e. a multiple of
Fixed_precision_nt::unit_value()
| |
| |
Declaration and initialization.
| |
| |
Declaration and initialization with an integer.
|
| ||
| Assignment. | |
|
| In case of overflow or division by 0, numbers becomes invalid. If the precision is changed by usage of Fixed_precision_nt::init(), already existing numbers may become invalid if they are no longer multiple of . |
|
| Fixed_precision_nt do not implement infinite numbers. is_finite is identical to is_valid. |
The comparison operations , , , , , and are all available.
The arithmetic operators , , , , , , and are all available. The result of the computation is rounded to the nearest legal Fixed_precision_nt. Overflow is possible, and even probable in case of multiplication or division. Fixed_precision_nt are designed to use specialized predicates, not to use arithmetic.
|
| casts to double. |
|
| is an upper bound on the data, is the smallest integer such that . The result of the function is false if initialization was already done, in that case already existing Fixed_precision_nt may become invalid. |
|
| returns . |
|
| returns . |
Fixed_precision_nt implements perturbation scheme as described by Alliez, Devillers and Snoeyink [ADS98]. The perturbation mode can be activated or deactivated for different kinds of perturbations. The default mode is no perturbation.
|
| |
Activate. side_of_oriented_circle predicate of 4 cocircular points answers degenerate only if the 4 points are collinear. | ||
|
| |
Deactivate | ||
|
| |
returns current mode | ||
|
| |
Activate. side_of_oriented_sphere predicate of 5 cospherical points answers degenerate only if the 5 points are coplanar. | ||
|
| |
Deactivate | ||
|
| |
returns current mode |
Through overloading mechanisms, functions such that orientation for Point_2<Cartesian< Fixed_precision_nt> > will correctly call the function below.
|
| |||
|
| |||
Perturbation mode can be activated. | ||||
|
| |||
|
| |||
Perturbation mode can be activated. |