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 129 of file PolygonTriangulator.cxx.

◆ EdgeBST

Definition at line 124 of file PolygonTriangulator.cxx.

◆ LineMap

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

Definition at line 122 of file PolygonTriangulator.cxx.

◆ Monopoly

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

Definition at line 125 of file PolygonTriangulator.cxx.

◆ Monopolys

Definition at line 126 of file PolygonTriangulator.cxx.

◆ PointbaseMap

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

Definition at line 121 of file PolygonTriangulator.cxx.

◆ PQueue

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

Definition at line 123 of file PolygonTriangulator.cxx.

◆ Triangle

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

Definition at line 127 of file PolygonTriangulator.cxx.

◆ Triangles

Definition at line 128 of file PolygonTriangulator.cxx.

Enumeration Type Documentation

◆ Type

Enumerator
UNKNOWN 
INPUT 
INSERT 
START 
END 
MERGE 
SPLIT 
REGULAR_UP 
REGULAR_DOWN 

Definition at line 115 of file PolygonTriangulator.cxx.

Function Documentation

◆ dist_sqr() [1/2]

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

Definition at line 1312 of file PolygonTriangulator.cxx.

1313  {
1314  return sqr(sp.x-ep.x)+sqr(sp.y-ep.y);
1315  }

◆ dist_sqr() [2/2]

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

Definition at line 1320 of file PolygonTriangulator.cxx.

1321  {
1322  return sqr(pa[0]-pb[0])+sqr(pa[1]-pb[1]);
1323  }

◆ estimate()

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

Definition at line 454 of file PolygonTriangulator.cxx.

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

◆ 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 375 of file PolygonTriangulator.cxx.

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

◆ operator!=()

Definition at line 1363 of file PolygonTriangulator.cxx.

1364  {
1365  return !(pa.x==pb.x && pa.y==pb.y);
1366  }

◆ operator<()

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

Definition at line 1357 of file PolygonTriangulator.cxx.

1358  {
1359  return( (pa.y < pb.y) || ( (pa.y==pb.y) && (pa.x > pb.x)) );
1360  }

◆ operator==()

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

Definition at line 1345 of file PolygonTriangulator.cxx.

1346  {
1347  return (pa.x==pb.x && pa.y==pb.y);
1348  }

◆ operator>()

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

Definition at line 1351 of file PolygonTriangulator.cxx.

1352  {
1353  return( (pa.y > pb.y) || ( (pa.y==pb.y) && (pa.x < pb.x)) );
1354  }

◆ 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 574 of file PolygonTriangulator.cxx.

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

◆ orient2dadapt()

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

Definition at line 492 of file PolygonTriangulator.cxx.

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

◆ UpdateKey()

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

Definition at line 1325 of file PolygonTriangulator.cxx.

1326  {
1327  node->data()->setKeyValue(y);
1328  }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Two_Product
#define Two_Product(a, b, x, y)
Definition: PolygonTriangulator.cxx:336
internal_poltrig::START
@ START
Definition: PolygonTriangulator.cxx:115
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
internal_poltrig::REGULAR_DOWN
@ REGULAR_DOWN
Definition: PolygonTriangulator.cxx:115
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:304
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
internal_poltrig::INSERT
@ INSERT
Definition: PolygonTriangulator.cxx:115
internal_poltrig::MERGE
@ MERGE
Definition: PolygonTriangulator.cxx:115
sqr
#define sqr(t)
Definition: PolygonTriangulator.cxx:113
REAL
#define REAL
Definition: PolygonTriangulator.cxx:265
internal_poltrig::END
@ END
Definition: PolygonTriangulator.cxx:115
hist_file_dump.f
f
Definition: hist_file_dump.py:140
internal_poltrig::estimate
REAL estimate(const int &elen, REAL *e)
Definition: PolygonTriangulator.cxx:454
Absolute
#define Absolute(a)
Definition: PolygonTriangulator.cxx:273
Fast_Two_Sum
#define Fast_Two_Sum(a, b, x, y)
Definition: PolygonTriangulator.cxx:293
internal_poltrig::UNKNOWN
@ UNKNOWN
Definition: PolygonTriangulator.cxx:115
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
internal_poltrig::SPLIT
@ SPLIT
Definition: PolygonTriangulator.cxx:115
internal_poltrig::orient2dadapt
REAL orient2dadapt(REAL *pa, REAL *pb, REAL *pc, const REAL &detsum)
Definition: PolygonTriangulator.cxx:492
Two_Diff_Tail
#define Two_Diff_Tail(a, b, x, y)
Definition: PolygonTriangulator.cxx:308
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:375
h
Two_Two_Diff
#define Two_Two_Diff(a1, a0, b1, b0, x3, x2, x1, x0)
Definition: PolygonTriangulator.cxx:347
INEXACT
#define INEXACT
Definition: PolygonTriangulator.cxx:262
internal_poltrig::REGULAR_UP
@ REGULAR_UP
Definition: PolygonTriangulator.cxx:115
python.compressB64.c
def c
Definition: compressB64.py:93
python.SystemOfUnits.pc
float pc
Definition: SystemOfUnits.py:114
node
Definition: node.h:24
INPUT
@ INPUT
Definition: TrigSignatureMoni.cxx:17