Boost logo

Boost :

Subject: Re: [boost] [geometry] area, length, centroid, behavior
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2009-03-11 12:58:31


Steve M. Robbins wrote:
> Can the proposed Boost libraries support this kind of exact Predicates
> with approximate Constructions paradigm?

I don't see that we have a choice. Inexact Predicates leads to undefined prgram behavior, incorrect outputs, hangs and crashes. Exact Constructions implies the output coordinate data type is multi-precision. Most users would typically prefer the other way around for both.

The point of the slope comparison trick is that it is a way to avoid loss of precision without resorting to multi-precision data types. It needs only ~66 bits of precision for 32 bit integer coordinates, and so long double is suitable in all cases to correctly compare the slopes of integer line segments.

My comparisons in integer geometry are exact if a multi-precision data type is specified, otherwise it uses long double, which turns out to be good enough almost all the time. My constructions are approximate because I snap to the integer grid.

Luke


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