The class CGAL_Fixed_precision_nt provides 24 bits number 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 CGAL_Fixed_precision_nt.
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 CGAL_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 CGAL_Fixed_precision_nt but only the specialized predicates.
#include <CGAL/Fixed_precision_nt.h>
| |
Initialization of a variable. The variable is rounded to the
nearest legal fixed number (i.e. a multiple of
CGAL_Fixed_precision_nt::unit_value()
| |
| |
Declaration.
| |
| |
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 CGAL_Fixed_precision_nt::init(), already existing numbers may became invalid if they are non longer multiple of . | ||
|
| |
CGAL_Fixed_precision_ntdo not implement infinite numbers. CGAL_is_finite is identical to CGAL_is_valid. | ||
| ||
| rounds the result to nearest legal Fixed. | |
| ||
| rounds the result to nearest legal Fixed. | |
| ||
| rounds the result to nearest legal Fixed. Overflow is possible. | |
| ||
| rounds the result to nearest legal Fixed. | |
| ||
| rounds the result to nearest legal Fixed. | |
| ||
| rounds the result to nearest legal Fixed. | |
| ||
| rounds the result to nearest legal Fixed. Overflow is possible. | |
| ||
| rounds the result to nearest legal Fixed. Overflow is possible. | |
| ||
| rounds the result to nearest legal Fixed. Overflow is possible. | |
|
| |
casts to double. |
As mentioned before, the CGAL_Fixed_precision_nt numbers works in an interval of multiples of , this number as to be defined before all use of CGAL_Fixed_precision_nt.
|
| |
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 CGAL_Fixed_precision_nt may became invalid. | ||
|
| |
returns . | ||
|
| |
returns . |
CGAL_Fixed_precision_nt implements perturbation scheme as described by Alliez, Devillers and Snoeyink [ADS97]. The perturbation mode can be activate or deactivate for different kinds of perturbations. The default mode is no perturbation.
|
| |
Activate. Incircle test of 4 cocircular points answers degenerate only if the 4 points are colinear. | ||
|
| |
Deactivate | ||
|
| |
returns current mode | ||
|
| |
Activate. Insphere test of 5 cospherical points answers degenerate only if the 5 points are coplanar. | ||
|
| |
Deactivate | ||
|
| |
returns current mode |
Through overloading mechanisms, functions such that CGAL_orientation for CGAL_Point_2<CGAL_Cartesian< CGAL_Fixed_precision_nt> > will correctly call the function below.