Seamly2D
Code documentation
predicates.cpp File Reference
#include <QtGlobal>
#include "../vmisc/diagnostic.h"
Include dependency graph for predicates.cpp:

Go to the source code of this file.

Macros

#define INEXACT   /* Nothing */
 
#define REALPRINT   doubleprint
 
#define REALRAND   doublerand
 
#define NARROWRAND   narrowdoublerand
 
#define UNIFORMRAND   uniformdoublerand
 
#define Absolute(a)   ((a) >= 0.0 ? (a) : -(a))
 
#define Fast_Two_Sum_Tail(a, b, x, y)
 
#define Fast_Two_Sum(a, b, x, y)
 
#define Two_Sum_Tail(a, b, x, y)
 
#define Two_Sum(a, b, x, y)
 
#define Two_Diff_Tail(a, b, x, y)
 
#define Two_Diff(a, b, x, y)
 
#define Split(a, ahi, alo)
 
#define Two_Product_Tail(a, b, x, y)
 
#define Two_Product(a, b, x, y)
 
#define Two_Product_Presplit(a, b, bhi, blo, x, y)
 
#define Square_Tail(a, x, y)
 
#define Square(a, x, y)
 
#define Two_One_Sum(a1, a0, b, x2, x1, x0)
 
#define Two_One_Diff(a1, a0, b, x2, x1, x0)
 
#define Two_Two_Sum(a1, a0, b1, b0, x3, x2, x1, x0)
 
#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0)
 

Functions

void exactinit ()
 
int fast_expansion_sum_zeroelim (int elen, qreal *e, int flen, qreal *f, qreal *h)
 
int scale_expansion_zeroelim (int elen, qreal *e, qreal b, qreal *h)
 
qreal estimate (int elen, qreal *e)
 
qreal incircleadapt (qreal *pa, qreal *pb, qreal *pc, qreal *pd, qreal permanent)
 
qreal incircle (qreal *pa, qreal *pb, qreal *pc, qreal *pd)
 

Variables

qreal splitter
 
qreal epsilon
 
qreal resulterrbound
 
qreal ccwerrboundA
 
qreal ccwerrboundB
 
qreal ccwerrboundC
 
qreal o3derrboundA
 
qreal o3derrboundB
 
qreal o3derrboundC
 
qreal iccerrboundA
 
qreal iccerrboundB
 
qreal iccerrboundC
 
qreal isperrboundA
 
qreal isperrboundB
 
qreal isperrboundC
 

Macro Definition Documentation

◆ Absolute

#define Absolute (   a)    ((a) >= 0.0 ? (a) : -(a))

Definition at line 150 of file predicates.cpp.

◆ Fast_Two_Sum

#define Fast_Two_Sum (   a,
  b,
  x,
 
)
Value:
x = (qreal) (a + b); \
Fast_Two_Sum_Tail(a, b, x, y)

Definition at line 171 of file predicates.cpp.

◆ Fast_Two_Sum_Tail

#define Fast_Two_Sum_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = x - a; \
y = b - bvirt

Definition at line 167 of file predicates.cpp.

◆ INEXACT

#define INEXACT   /* Nothing */

Definition at line 136 of file predicates.cpp.

◆ NARROWRAND

#define NARROWRAND   narrowdoublerand

Definition at line 141 of file predicates.cpp.

◆ REALPRINT

#define REALPRINT   doubleprint

Definition at line 139 of file predicates.cpp.

◆ REALRAND

#define REALRAND   doublerand

Definition at line 140 of file predicates.cpp.

◆ Split

#define Split (   a,
  ahi,
  alo 
)
Value:
c = (qreal) (splitter * a); \
abig = (qreal) (c - a); \
ahi = c - abig; \
alo = a - ahi
qreal splitter
Definition: predicates.cpp:257

Definition at line 197 of file predicates.cpp.

◆ Square

#define Square (   a,
  x,
 
)
Value:
x = (qreal) (a * a); \
Square_Tail(a, x, y)

Definition at line 234 of file predicates.cpp.

◆ Square_Tail

#define Square_Tail (   a,
  x,
 
)
Value:
Split(a, ahi, alo); \
err1 = x - (ahi * ahi); \
err3 = err1 - ((ahi + ahi) * alo); \
y = (alo * alo) - err3
#define Split(a, ahi, alo)
Definition: predicates.cpp:197

Definition at line 228 of file predicates.cpp.

◆ Two_Diff

#define Two_Diff (   a,
  b,
  x,
 
)
Value:
x = (qreal) (a - b); \
Two_Diff_Tail(a, b, x, y)

Definition at line 193 of file predicates.cpp.

◆ Two_Diff_Tail

#define Two_Diff_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = (qreal) (a - x); \
avirt = x + bvirt; \
bround = bvirt - b; \
around = a - avirt; \
y = around + bround

Definition at line 186 of file predicates.cpp.

◆ Two_One_Diff

#define Two_One_Diff (   a1,
  a0,
  b,
  x2,
  x1,
  x0 
)
Value:
Two_Diff(a0, b , _i, x0); \
Two_Sum( a1, _i, x2, x1)
#define Two_Diff(a, b, x, y)
Definition: predicates.cpp:193

Definition at line 245 of file predicates.cpp.

◆ Two_One_Sum

#define Two_One_Sum (   a1,
  a0,
  b,
  x2,
  x1,
  x0 
)
Value:
Two_Sum(a0, b , _i, x0); \
Two_Sum(a1, _i, x2, x1)
#define Two_Sum(a, b, x, y)
Definition: predicates.cpp:182

Definition at line 241 of file predicates.cpp.

◆ Two_Product

#define Two_Product (   a,
  b,
  x,
 
)
Value:
x = (qreal) (a * b); \
Two_Product_Tail(a, b, x, y)

Definition at line 211 of file predicates.cpp.

◆ Two_Product_Presplit

#define Two_Product_Presplit (   a,
  b,
  bhi,
  blo,
  x,
 
)
Value:
x = (qreal) (a * b); \
Split(a, ahi, alo); \
err1 = x - (ahi * bhi); \
err2 = err1 - (alo * bhi); \
err3 = err2 - (ahi * blo); \
y = (alo * blo) - err3

Definition at line 218 of file predicates.cpp.

◆ Two_Product_Tail

#define Two_Product_Tail (   a,
  b,
  x,
 
)
Value:
Split(a, ahi, alo); \
Split(b, bhi, blo); \
err1 = x - (ahi * bhi); \
err2 = err1 - (alo * bhi); \
err3 = err2 - (ahi * blo); \
y = (alo * blo) - err3

Definition at line 203 of file predicates.cpp.

◆ Two_Sum

#define Two_Sum (   a,
  b,
  x,
 
)
Value:
x = (qreal) (a + b); \
Two_Sum_Tail(a, b, x, y)

Definition at line 182 of file predicates.cpp.

◆ Two_Sum_Tail

#define Two_Sum_Tail (   a,
  b,
  x,
 
)
Value:
bvirt = (qreal) (x - a); \
avirt = x - bvirt; \
bround = b - bvirt; \
around = a - avirt; \
y = around + bround

Definition at line 175 of file predicates.cpp.

◆ Two_Two_Diff

#define Two_Two_Diff (   a1,
  a0,
  b1,
  b0,
  x3,
  x2,
  x1,
  x0 
)
Value:
Two_One_Diff(a1, a0, b0, _j, _0, x0); \
Two_One_Diff(_j, _0, b1, x3, x2, x1)
#define Two_One_Diff(a1, a0, b, x2, x1, x0)
Definition: predicates.cpp:245

Definition at line 253 of file predicates.cpp.

◆ Two_Two_Sum

#define Two_Two_Sum (   a1,
  a0,
  b1,
  b0,
  x3,
  x2,
  x1,
  x0 
)
Value:
Two_One_Sum(a1, a0, b0, _j, _0, x0); \
Two_One_Sum(_j, _0, b1, x3, x2, x1)
#define Two_One_Sum(a1, a0, b, x2, x1, x0)
Definition: predicates.cpp:241

Definition at line 249 of file predicates.cpp.

◆ UNIFORMRAND

#define UNIFORMRAND   uniformdoublerand

Definition at line 142 of file predicates.cpp.

Function Documentation

◆ estimate()

qreal estimate ( int  elen,
qreal *  e 
)

Definition at line 496 of file predicates.cpp.

Referenced by incircleadapt().

◆ exactinit()

◆ fast_expansion_sum_zeroelim()

int fast_expansion_sum_zeroelim ( int  elen,
qreal *  e,
int  flen,
qreal *  f,
qreal *  h 
)

Definition at line 343 of file predicates.cpp.

References Fast_Two_Sum, INEXACT, and Two_Sum.

Referenced by incircleadapt().

◆ incircle()

qreal incircle ( qreal *  pa,
qreal *  pb,
qreal *  pc,
qreal *  pd 
)

Definition at line 1044 of file predicates.cpp.

References Absolute, iccerrboundA, and incircleadapt().

◆ incircleadapt()

qreal incircleadapt ( qreal *  pa,
qreal *  pb,
qreal *  pc,
qreal *  pd,
qreal  permanent 
)

◆ scale_expansion_zeroelim()

int scale_expansion_zeroelim ( int  elen,
qreal *  e,
qreal  b,
qreal *  h 
)

Definition at line 445 of file predicates.cpp.

References Fast_Two_Sum, INEXACT, Split, Two_Product_Presplit, and Two_Sum.

Referenced by incircleadapt().

Variable Documentation

◆ ccwerrboundA

qreal ccwerrboundA

Definition at line 261 of file predicates.cpp.

Referenced by exactinit().

◆ ccwerrboundB

qreal ccwerrboundB

Definition at line 261 of file predicates.cpp.

Referenced by exactinit().

◆ ccwerrboundC

qreal ccwerrboundC

Definition at line 261 of file predicates.cpp.

Referenced by exactinit().

◆ epsilon

qreal epsilon

Definition at line 258 of file predicates.cpp.

Referenced by exactinit().

◆ iccerrboundA

qreal iccerrboundA

Definition at line 263 of file predicates.cpp.

Referenced by exactinit(), and incircle().

◆ iccerrboundB

qreal iccerrboundB

Definition at line 263 of file predicates.cpp.

Referenced by exactinit(), and incircleadapt().

◆ iccerrboundC

qreal iccerrboundC

Definition at line 263 of file predicates.cpp.

Referenced by exactinit(), and incircleadapt().

◆ isperrboundA

qreal isperrboundA

Definition at line 264 of file predicates.cpp.

Referenced by exactinit().

◆ isperrboundB

qreal isperrboundB

Definition at line 264 of file predicates.cpp.

Referenced by exactinit().

◆ isperrboundC

qreal isperrboundC

Definition at line 264 of file predicates.cpp.

Referenced by exactinit().

◆ o3derrboundA

qreal o3derrboundA

Definition at line 262 of file predicates.cpp.

Referenced by exactinit().

◆ o3derrboundB

qreal o3derrboundB

Definition at line 262 of file predicates.cpp.

Referenced by exactinit().

◆ o3derrboundC

qreal o3derrboundC

Definition at line 262 of file predicates.cpp.

Referenced by exactinit().

◆ resulterrbound

qreal resulterrbound

Definition at line 260 of file predicates.cpp.

Referenced by exactinit(), and incircleadapt().

◆ splitter

qreal splitter

Definition at line 257 of file predicates.cpp.

Referenced by exactinit().