gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
robustPredicates.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
Include dependency graph for robustPredicates.cpp:

Go to the source code of this file.

Namespaces

 robustPredicates
 

Macros

#define INEXACT   /* Nothing */
 
#define REAL   double /* float or double */
 
#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 Fast_Two_Diff_Tail(a, b, x, y)
 
#define Fast_Two_Diff(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 Two_Product_2Presplit(a, ahi, alo, 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)
 
#define Four_One_Sum(a3, a2, a1, a0, b, x4, x3, x2, x1, x0)
 
#define Four_Two_Sum(a3, a2, a1, a0, b1, b0, x5, x4, x3, x2, x1, x0)
 
#define Four_Four_Sum(a3, a2, a1, a0, b4, b3, b1, b0, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b, x8, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Eight_Four_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b4, b3, b1, b0, x11, x10, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Two_One_Product(a1, a0, b, x3, x2, x1, x0)
 
#define Four_One_Product(a3, a2, a1, a0, b, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Two_Two_Product(a1, a0, b1, b0, x7, x6, x5, x4, x3, x2, x1, x0)
 
#define Two_Square(a1, a0, x5, x4, x3, x2, x1, x0)
 

Functions

REAL robustPredicates::exactinit (int filter, REAL maxx, REAL maxy, REAL maxz)
 
int robustPredicates::grow_expansion (int elen, REAL *e, REAL b, REAL *h)
 
int robustPredicates::grow_expansion_zeroelim (int elen, REAL *e, REAL b, REAL *h)
 
int robustPredicates::expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::expansion_sum_zeroelim1 (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::expansion_sum_zeroelim2 (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::fast_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::fast_expansion_sum_zeroelim (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::linear_expansion_sum (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::linear_expansion_sum_zeroelim (int elen, REAL *e, int flen, REAL *f, REAL *h)
 
int robustPredicates::scale_expansion (int elen, REAL *e, REAL b, REAL *h)
 
int robustPredicates::scale_expansion_zeroelim (int elen, REAL *e, REAL b, REAL *h)
 
int robustPredicates::compress (int elen, REAL *e, REAL *h)
 
REAL robustPredicates::estimate (int elen, REAL *e)
 
REAL robustPredicates::orient2dfast (REAL *pa, REAL *pb, REAL *pc)
 
REAL robustPredicates::orient2dexact (REAL *pa, REAL *pb, REAL *pc)
 
REAL robustPredicates::orient2dslow (REAL *pa, REAL *pb, REAL *pc)
 
REAL robustPredicates::orient2dadapt (REAL *pa, REAL *pb, REAL *pc, REAL detsum)
 
REAL robustPredicates::orient2d (REAL *pa, REAL *pb, REAL *pc)
 
REAL robustPredicates::orient3dfast (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::orient3dexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::orient3dslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::orient3dadapt (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL permanent)
 
REAL robustPredicates::orient3d (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::incirclefast (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::incircleexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::incircleslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::incircleadapt (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL permanent)
 
REAL robustPredicates::incircle (REAL *pa, REAL *pb, REAL *pc, REAL *pd)
 
REAL robustPredicates::inspherefast (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
 
REAL robustPredicates::insphereexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
 
REAL robustPredicates::insphereslow (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
 
REAL robustPredicates::insphereadapt (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, REAL permanent)
 
REAL robustPredicates::insphere (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe)
 
REAL robustPredicates::orient4dexact (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, REAL aheight, REAL bheight, REAL cheight, REAL dheight, REAL eheight)
 
REAL robustPredicates::orient4dadapt (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, REAL aheight, REAL bheight, REAL cheight, REAL dheight, REAL eheight, REAL permanent)
 
REAL robustPredicates::orient4d (REAL *pa, REAL *pb, REAL *pc, REAL *pd, REAL *pe, REAL aheight, REAL bheight, REAL cheight, REAL dheight, REAL eheight)
 

Variables

static REAL robustPredicates::splitter
 
static REAL robustPredicates::epsilon
 
static REAL robustPredicates::resulterrbound
 
static REAL robustPredicates::ccwerrboundA
 
static REAL robustPredicates::ccwerrboundB
 
static REAL robustPredicates::ccwerrboundC
 
static REAL robustPredicates::o3derrboundA
 
static REAL robustPredicates::o3derrboundB
 
static REAL robustPredicates::o3derrboundC
 
static REAL robustPredicates::iccerrboundA
 
static REAL robustPredicates::iccerrboundB
 
static REAL robustPredicates::iccerrboundC
 
static REAL robustPredicates::isperrboundA
 
static REAL robustPredicates::isperrboundB
 
static REAL robustPredicates::isperrboundC
 
static int robustPredicates::_use_inexact_arith
 
static int robustPredicates::_use_static_filter
 
static REAL robustPredicates::o3dstaticfilter
 
static REAL robustPredicates::ispstaticfilter
 

Macro Definition Documentation

◆ Absolute

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

Definition at line 154 of file robustPredicates.cpp.

◆ Eight_Four_Sum

#define Eight_Four_Sum (   a7,
  a6,
  a5,
  a4,
  a3,
  a2,
  a1,
  a0,
  b4,
  b3,
  b1,
  b0,
  x11,
  x10,
  x9,
  x8,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, _l, _6, _5, _4, _3, \
_2, _1, _0, x1, x0); \
Eight_Two_Sum(_l, _6, _5, _4, _3, _2, _1, _0, b4, b3, x11, x10, x9, x8, \
x7, x6, x5, x4, x3, x2)

Definition at line 303 of file robustPredicates.cpp.

◆ Eight_One_Sum

#define Eight_One_Sum (   a7,
  a6,
  a5,
  a4,
  a3,
  a2,
  a1,
  a0,
  b,
  x8,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Four_One_Sum(a3, a2, a1, a0, b , _j, x3, x2, x1, x0); \
Four_One_Sum(a7, a6, a5, a4, _j, x8, x7, x6, x5, x4)

Definition at line 291 of file robustPredicates.cpp.

◆ Eight_Two_Sum

#define Eight_Two_Sum (   a7,
  a6,
  a5,
  a4,
  a3,
  a2,
  a1,
  a0,
  b1,
  b0,
  x9,
  x8,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b0, _k, _6, _5, _4, _3, _2, \
_1, _0, x0); \
Eight_One_Sum(_k, _6, _5, _4, _3, _2, _1, _0, b1, x9, x8, x7, x6, x5, x4, \
x3, x2, x1)

Definition at line 296 of file robustPredicates.cpp.

◆ Fast_Two_Diff

#define Fast_Two_Diff (   a,
  b,
  x,
 
)
Value:
x = (REAL) (a - b); \
Fast_Two_Diff_Tail(a, b, x, y)

Definition at line 182 of file robustPredicates.cpp.

◆ Fast_Two_Diff_Tail

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

Definition at line 178 of file robustPredicates.cpp.

◆ Fast_Two_Sum

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

Definition at line 174 of file robustPredicates.cpp.

◆ Fast_Two_Sum_Tail

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

Definition at line 170 of file robustPredicates.cpp.

◆ Four_Four_Sum

#define Four_Four_Sum (   a3,
  a2,
  a1,
  a0,
  b4,
  b3,
  b1,
  b0,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Four_Two_Sum(a3, a2, a1, a0, b1, b0, _l, _2, _1, _0, x1, x0); \
Four_Two_Sum(_l, _2, _1, _0, b4, b3, x7, x6, x5, x4, x3, x2)

Definition at line 286 of file robustPredicates.cpp.

◆ Four_One_Product

#define Four_One_Product (   a3,
  a2,
  a1,
  a0,
  b,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Split(b, bhi, blo); \
Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \
Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _k, x1); \
Fast_Two_Sum(_j, _k, _i, x2); \
Two_Product_Presplit(a2, b, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _k, x3); \
Fast_Two_Sum(_j, _k, _i, x4); \
Two_Product_Presplit(a3, b, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _k, x5); \
Fast_Two_Sum(_j, _k, x7, x6)

Definition at line 319 of file robustPredicates.cpp.

◆ Four_One_Sum

#define Four_One_Sum (   a3,
  a2,
  a1,
  a0,
  b,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Two_One_Sum(a1, a0, b , _j, x1, x0); \
Two_One_Sum(a3, a2, _j, x4, x3, x2)

Definition at line 278 of file robustPredicates.cpp.

◆ Four_Two_Sum

#define Four_Two_Sum (   a3,
  a2,
  a1,
  a0,
  b1,
  b0,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Four_One_Sum(a3, a2, a1, a0, b0, _k, _2, _1, _0, x0); \
Four_One_Sum(_k, _2, _1, _0, b1, x5, x4, x3, x2, x1)

Definition at line 282 of file robustPredicates.cpp.

◆ INEXACT

#define INEXACT   /* Nothing */

Definition at line 139 of file robustPredicates.cpp.

◆ NARROWRAND

#define NARROWRAND   narrowdoublerand

Definition at line 145 of file robustPredicates.cpp.

◆ REAL

#define REAL   double /* float or double */

Definition at line 142 of file robustPredicates.cpp.

◆ REALPRINT

#define REALPRINT   doubleprint

Definition at line 143 of file robustPredicates.cpp.

◆ REALRAND

#define REALRAND   doublerand

Definition at line 144 of file robustPredicates.cpp.

◆ Split

#define Split (   a,
  ahi,
  alo 
)
Value:
c = (REAL) (splitter * a); \
abig = (REAL) (c - a); \
ahi = c - abig; \
alo = a - ahi

Definition at line 208 of file robustPredicates.cpp.

◆ Square

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

Definition at line 255 of file robustPredicates.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

Definition at line 249 of file robustPredicates.cpp.

◆ Two_Diff

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

Definition at line 204 of file robustPredicates.cpp.

◆ Two_Diff_Tail

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

Definition at line 197 of file robustPredicates.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)

Definition at line 266 of file robustPredicates.cpp.

◆ Two_One_Product

#define Two_One_Product (   a1,
  a0,
  b,
  x3,
  x2,
  x1,
  x0 
)
Value:
Split(b, bhi, blo); \
Two_Product_Presplit(a0, b, bhi, blo, _i, x0); \
Two_Product_Presplit(a1, b, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _k, x1); \
Fast_Two_Sum(_j, _k, x3, x2)

Definition at line 312 of file robustPredicates.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)

Definition at line 262 of file robustPredicates.cpp.

◆ Two_Product

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

Definition at line 222 of file robustPredicates.cpp.

◆ Two_Product_2Presplit

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

Definition at line 240 of file robustPredicates.cpp.

◆ Two_Product_Presplit

#define Two_Product_Presplit (   a,
  b,
  bhi,
  blo,
  x,
 
)
Value:
x = (REAL) (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 229 of file robustPredicates.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 214 of file robustPredicates.cpp.

◆ Two_Square

#define Two_Square (   a1,
  a0,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Square(a0, _j, x0); \
_0 = a0 + a0; \
Two_Product(a1, _0, _k, _1); \
Two_One_Sum(_k, _1, _j, _l, _2, x1); \
Square(a1, _j, _1); \
Two_Two_Sum(_j, _1, _l, _2, x5, x4, x3, x2)

Definition at line 362 of file robustPredicates.cpp.

◆ Two_Sum

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

Definition at line 193 of file robustPredicates.cpp.

◆ Two_Sum_Tail

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

Definition at line 186 of file robustPredicates.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)

Definition at line 274 of file robustPredicates.cpp.

◆ Two_Two_Product

#define Two_Two_Product (   a1,
  a0,
  b1,
  b0,
  x7,
  x6,
  x5,
  x4,
  x3,
  x2,
  x1,
  x0 
)
Value:
Split(a0, a0hi, a0lo); \
Split(b0, bhi, blo); \
Two_Product_2Presplit(a0, a0hi, a0lo, b0, bhi, blo, _i, x0); \
Split(a1, a1hi, a1lo); \
Two_Product_2Presplit(a1, a1hi, a1lo, b0, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _k, _1); \
Fast_Two_Sum(_j, _k, _l, _2); \
Split(b1, bhi, blo); \
Two_Product_2Presplit(a0, a0hi, a0lo, b1, bhi, blo, _i, _0); \
Two_Sum(_1, _0, _k, x1); \
Two_Sum(_2, _k, _j, _1); \
Two_Sum(_l, _j, _m, _2); \
Two_Product_2Presplit(a1, a1hi, a1lo, b1, bhi, blo, _j, _0); \
Two_Sum(_i, _0, _n, _0); \
Two_Sum(_1, _0, _i, x2); \
Two_Sum(_2, _i, _k, _1); \
Two_Sum(_m, _k, _l, _2); \
Two_Sum(_j, _n, _k, _0); \
Two_Sum(_1, _0, _j, x3); \
Two_Sum(_2, _j, _i, _1); \
Two_Sum(_l, _i, _m, _2); \
Two_Sum(_1, _k, _i, x4); \
Two_Sum(_2, _i, _k, x5); \
Two_Sum(_m, _k, x7, x6)

Definition at line 332 of file robustPredicates.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)

Definition at line 270 of file robustPredicates.cpp.

◆ UNIFORMRAND

#define UNIFORMRAND   uniformdoublerand

Definition at line 146 of file robustPredicates.cpp.

Four_One_Sum
#define Four_One_Sum(a3, a2, a1, a0, b, x4, x3, x2, x1, x0)
Definition: robustPredicates.cpp:277
Eight_One_Sum
#define Eight_One_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b, x8, x7, x6, x5, x4, x3, x2, x1, x0)
Definition: robustPredicates.cpp:290
c
static double c(int i, int j, fullMatrix< double > &CA, const std::vector< SPoint3 > &P, const std::vector< SPoint3 > &Q)
Definition: discreteFrechetDistance.cpp:15
a4
#define a4
Definition: GaussQuadratureTet.cpp:11
REAL
#define REAL
Definition: robustPredicates.cpp:141
Two_One_Sum
#define Two_One_Sum(a1, a0, b, x2, x1, x0)
Definition: robustPredicates.cpp:261
Two_Sum
#define Two_Sum(a, b, x, y)
Definition: robustPredicates.cpp:192
Four_Two_Sum
#define Four_Two_Sum(a3, a2, a1, a0, b1, b0, x5, x4, x3, x2, x1, x0)
Definition: robustPredicates.cpp:281
a5
#define a5
Definition: GaussQuadratureTet.cpp:15
robustPredicates::splitter
static REAL splitter
Definition: robustPredicates.cpp:370
a1
const double a1
Definition: GaussQuadratureHex.cpp:10
Two_One_Diff
#define Two_One_Diff(a1, a0, b, x2, x1, x0)
Definition: robustPredicates.cpp:265
b4
#define b4
Definition: GaussQuadratureTet.cpp:12
a2
const double a2
Definition: GaussQuadratureHex.cpp:12
Eight_Two_Sum
#define Eight_Two_Sum(a7, a6, a5, a4, a3, a2, a1, a0, b1, b0, x9, x8, x7, x6, x5, x4, x3, x2, x1, x0)
Definition: robustPredicates.cpp:295
b1
const double b1
Definition: GaussQuadratureHex.cpp:14
Split
#define Split(a, ahi, alo)
Definition: robustPredicates.cpp:207
Square
#define Square(a, x, y)
Definition: robustPredicates.cpp:254
Two_Diff
#define Two_Diff(a, b, x, y)
Definition: robustPredicates.cpp:203