ATLAS Offline Software
Classes | Typedefs | Enumerations | Functions
internal_poltrig Namespace Reference

Classes

class  BTreeNode
 
class  Linebase
 
class  Pointbase
 
class  SplayTree
 

Typedefs

typedef std::map< unsigned int, Pointbase * > PointbaseMap
 
typedef std::map< unsigned int, Linebase * > LineMap
 
typedef std::priority_queue< PointbasePQueue
 
typedef SplayTree< Linebase *, double > EdgeBST
 
typedef std::list< unsigned int > Monopoly
 
typedef std::list< MonopolyMonopolys
 
typedef std::vector< unsigned int > Triangle
 
typedef std::list< TriangleTriangles
 
typedef std::map< unsigned int, std::set< unsigned int > > AdjEdgeMap
 

Enumerations

enum  Type {
  UNKNOWN, INPUT, INSERT, START,
  END, MERGE, SPLIT, REGULAR_UP,
  REGULAR_DOWN
}
 

Functions

int fast_expansion_sum_zeroelim (const int &elen, REAL *e, const int &flen, REAL *f, REAL *h)
 
REAL estimate (const int &elen, REAL *e)
 
REAL orient2dadapt (REAL *pa, REAL *pb, REAL *pc, const REAL &detsum)
 
REAL orient2d (REAL *pa, REAL *pb, REAL *pc)
 
double orient2d (double *pa, double *pb, double *pc)
 
double dist_sqr (const Pointbase &sp, const Pointbase &ep)
 
double dist_sqr (double *pa, double *pb)
 
void UpdateKey (BTreeNode< Linebase *, double > *node, double y)
 
bool operator== (const Pointbase &pa, const Pointbase &pb)
 
bool operator> (const Pointbase &pa, const Pointbase &pb)
 
bool operator< (const Pointbase &pa, const Pointbase &pb)
 
bool operator!= (const Pointbase &pa, const Pointbase &pb)
 

Typedef Documentation

◆ AdjEdgeMap

typedef std::map<unsigned int, std::set<unsigned int> > internal_poltrig::AdjEdgeMap

Definition at line 126 of file PolygonTriangulator.cxx.

◆ EdgeBST

Definition at line 121 of file PolygonTriangulator.cxx.

◆ LineMap

typedef std::map<unsigned int, Linebase*> internal_poltrig::LineMap

Definition at line 119 of file PolygonTriangulator.cxx.

◆ Monopoly

typedef std::list<unsigned int> internal_poltrig::Monopoly

Definition at line 122 of file PolygonTriangulator.cxx.

◆ Monopolys

Definition at line 123 of file PolygonTriangulator.cxx.

◆ PointbaseMap

typedef std::map<unsigned int, Pointbase*> internal_poltrig::PointbaseMap

Definition at line 118 of file PolygonTriangulator.cxx.

◆ PQueue

typedef std::priority_queue<Pointbase> internal_poltrig::PQueue

Definition at line 120 of file PolygonTriangulator.cxx.

◆ Triangle

typedef std::vector<unsigned int> internal_poltrig::Triangle

Definition at line 124 of file PolygonTriangulator.cxx.

◆ Triangles

Definition at line 125 of file PolygonTriangulator.cxx.

Enumeration Type Documentation

◆ Type

Enumerator
UNKNOWN 
INPUT 
INSERT 
START 
END 
MERGE 
SPLIT 
REGULAR_UP 
REGULAR_DOWN 

Definition at line 112 of file PolygonTriangulator.cxx.

Function Documentation

◆ dist_sqr() [1/2]

double internal_poltrig::dist_sqr ( const Pointbase sp,
const Pointbase ep 
)

Definition at line 1309 of file PolygonTriangulator.cxx.

1310  {
1311  return sqr(sp.x-ep.x)+sqr(sp.y-ep.y);
1312  }

◆ dist_sqr() [2/2]

double internal_poltrig::dist_sqr ( double *  pa,
double *  pb 
)

Definition at line 1317 of file PolygonTriangulator.cxx.

1318  {
1319  return sqr(pa[0]-pb[0])+sqr(pa[1]-pb[1]);
1320  }

◆ estimate()

REAL internal_poltrig::estimate ( const int &  elen,
REAL e 
)

Definition at line 451 of file PolygonTriangulator.cxx.

452  {
453  REAL Q;
454  int eindex;
455 
456  Q = e[0];
457  for (eindex = 1; eindex < elen; ++eindex) {
458  Q += e[eindex];
459  }
460  return Q;
461  }

◆ fast_expansion_sum_zeroelim()

int internal_poltrig::fast_expansion_sum_zeroelim ( const int &  elen,
REAL e,
const int &  flen,
REAL f,
REAL h 
)

Definition at line 372 of file PolygonTriangulator.cxx.

374  {
375  REAL Q;
376  INEXACT REAL Qnew;
377  INEXACT REAL hh;
378  INEXACT REAL bvirt;
379  REAL avirt, bround, around;
380  int eindex, findex, hindex;
381  REAL enow, fnow;
382 
383  enow = e[0];
384  fnow = f[0];
385  eindex = findex = 0;
386  if ((fnow > enow) == (fnow > -enow)) {
387  Q = enow;
388  enow = e[++eindex];
389  } else {
390  Q = fnow;
391  fnow = f[++findex];
392  }
393  hindex = 0;
394  if ((eindex < elen) && (findex < flen)) {
395  if ((fnow > enow) == (fnow > -enow)) {
396  Fast_Two_Sum(enow, Q, Qnew, hh);
397  enow = e[++eindex];
398  } else {
399  Fast_Two_Sum(fnow, Q, Qnew, hh);
400  fnow = f[++findex];
401  }
402  Q = Qnew;
403  if (hh != 0.0) {
404  h[hindex++] = hh;
405  }
406  while ((eindex < elen) && (findex < flen)) {
407  if ((fnow > enow) == (fnow > -enow)) {
408  Two_Sum(Q, enow, Qnew, hh);
409  enow = e[++eindex];
410  } else {
411  Two_Sum(Q, fnow, Qnew, hh);
412  fnow = f[++findex];
413  }
414  Q = Qnew;
415  if (hh != 0.0) {
416  h[hindex++] = hh;
417  }
418  }
419  }
420  while (eindex < elen) {
421  Two_Sum(Q, enow, Qnew, hh);
422  enow = e[++eindex];
423  Q = Qnew;
424  if (hh != 0.0) {
425  h[hindex++] = hh;
426  }
427  }
428  while (findex < flen) {
429  Two_Sum(Q, fnow, Qnew, hh);
430  fnow = f[++findex];
431  Q = Qnew;
432  if (hh != 0.0) {
433  h[hindex++] = hh;
434  }
435  }
436  if ((Q != 0.0) || (hindex == 0)) {
437  h[hindex++] = Q;
438  }
439  return hindex;
440  }

◆ operator!=()

Definition at line 1360 of file PolygonTriangulator.cxx.

1361  {
1362  return !(pa.x==pb.x && pa.y==pb.y);
1363  }

◆ operator<()

bool internal_poltrig::operator< ( const Pointbase pa,
const Pointbase pb 
)

Definition at line 1354 of file PolygonTriangulator.cxx.

1355  {
1356  return( (pa.y < pb.y) || ( (pa.y==pb.y) && (pa.x > pb.x)) );
1357  }

◆ operator==()

bool internal_poltrig::operator== ( const Pointbase pa,
const Pointbase pb 
)

Definition at line 1342 of file PolygonTriangulator.cxx.

1343  {
1344  return (pa.x==pb.x && pa.y==pb.y);
1345  }

◆ operator>()

bool internal_poltrig::operator> ( const Pointbase pa,
const Pointbase pb 
)

Definition at line 1348 of file PolygonTriangulator.cxx.

1349  {
1350  return( (pa.y > pb.y) || ( (pa.y==pb.y) && (pa.x < pb.x)) );
1351  }

◆ orient2d() [1/2]

double internal_poltrig::orient2d ( double *  pa,
double *  pb,
double *  pc 
)

◆ orient2d() [2/2]

REAL internal_poltrig::orient2d ( REAL pa,
REAL pb,
REAL pc 
)

Definition at line 571 of file PolygonTriangulator.cxx.

572  {
573  REAL detleft, detright, det;
574  REAL detsum, errbound;
575 
576  detleft = (pa[0] - pc[0]) * (pb[1] - pc[1]);
577  detright = (pa[1] - pc[1]) * (pb[0] - pc[0]);
578  det = detleft - detright;
579 
580  if (detleft > 0.0) {
581  if (detright <= 0.0) {
582  return det;
583  } else {
584  detsum = detleft + detright;
585  }
586  } else if (detleft < 0.0) {
587  if (detright >= 0.0) {
588  return det;
589  } else {
590  detsum = -detleft - detright;
591  }
592  } else {
593  return det;
594  }
595 
596  // errbound = ccwerrboundA * detsum;
597  errbound = detsum;
598  if ((det >= errbound) || (-det >= errbound)) {
599  return det;
600  }
601 
602  return orient2dadapt(pa, pb, pc, detsum);
603  }

◆ orient2dadapt()

REAL internal_poltrig::orient2dadapt ( REAL pa,
REAL pb,
REAL pc,
const REAL detsum 
)

Definition at line 489 of file PolygonTriangulator.cxx.

490  {
491  INEXACT REAL acx, acy, bcx, bcy;
492  REAL acxtail, acytail, bcxtail, bcytail;
493  INEXACT REAL detleft, detright;
494  REAL detlefttail, detrighttail;
495  REAL det, errbound;
496  REAL B[4], C1[8], C2[12], D[16];
497  INEXACT REAL B3;
498  int C1length, C2length, Dlength;
499  REAL u[4];
500  INEXACT REAL u3;
501  INEXACT REAL s1, t1;
502  REAL s0, t0;
503 
504  INEXACT REAL bvirt;
505  REAL avirt, bround, around;
506  INEXACT REAL c;
507  INEXACT REAL abig;
508  REAL ahi, alo, bhi, blo;
509  REAL err1, err2, err3;
510  INEXACT REAL x_i, x_j;
511  REAL x_0;
512 
513  acx = (REAL) (pa[0] - pc[0]);
514  bcx = (REAL) (pb[0] - pc[0]);
515  acy = (REAL) (pa[1] - pc[1]);
516  bcy = (REAL) (pb[1] - pc[1]);
517 
518  Two_Product(acx, bcy, detleft, detlefttail);
519  Two_Product(acy, bcx, detright, detrighttail);
520 
521  Two_Two_Diff(detleft, detlefttail, detright, detrighttail,
522  B3, B[2], B[1], B[0]);
523  B[3] = B3;
524 
525  det = estimate(4, B);
526  // errbound = ccwerrboundB * detsum;
527  errbound = detsum;
528  if ((det >= errbound) || (-det >= errbound)) {
529  return det;
530  }
531 
532  Two_Diff_Tail(pa[0], pc[0], acx, acxtail);
533  Two_Diff_Tail(pb[0], pc[0], bcx, bcxtail);
534  Two_Diff_Tail(pa[1], pc[1], acy, acytail);
535  Two_Diff_Tail(pb[1], pc[1], bcy, bcytail);
536 
537  if ((acxtail == 0.0) && (acytail == 0.0)
538  && (bcxtail == 0.0) && (bcytail == 0.0)) {
539  return det;
540  }
541 
542  // errbound = ccwerrboundC * detsum + resulterrbound * Absolute(det);
543  errbound = detsum + Absolute(det);
544  det += (acx * bcytail + bcy * acxtail)
545  - (acy * bcxtail + bcx * acytail);
546  if ((det >= errbound) || (-det >= errbound)) {
547  return det;
548  }
549 
550  Two_Product(acxtail, bcy, s1, s0);
551  Two_Product(acytail, bcx, t1, t0);
552  Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]);
553  u[3] = u3;
554  C1length = fast_expansion_sum_zeroelim(4, B, 4, u, C1);
555 
556  Two_Product(acx, bcytail, s1, s0);
557  Two_Product(acy, bcxtail, t1, t0);
558  Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]);
559  u[3] = u3;
560  C2length = fast_expansion_sum_zeroelim(C1length, C1, 4, u, C2);
561 
562  Two_Product(acxtail, bcytail, s1, s0);
563  Two_Product(acytail, bcxtail, t1, t0);
564  Two_Two_Diff(s1, s0, t1, t0, u3, u[2], u[1], u[0]);
565  u[3] = u3;
566  Dlength = fast_expansion_sum_zeroelim(C2length, C2, 4, u, D);
567 
568  return(D[Dlength - 1]);
569  }

◆ UpdateKey()

void internal_poltrig::UpdateKey ( BTreeNode< Linebase *, double > *  node,
double  y 
)

Definition at line 1322 of file PolygonTriangulator.cxx.

1323  {
1324  node->data()->setKeyValue(y);
1325  }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Two_Product
#define Two_Product(a, b, x, y)
Definition: PolygonTriangulator.cxx:333
internal_poltrig::START
@ START
Definition: PolygonTriangulator.cxx:112
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
internal_poltrig::REGULAR_DOWN
@ REGULAR_DOWN
Definition: PolygonTriangulator.cxx:112
keylayer_zslicemap.pb
pb
Definition: keylayer_zslicemap.py:188
DiTauMassTools::TauTypes::hh
@ hh
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:53
TRTCalib_Extractor.det
det
Definition: TRTCalib_Extractor.py:36
ALFA_EventTPCnv_Dict::t0
std::vector< ALFA_RawData_p1 > t0
Definition: ALFA_EventTPCnvDict.h:42
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
MCP::ScaleSmearParam::s0
@ s0
Two_Sum
#define Two_Sum(a, b, x, y)
Definition: PolygonTriangulator.cxx:301
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
internal_poltrig::INSERT
@ INSERT
Definition: PolygonTriangulator.cxx:112
internal_poltrig::MERGE
@ MERGE
Definition: PolygonTriangulator.cxx:112
sqr
#define sqr(t)
Definition: PolygonTriangulator.cxx:110
REAL
#define REAL
Definition: PolygonTriangulator.cxx:262
internal_poltrig::END
@ END
Definition: PolygonTriangulator.cxx:112
hist_file_dump.f
f
Definition: hist_file_dump.py:135
internal_poltrig::estimate
REAL estimate(const int &elen, REAL *e)
Definition: PolygonTriangulator.cxx:451
Absolute
#define Absolute(a)
Definition: PolygonTriangulator.cxx:270
Fast_Two_Sum
#define Fast_Two_Sum(a, b, x, y)
Definition: PolygonTriangulator.cxx:290
internal_poltrig::INPUT
@ INPUT
Definition: PolygonTriangulator.cxx:112
internal_poltrig::UNKNOWN
@ UNKNOWN
Definition: PolygonTriangulator.cxx:112
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
internal_poltrig::SPLIT
@ SPLIT
Definition: PolygonTriangulator.cxx:112
internal_poltrig::orient2dadapt
REAL orient2dadapt(REAL *pa, REAL *pb, REAL *pc, const REAL &detsum)
Definition: PolygonTriangulator.cxx:489
Two_Diff_Tail
#define Two_Diff_Tail(a, b, x, y)
Definition: PolygonTriangulator.cxx:305
y
#define y
internal_poltrig::fast_expansion_sum_zeroelim
int fast_expansion_sum_zeroelim(const int &elen, REAL *e, const int &flen, REAL *f, REAL *h)
Definition: PolygonTriangulator.cxx:372
h
Two_Two_Diff
#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0)
Definition: PolygonTriangulator.cxx:344
INEXACT
#define INEXACT
Definition: PolygonTriangulator.cxx:259
internal_poltrig::REGULAR_UP
@ REGULAR_UP
Definition: PolygonTriangulator.cxx:112
python.compressB64.c
def c
Definition: compressB64.py:93
python.SystemOfUnits.pc
float pc
Definition: SystemOfUnits.py:99
node
Definition: memory_hooks-stdcmalloc.h:74