Fréchet View  1.6.0
A Tool for Exploring Fréchet Distance Algorithms
numeric.h File Reference
#include <limits>
#include <math.h>
#include <qdebug.h>
#include <types.h>
#include <boost/config.hpp>
#include <boost/math/special_functions/next.hpp>

Go to the source code of this file.

Namespaces

 frechet
 global definitions for all algorithms.
 
 frechet::numeric
 definitions and functions for optimal numerical precision.
 

Typedefs

typedef long double accurate_float
 

Functions

template<typename Number >
Number frechet::numeric::sq (const Number &x)
 square function template for arbitrary number types More...
 
template<typename Float >
Float frechet::numeric::sqrt (const Float &x)
 square-root function template for floating point types More...
 
template<>
double frechet::numeric::sqrt (const double &x)
 default sqrt() specialisation using the run-time libraries More...
 
template<>
long double frechet::numeric::sqrt (const long double &x)
 sqrt() specialisation for "long double" More...
 
template<typename Number >
Number frechet::numeric::abs (const Number &x)
 abs() function template for arbitrary numerical types More...
 
double frechet::numeric::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 frechet::numeric::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 frechet::numeric::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 frechet::numeric::euclidean_distance (const Point &p, const Point &q)
 euclidean distance function template for arbitrary floating point types More...
 
template<typename Float >
Float frechet::numeric::euclidean_distance_sq (const Point &p, const Point &q)
 euclidean distance function template for arbitrary floating point types More...
 
template<typename Float >
Float frechet::numeric::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 frechet::numeric::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 frechet::numeric::min (double a, double b)
 minimum function with checks for NAN More...
 
double frechet::numeric::max (double a, double b)
 maximum function with checks for NAN More...
 
int frechet::numeric::lower_floor (double x, int min=0)
 floor function with lower limit More...
 
int frechet::numeric::compare (double a, double b)
 comparator function More...
 
Point frechet::numeric::normalized (Point p)
 normalize a vector to unit length More...
 
Point frechet::numeric::intersection (Point p1, Point p2, Point p3, Point p4)
 compute the intersection of two lines More...
 
Point frechet::numeric::between (Point p, Point q, double w)
 compute a point on a line segment More...
 
double frechet::numeric::segment_length (const Curve &c, int i)
 compute the length of a polygon segment More...
 
double frechet::numeric::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...
 

Variables

static const constexpr double frechet::numeric::double_eps = std::numeric_limits<double>::epsilon()
 smallest double value More...
 

Typedef Documentation

◆ accurate_float

typedef long double accurate_float

Use increased precision for intermediate values when calculating Free-Space The actual size of 'long double' depends on compiler and/or OS settings

  • Microsoft Visual C = 64 bit = double (= useless)
  • Intel C++ compiler = 80 bit
  • gcc on Linux = 80 bit
  • clang on macOS = 80 bit

Definition at line 42 of file numeric.h.