Boost logo

Boost :

Subject: Re: [boost] [config] polygon library long long, long double portability
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-06-26 12:57:19


John Maddock wrote:
> So... how are you using long double?

long double is the maximally precise built-in numerical data type available. I use it as the default "high_precision_type" numerical data type and allow the user to override it with a data type derived from gmp or other arbitrary precicision numerical data type when long double is not enough. long double is not sufficient to make all computations performed by the library on 32 bit integer inputs robust, but it is sufficient for a vast majority, allowing even very large polygonal inputs to be processed by my sweepline correctly. For example, the 6 ft. by 8 ft. poster we hung up at boostcon with roughly one million line intersection in a polygon set intersection operation was computed with long double rather than gmp because the measures I took to make things robust without the need to resort to infinite precision rational are effective in all but the most extreme cases of pairwise line segment intersection. None of my robust predicates rely on non-integer arithmetic, for example, it is only the computation of coordinates that relies on the high_precision_type. We have real large CAD layouts where long double is not enough, and we use gmp infinite precision rational in production because reliability trumps performance when performance is already better than required.

Regards,
Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk