GEOMLIB is the geometrical library of the VRR project.
Geometrical library (GEOMLIB) consists of the following modules:
The library is almost independent part of VRR project and uses only VRRLIB definitions. See VRRLIB for description of VRRLIB.
Many functions in GEOMLIB can fail because of floating point error or a different reason.
Each error type is described by its unique error code (a negative integer constant),
GEOM_ERR_NUMERIC. Full list of error codes can be found in the file geomlib/err.h.
Most of possibly failing routines follow these calling conventions:
In some cases the error code is stored in global variable
To simplify long error testing and code debugging, there are many basic macros defined in the file geomlib/base.h.
For historical reasons, some older parts of GEOMLIB do not return predefined integer error codes and only
return undefined negative values.
The library mainly uses
real floating-point type defined in VRRLIB, which can be of
Some more ambitious computations (i.e. polynomial solver) are fixed to the
double precision. NaN (not a number) or infinities are
usually considered as invalid values and produce the
If nothing else is said in function description, all parameters
must contain valid data (floating-point types must contain finite numbers,
pointers must not be
NULL and structures must agree with their definitions).
Successfully finished functions always return valid or explicitly described results. Pointers to resulting structures should not overlap with other parameters. The result of failed function is undefined.
The main GEOMLIB header is geomlib/geomlib.h. By including this file, all structures, functions and
macros can be used. It is also possible to include only a smaller subset of definitions by
including the appropriate header file. There are no inclusion dependencies, because necessary headers are used recursively.
Most of identifiers in GEOMLIB starts with
Some shorter internal aliases may be enabled by defining macro
GEOM_SOURCE before the first header inclusion.
GEOMLIB contains a script, which should help to find errors in the library implementation by applying some automated random tests. These testing routines are located in the file geomlib/geomlibtest.c and are compiled together with GEOMLIB. There are many tests of object-oriented programming emulation and correctness of numerical algorithms. Floating point results are tested to a small epsilon constant.