Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
pq_node.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file pq_node.h
1
/* This software is distributed under the GNU Lesser General Public License */
2
//==========================================================================
3
//
4
// pq_node.h
5
//
6
//==========================================================================
7
// $Id: pq_node.h,v 1.15 2003/04/03 11:48:26 raitner Exp $
8
9
#ifndef PQ_NODE_H
10
#define PQ_NODE_H
11
12
#include <
GTL/GTL.h
>
13
#include <
GTL/symlist.h
>
14
#include <
GTL/graph.h
>
15
16
#include <list>
17
#include <iostream>
18
19
__GTL_BEGIN_NAMESPACE
20
21
class
pq_tree
;
22
class
p_node
;
23
class
q_node
;
24
class
pq_leaf
;
25
class
direction_indicator
;
26
30
class
GTL_EXTERN
pq_node
31
{
32
protected
:
36
typedef
symlist<pq_node*>::iterator
iterator
;
37
41
enum
PQ_KIND
{P_NODE,
Q_NODE
, LEAF, DIR};
42
46
enum
PQ_MARK
{
UNMARKED
, QUEUED, BLOCKED, UNBLOCKED};
47
51
pq_node
(
node
n_,
int
id_) : pert_children(0),
52
pert_leaves(0),
53
mark (UNMARKED),
54
n
(n_),
55
id
(id_)
56
{
57
}
58
62
virtual
~
pq_node
();
63
68
virtual
PQ_KIND kind()
const
= 0;
69
74
virtual
void
partial(
iterator
)
75
{
76
}
77
82
virtual
void
full(
iterator
)
83
{
84
}
85
90
virtual
void
write
(ostream&,
int
) = 0;
91
96
virtual
void
clear()
97
{
98
mark = UNMARKED;
99
pert_leaves = 0;
100
pert_children = 0;
101
}
102
103
// type-casts
104
109
virtual
p_node
*
P
() = 0;
110
115
virtual
q_node
*
Q
() = 0;
116
121
virtual
direction_indicator
*
D
() = 0;
122
127
virtual
pq_leaf
*
L
() = 0;
128
129
//
130
// Data used in reductions
131
//
132
140
int
pert_children
;
141
148
int
pert_leaves
;
149
158
bool
is_endmost
;
159
166
pq_node
*
father
;
167
180
PQ_MARK
mark
;
181
186
symlist<pq_node*>
sons
;
187
192
iterator
pos
;
193
202
list<pq_node*>::iterator
lpos
;
203
204
//
205
// Application specific data (should become template parameter)
206
//
207
212
node
n
;
213
217
int
id
;
218
222
node
up
;
223
227
int
up_id
;
228
229
//
230
// Friends
231
//
232
237
friend
class
q_node
;
238
243
friend
class
p_node
;
244
249
friend
class
pq_tree
;
250
255
friend
class
planarity
;
256
261
GTL_EXTERN
friend
ostream&
operator<<
(ostream&,
const
pq_tree
&);
262
};
263
264
268
class
GTL_EXTERN
p_node
:
public
pq_node
269
{
270
private
:
274
p_node
(
node
,
int
);
275
279
p_node
(
node
,
int
,
symlist<pq_node*>
&);
280
281
//
282
// pq_node interface
283
//
284
288
void
partial
(
iterator
);
289
293
void
full
(
iterator
);
294
299
PQ_KIND
kind
()
const
300
{
301
return
P_NODE
;
302
}
303
308
void
write
(ostream&,
int
);
309
313
void
clear
();
314
315
// type-casts
316
321
p_node
*
P
()
322
{
323
return
this
;
324
}
325
330
q_node
*
Q
()
331
{
332
assert
(
false
);
333
return
0;
334
}
335
340
direction_indicator
*
D
()
341
{
342
assert
(
false
);
343
return
0;
344
}
345
350
pq_leaf
*
L
()
351
{
352
assert
(
false
);
353
return
0;
354
}
355
356
//
357
// Additional
358
//
359
365
symlist<pq_node*>
full_sons
;
366
372
symlist<pq_node*>
partial_sons
;
373
378
int
child_count
;
379
384
int
partial_count
;
385
390
int
full_count
;
391
392
//
393
// Friends
394
//
395
400
friend
class
planarity
;
401
406
friend
class
pq_tree
;
407
412
GTL_EXTERN
friend
ostream&
operator<<
(ostream&,
const
pq_tree
&);
413
};
414
415
419
class
GTL_EXTERN
q_node
:
public
pq_node
420
{
421
private
:
425
q_node
(
node
,
int
);
426
427
//
428
// pq_node interface
429
//
430
434
void
partial
(
iterator
);
435
439
void
full
(
iterator
);
440
445
PQ_KIND
kind
()
const
446
{
447
return
Q_NODE
;
448
}
449
454
void
write
(ostream&,
int
);
455
459
void
clear
();
460
461
// type-casts
462
467
p_node
*
P
()
468
{
469
assert
(
false
);
470
return
0;
471
}
472
477
q_node
*
Q
()
478
{
479
return
this
;
480
}
481
486
direction_indicator
*
D
()
487
{
488
assert
(
false
);
489
return
0;
490
}
491
496
pq_leaf
*
L
()
497
{
498
assert
(
false
);
499
return
0;
500
}
501
502
//
503
// Additional
504
//
505
511
void
pertinent(iterator);
512
519
q_node
* merge (iterator);
520
525
void
turn ();
526
532
iterator
pert_begin
;
533
538
iterator
pert_end
;
539
546
iterator
partial_pos[3];
547
555
bool
pert_cons
;
556
561
int
partial_count
;
562
567
int
full_count
;
568
569
//
570
// Friends
571
//
572
577
friend
class
planarity
;
578
583
friend
class
pq_tree
;
584
};
585
586
590
class
GTL_EXTERN
pq_leaf
:
public
pq_node
591
{
592
public
:
596
pq_leaf
(
int
,
int
,
edge
,
node
);
597
private
:
602
PQ_KIND
kind
()
const
603
{
604
return
LEAF
;
605
}
606
611
void
write
(ostream&,
int
);
612
613
// type-casts
614
619
p_node
*
P
()
620
{
621
assert
(
false
);
622
return
0;
623
}
624
629
q_node
*
Q
()
630
{
631
assert
(
false
);
632
return
0;
633
}
634
639
direction_indicator
*
D
()
640
{
641
assert
(
false
);
642
return
0;
643
}
644
649
pq_leaf
*
L
()
650
{
651
return
this
;
652
}
653
654
//
655
// Additional
656
//
657
661
int
other_id
;
662
666
edge
e
;
667
668
//
669
// Friends
670
//
671
676
friend
class
planarity
;
677
682
friend
class
pq_tree
;
683
};
684
685
689
class
GTL_EXTERN
direction_indicator
:
public
pq_node
690
{
691
private
:
695
direction_indicator
(
node
n_,
int
id_) :
pq_node
(n_, id_) { };
696
697
//
698
// pq_node interface
699
//
700
705
PQ_KIND
kind
()
const
706
{
707
return
DIR
;
708
}
709
714
void
write
(ostream&
os
,
int
);
715
716
// type-casts
717
722
p_node
*
P
()
723
{
724
assert
(
false
);
725
return
0;
726
}
727
732
q_node
*
Q
()
733
{
734
assert
(
false
);
735
return
0;
736
}
737
742
direction_indicator
*
D
()
743
{
744
return
this
;
745
}
746
751
pq_leaf
*
L
()
752
{
753
assert
(
false
);
754
return
0;
755
}
756
757
//
758
// Additional
759
//
760
764
bool
direction
;
765
766
//
767
// Friends
768
//
769
774
friend
class
planarity
;
775
780
friend
class
pq_tree
;
781
};
782
783
__GTL_END_NAMESPACE
784
785
#endif
786
787
//--------------------------------------------------------------------------
788
// end of file
789
//--------------------------------------------------------------------------
JETSCAPE
blob
main
external_packages
gtl
include
GTL
pq_node.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:23
using
1.8.2 with
sPHENIX GitHub integration