GeomPredicates-SSE-0.2: Geometric predicates (Intel SSE)

Numeric.Geometric.Predicates.Interval

Description

These predicates use hardware (SSE) based interval arithmetic based on the algorithms presented in (1). They are intended to be used as a filter before resorting to slower exact computation.

  • These routines return Nothing if the result could not be determined exactly from the calculated interval.
  • Each call toggles the SSE rounding mode to -infinity and back.
  • All computations are done in Double precision.
  • Rewrite specializations are in place for Float and Double that greatly reduce allocations compared to Real. Using anything but Float or Double is probably absurdly slow thanks to realToFrac.
  • For performance reasons we assume CDouble == Double.
  1. BRANIMIR LAMBOV. "INTERVAL ARITHMETIC USING SSE-2"

Synopsis

Documentation

cinttSSE :: Real a => a -> a -> a -> Maybe BoolSource

Test if p3 is within the closed interval specified by [p1,p2]

incircleSSE :: Real a => (Vector2 a, Vector2 a, Vector2 a) -> Vector2 a -> Maybe OrderingSource

Test the relation of a point to the circle formed by (p1..p3). (p1..p3) must be in counterclockwise order. Result: GT=inside, EQ=border, LT=outside

ccwSSE :: Real a => Vector2 a -> Vector2 a -> Vector2 a -> Maybe OrderingSource

Counter-clockwise orientation test. Classifies p3 in relation to the line formed by p1 and p2. Result: LT=Right, GT=Left, EQ=Coincident