definitions and functions for optimal numerical precision.
The functions in namespace frechet::numeric are meant to be used transparently with different floating point types.
In particular, the template functions can be used with 'double' precision, with 'long double' precision, and even with 'quad' precision (though quad types are currently not used).
|
template<typename Number > |
Number | sq (const Number &x) |
| square function template for arbitrary number types More...
|
|
template<typename Float > |
Float | sqrt (const Float &x) |
| square-root function template for floating point types More...
|
|
template<> |
double | sqrt (const double &x) |
| default sqrt() specialisation using the run-time libraries More...
|
|
template<> |
long double | sqrt (const long double &x) |
| sqrt() specialisation for "long double" More...
|
|
template<typename Number > |
Number | abs (const Number &x) |
| abs() function template for arbitrary numerical types More...
|
|
double | round_up (double x, int ulps=1) |
| rounding function with 'units in the last place' Roughly speaking, a ulp is the smallest representable floating point value. More...
|
|
template<typename Float > |
Float | euclidean_distance_sq (const Float &px, const Float &py, const Float &qx, const Float &qy) |
| euclidean distance function template for arbitrary floating point types More...
|
|
template<typename Float > |
Float | euclidean_distance (const Float &px, const Float &py, const Float &qx, const Float &qy) |
| euclidean distance function template for arbitrary floating point types More...
|
|
template<typename Float > |
Float | euclidean_distance (const Point &p, const Point &q) |
| euclidean distance function template for arbitrary floating point types More...
|
|
template<typename Float > |
Float | euclidean_distance_sq (const Point &p, const Point &q) |
| euclidean distance function template for arbitrary floating point types More...
|
|
template<typename Float > |
Float | euclidean_segment_distance (const Float &ax, const Float &ay, const Float &bx, const Float &by, const Float &px, const Float &py) |
| Euclidean Distance between a point and a segment; function template for arbitrary floating point types. More...
|
|
template<typename Float > |
Float | euclidean_segment_distance (const QLineF &s, const Point &p) |
| Euclidean Distance between a point and a segment; function template for arbitrary floating point types. More...
|
|
double | min (double a, double b) |
| minimum function with checks for NAN More...
|
|
double | max (double a, double b) |
| maximum function with checks for NAN More...
|
|
int | lower_floor (double x, int min=0) |
| floor function with lower limit More...
|
|
int | compare (double a, double b) |
| comparator function More...
|
|
Point | normalized (Point p) |
| normalize a vector to unit length More...
|
|
Point | intersection (Point p1, Point p2, Point p3, Point p4) |
| compute the intersection of two lines More...
|
|
Point | between (Point p, Point q, double w) |
| compute a point on a line segment More...
|
|
double | segment_length (const Curve &c, int i) |
| compute the length of a polygon segment More...
|
|
double | max_euclidean_distance (const Curve &P, const Curve &Q) |
| compute the maximum distance between two polygons This value serves as an upper bound for the Frechet Distance between polyongs. More...
|
|