nysol-take 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. checksums.yaml +7 -0
  2. data/bin/mbiclique.rb +317 -0
  3. data/bin/mbipolish.rb +362 -0
  4. data/bin/mccomp.rb +235 -0
  5. data/bin/mclique.rb +295 -0
  6. data/bin/mclique2g.rb +105 -0
  7. data/bin/mcliqueInfo.rb +203 -0
  8. data/bin/mfriends.rb +202 -0
  9. data/bin/mgdiff.rb +252 -0
  10. data/bin/mhifriend.rb +456 -0
  11. data/bin/mhipolish.rb +465 -0
  12. data/bin/mitemset.rb +168 -0
  13. data/bin/mpal.rb +410 -0
  14. data/bin/mpolishing.rb +399 -0
  15. data/bin/msequence.rb +165 -0
  16. data/bin/mtra2g.rb +476 -0
  17. data/bin/mtra2gc.rb +360 -0
  18. data/ext/grhfilrun/extconf.rb +12 -0
  19. data/ext/grhfilrun/grhfilrun.c +85 -0
  20. data/ext/grhfilrun/src/_sspc.c +358 -0
  21. data/ext/grhfilrun/src/aheap.c +545 -0
  22. data/ext/grhfilrun/src/aheap.h +251 -0
  23. data/ext/grhfilrun/src/base.c +92 -0
  24. data/ext/grhfilrun/src/base.h +59 -0
  25. data/ext/grhfilrun/src/fstar.c +497 -0
  26. data/ext/grhfilrun/src/fstar.h +80 -0
  27. data/ext/grhfilrun/src/grhfil.c +214 -0
  28. data/ext/grhfilrun/src/itemset.c +713 -0
  29. data/ext/grhfilrun/src/itemset.h +170 -0
  30. data/ext/grhfilrun/src/problem.c +415 -0
  31. data/ext/grhfilrun/src/problem.h +179 -0
  32. data/ext/grhfilrun/src/queue.c +533 -0
  33. data/ext/grhfilrun/src/queue.h +182 -0
  34. data/ext/grhfilrun/src/sample.c +19 -0
  35. data/ext/grhfilrun/src/sspc.c +597 -0
  36. data/ext/grhfilrun/src/sspc2.c +491 -0
  37. data/ext/grhfilrun/src/stdlib2.c +1482 -0
  38. data/ext/grhfilrun/src/stdlib2.h +892 -0
  39. data/ext/grhfilrun/src/trsact.c +817 -0
  40. data/ext/grhfilrun/src/trsact.h +160 -0
  41. data/ext/grhfilrun/src/vec.c +745 -0
  42. data/ext/grhfilrun/src/vec.h +172 -0
  43. data/ext/lcmrun/extconf.rb +20 -0
  44. data/ext/lcmrun/lcmrun.cpp +99 -0
  45. data/ext/lcmrun/src/aheap.c +216 -0
  46. data/ext/lcmrun/src/aheap.h +111 -0
  47. data/ext/lcmrun/src/base.c +92 -0
  48. data/ext/lcmrun/src/base.h +59 -0
  49. data/ext/lcmrun/src/itemset.c +496 -0
  50. data/ext/lcmrun/src/itemset.h +157 -0
  51. data/ext/lcmrun/src/lcm.c +427 -0
  52. data/ext/lcmrun/src/problem.c +349 -0
  53. data/ext/lcmrun/src/problem.h +177 -0
  54. data/ext/lcmrun/src/queue.c +528 -0
  55. data/ext/lcmrun/src/queue.h +176 -0
  56. data/ext/lcmrun/src/sgraph.c +359 -0
  57. data/ext/lcmrun/src/sgraph.h +173 -0
  58. data/ext/lcmrun/src/stdlib2.c +1282 -0
  59. data/ext/lcmrun/src/stdlib2.h +823 -0
  60. data/ext/lcmrun/src/trsact.c +747 -0
  61. data/ext/lcmrun/src/trsact.h +159 -0
  62. data/ext/lcmrun/src/vec.c +731 -0
  63. data/ext/lcmrun/src/vec.h +171 -0
  64. data/ext/lcmseq0run/extconf.rb +20 -0
  65. data/ext/lcmseq0run/lcmseq0run.cpp +59 -0
  66. data/ext/lcmseq0run/src/aheap.c +216 -0
  67. data/ext/lcmseq0run/src/aheap.h +111 -0
  68. data/ext/lcmseq0run/src/base.c +92 -0
  69. data/ext/lcmseq0run/src/base.h +59 -0
  70. data/ext/lcmseq0run/src/itemset.c +518 -0
  71. data/ext/lcmseq0run/src/itemset.h +157 -0
  72. data/ext/lcmseq0run/src/itemset_zero.c +522 -0
  73. data/ext/lcmseq0run/src/lcm_seq.c +446 -0
  74. data/ext/lcmseq0run/src/lcm_seq_zero.c +446 -0
  75. data/ext/lcmseq0run/src/problem.c +439 -0
  76. data/ext/lcmseq0run/src/problem.h +179 -0
  77. data/ext/lcmseq0run/src/problem_zero.c +439 -0
  78. data/ext/lcmseq0run/src/queue.c +533 -0
  79. data/ext/lcmseq0run/src/queue.h +182 -0
  80. data/ext/lcmseq0run/src/stdlib2.c +1350 -0
  81. data/ext/lcmseq0run/src/stdlib2.h +864 -0
  82. data/ext/lcmseq0run/src/trsact.c +747 -0
  83. data/ext/lcmseq0run/src/trsact.h +159 -0
  84. data/ext/lcmseq0run/src/vec.c +779 -0
  85. data/ext/lcmseq0run/src/vec.h +172 -0
  86. data/ext/lcmseqrun/extconf.rb +20 -0
  87. data/ext/lcmseqrun/lcmseqrun.cpp +101 -0
  88. data/ext/lcmseqrun/src/aheap.c +216 -0
  89. data/ext/lcmseqrun/src/aheap.h +111 -0
  90. data/ext/lcmseqrun/src/base.c +92 -0
  91. data/ext/lcmseqrun/src/base.h +59 -0
  92. data/ext/lcmseqrun/src/itemset.c +518 -0
  93. data/ext/lcmseqrun/src/itemset.h +157 -0
  94. data/ext/lcmseqrun/src/itemset_zero.c +522 -0
  95. data/ext/lcmseqrun/src/lcm_seq.c +447 -0
  96. data/ext/lcmseqrun/src/lcm_seq_zero.c +446 -0
  97. data/ext/lcmseqrun/src/problem.c +439 -0
  98. data/ext/lcmseqrun/src/problem.h +179 -0
  99. data/ext/lcmseqrun/src/problem_zero.c +439 -0
  100. data/ext/lcmseqrun/src/queue.c +533 -0
  101. data/ext/lcmseqrun/src/queue.h +182 -0
  102. data/ext/lcmseqrun/src/stdlib2.c +1350 -0
  103. data/ext/lcmseqrun/src/stdlib2.h +864 -0
  104. data/ext/lcmseqrun/src/trsact.c +747 -0
  105. data/ext/lcmseqrun/src/trsact.h +159 -0
  106. data/ext/lcmseqrun/src/vec.c +779 -0
  107. data/ext/lcmseqrun/src/vec.h +172 -0
  108. data/ext/lcmtransrun/extconf.rb +18 -0
  109. data/ext/lcmtransrun/lcmtransrun.cpp +264 -0
  110. data/ext/macerun/extconf.rb +20 -0
  111. data/ext/macerun/macerun.cpp +57 -0
  112. data/ext/macerun/src/aheap.c +217 -0
  113. data/ext/macerun/src/aheap.h +112 -0
  114. data/ext/macerun/src/itemset.c +491 -0
  115. data/ext/macerun/src/itemset.h +158 -0
  116. data/ext/macerun/src/mace.c +503 -0
  117. data/ext/macerun/src/problem.c +346 -0
  118. data/ext/macerun/src/problem.h +174 -0
  119. data/ext/macerun/src/queue.c +529 -0
  120. data/ext/macerun/src/queue.h +177 -0
  121. data/ext/macerun/src/sgraph.c +360 -0
  122. data/ext/macerun/src/sgraph.h +174 -0
  123. data/ext/macerun/src/stdlib2.c +993 -0
  124. data/ext/macerun/src/stdlib2.h +811 -0
  125. data/ext/macerun/src/vec.c +634 -0
  126. data/ext/macerun/src/vec.h +170 -0
  127. data/ext/sspcrun/extconf.rb +20 -0
  128. data/ext/sspcrun/src/_sspc.c +358 -0
  129. data/ext/sspcrun/src/aheap.c +545 -0
  130. data/ext/sspcrun/src/aheap.h +251 -0
  131. data/ext/sspcrun/src/base.c +92 -0
  132. data/ext/sspcrun/src/base.h +59 -0
  133. data/ext/sspcrun/src/fstar.c +496 -0
  134. data/ext/sspcrun/src/fstar.h +80 -0
  135. data/ext/sspcrun/src/grhfil.c +213 -0
  136. data/ext/sspcrun/src/itemset.c +713 -0
  137. data/ext/sspcrun/src/itemset.h +170 -0
  138. data/ext/sspcrun/src/problem.c +415 -0
  139. data/ext/sspcrun/src/problem.h +179 -0
  140. data/ext/sspcrun/src/queue.c +533 -0
  141. data/ext/sspcrun/src/queue.h +182 -0
  142. data/ext/sspcrun/src/sample.c +19 -0
  143. data/ext/sspcrun/src/sspc.c +598 -0
  144. data/ext/sspcrun/src/sspc2.c +491 -0
  145. data/ext/sspcrun/src/stdlib2.c +1482 -0
  146. data/ext/sspcrun/src/stdlib2.h +892 -0
  147. data/ext/sspcrun/src/trsact.c +817 -0
  148. data/ext/sspcrun/src/trsact.h +160 -0
  149. data/ext/sspcrun/src/vec.c +745 -0
  150. data/ext/sspcrun/src/vec.h +172 -0
  151. data/ext/sspcrun/sspcrun.cpp +54 -0
  152. data/lib/nysol/enumLcmEp.rb +338 -0
  153. data/lib/nysol/enumLcmEsp.rb +284 -0
  154. data/lib/nysol/enumLcmIs.rb +275 -0
  155. data/lib/nysol/enumLcmSeq.rb +143 -0
  156. data/lib/nysol/items.rb +201 -0
  157. data/lib/nysol/seqDB.rb +256 -0
  158. data/lib/nysol/take.rb +39 -0
  159. data/lib/nysol/taxonomy.rb +113 -0
  160. data/lib/nysol/traDB.rb +257 -0
  161. metadata +239 -0
@@ -0,0 +1,533 @@
1
+ /* Library of queue: spped priority implementation
2
+ 12/Apr/2001 by Takeaki Uno e-mail:uno@nii.jp,
3
+ homepage: http://research.nii.ac.jp/~uno/index.html */
4
+ /* This program is available for only academic use, basically.
5
+ Anyone can modify this program, but he/she has to write down
6
+ the change of the modification on the top of the source code.
7
+ Neither contact nor appointment to Takeaki Uno is needed.
8
+ If one wants to re-distribute this code, please
9
+ refer the newest code, and show the link to homepage of
10
+ Takeaki Uno, to notify the news about the codes for the users. */
11
+
12
+ #ifndef _queue_c_
13
+ #define _queue_c_
14
+
15
+
16
+ #include"queue.h"
17
+ #include"stdlib2.c"
18
+
19
+ QSORT_TYPE(QUEUE_INT, QUEUE_INT)
20
+ QSORT_TYPE(QUEUE_ID, QUEUE_ID)
21
+ QUEUE INIT_QUEUE = {TYPE_QUEUE,NULL,0,0,0};
22
+ QUEUE_INT *common_QUEUE_INTp;
23
+
24
+ /* initialization, not fill the memory by 0 */
25
+ void QUEUE_alloc (QUEUE *Q, QUEUE_ID siz){
26
+ *Q = INIT_QUEUE;
27
+ Q->end = siz+1;
28
+ malloc2 (Q->v, siz+1, EXIT);
29
+ }
30
+
31
+ /* termination processing */
32
+ void QUEUE_end (QUEUE *Q){
33
+ free2 (Q->v);
34
+ *Q = INIT_QUEUE;
35
+ }
36
+
37
+ /* tranpose the matrix ; counting/transpose/memory_allocate */
38
+ /* OQ: QUEUE to transposed matrix, c: count the column sizes if its given
39
+ jump: QUEUE to store ID's of non-empty columns, Q: the matrix, occ: the rows to be transposed
40
+ t: if occ=NULL, Q[0] to Q[t-1] will be transposed, M: maximum column ID to be transposed */
41
+ void QUEUE_delivery(QUEUE *OQ, VEC_ID *c, QUEUE *jump, QUEUE *Q, QUEUE *occ, VEC_ID t, QUEUE_INT M){ VEC_ID i, e;
42
+ QUEUE_INT *x;
43
+ FLOOP(i, 0, occ? occ->t: t){
44
+ e = occ? occ->v[i]: i;
45
+ if ( c ){
46
+ if ( jump ){ MLOOP (x, Q[e].v, M){ if ( c[*x]==0 ) QUE_INS (*jump, *x); c[*x]++; }
47
+ } else { MLOOP (x, Q[e].v, M) c[*x]++; }
48
+ } else {
49
+ if ( jump ){ MLOOP (x, Q[e].v, M){ if ( OQ[*x].t==0 ) QUE_INS (*jump, *x); QUE_INS (OQ[*x], e); }
50
+ } else MLOOP (x, Q[e].v, M){ QUE_INS (OQ[*x], e); }
51
+ }
52
+ }
53
+ }
54
+
55
+ /* sort a QUEUE with WEIGHT, with already allocated memory */
56
+ void QUEUE_perm_WEIGHT (QUEUE *Q, WEIGHT *w, PERM *invperm, int flag){
57
+ WEIGHT y;
58
+ if ( w ){
59
+ ARY_INIT_PERM (invperm, Q->t);
60
+ qsort_perm__QUEUE_INT (Q->v, Q->t, invperm, flag);
61
+ ARY_INVPERMUTE_ (w, invperm, y, Q->t);
62
+ }
63
+ qsort_QUEUE_INT (Q->v, Q->t, flag);
64
+ }
65
+
66
+ /* remove (or unify) the consecutive same ID's in a QUEUE (duplication delete, if sorted) */
67
+ void QUEUE_rm_dup_WEIGHT (QUEUE *Q, WEIGHT *w){
68
+ VEC_ID j, jj=0;
69
+ if ( w ){
70
+ FLOOP (j, 1, Q->t){
71
+ if ( Q->v[j-1] != Q->v[j] ){
72
+ Q->v[++jj] = Q->v[j];
73
+ w[jj] = w[j];
74
+ } else w[jj] += w[j];
75
+ }
76
+ } else FLOOP (j, 1, Q->t){
77
+ if ( Q->v[j-1] != Q->v[j] ) Q->v[++jj] = Q->v[j];
78
+ }
79
+ if ( Q->t>0 ) Q->t = jj+1;
80
+ }
81
+
82
+ /***********************************************************************/
83
+ /* duplicate occ's in jump, ( copy occ's to allocated QUEUE array) */
84
+ /* Q[i].end := original item, clear each original occ */
85
+ /* buffer size is multiplied by u */
86
+ /*******************************************************/
87
+ void QUEUE_occ_dup (QUEUE *jump, QUEUE **QQ, QUEUE *Q, WEIGHT **ww, WEIGHT *w, WEIGHT **ppw, WEIGHT *pw, int u){
88
+ QUEUE_ID i, l=QUEUE_LENGTH_(*jump);
89
+ size_t cnt=0;
90
+ QUEUE_INT e, *x;
91
+ char *buf;
92
+ int unit = sizeof(*Q) + (w?sizeof(*w):0) + (pw?sizeof(*pw):0);
93
+
94
+ ENMAX (u, sizeof(*x));
95
+ MQUE_FLOOP (*jump, x) cnt += Q[*x].t;
96
+ if ( cnt == 0 ){ *QQ=NULL; return; }
97
+ malloc2 (buf, l*unit + (cnt+l)*u, EXIT);
98
+ *QQ = (QUEUE*)buf; buf += sizeof(*Q) *l;
99
+ if ( w ){ *ww = (WEIGHT *)buf; buf += sizeof(*w)*l; }
100
+ if ( pw ){ *ppw = (WEIGHT *)buf; buf += sizeof(*pw)*l; }
101
+ for (i=0 ; i<jump->t ; i++){
102
+ e = jump->v[i];
103
+ (*QQ)[i].end = e;
104
+ (*QQ)[i].v = (QUEUE_INT *)buf;
105
+ (*QQ)[i].t = Q[e].t;
106
+ memcpy (buf, Q[e].v, (Q[e].t+1)*u);
107
+ buf += (Q[e].t+1) *u;
108
+ if ( w ) (*ww)[i] = w[e];
109
+ if ( pw ) (*ppw)[i] = pw[e];
110
+ }
111
+ }
112
+
113
+
114
+ /* return the position of the first element having value e. return -1 if no such element exists */
115
+ LONG QUEUE_ele (QUEUE *Q, QUEUE_INT e){
116
+ QUEUE_INT *x;
117
+ MQUE_FLOOP (*Q, x)
118
+ if ( *x == e ) return (x - Q->v);
119
+ return (-1);
120
+ }
121
+
122
+ /* insert an element to the tail */
123
+ void QUEUE_ins_ (QUEUE *Q, QUEUE_INT e){
124
+ Q->v[Q->t] = e;
125
+ Q->t++;
126
+ }
127
+ void QUEUE_ins (QUEUE *Q, QUEUE_INT e){
128
+ Q->v[Q->t] = e;
129
+ QUEUE_INCREMENT (*Q, Q->t);
130
+ if (Q->s == Q->t ) error_num ("QUEUE_ins: overflow", Q->s, EXIT);
131
+ }
132
+
133
+ /* insert an element to the head */
134
+ void QUEUE_ins_head_ (QUEUE *Q, QUEUE_INT e){
135
+ Q->s--;
136
+ Q->v[Q->s] = e;
137
+ }
138
+ void QUEUE_ins_head (QUEUE *Q, QUEUE_INT e){
139
+ QUEUE_DECREMENT(*Q,Q->s);
140
+ Q->v[Q->s] = e;
141
+ if (Q->s == Q->t ) error_num ("QUEUE_ins_head: underflow", Q->s, EXIT);
142
+ }
143
+
144
+ /* extract an element from the head, without checking underflow */
145
+ QUEUE_INT QUEUE_ext_ (QUEUE *Q){
146
+ (Q->s)++;
147
+ return (Q->v[Q->s-1]);
148
+ }
149
+ QUEUE_INT QUEUE_ext (QUEUE *Q){
150
+ QUEUE_INT e;
151
+ if (Q->s == Q->t ) error_num ("QUEUE_ext: empty queue", Q->s, EXIT0);
152
+ e = Q->v[Q->s];
153
+ QUEUE_INCREMENT(*Q,Q->s);
154
+ return ( e);
155
+ }
156
+
157
+ /* extract an element from the tail, without checking underflow */
158
+ QUEUE_INT QUEUE_ext_tail_ (QUEUE *Q){
159
+ (Q->t)--;
160
+ return (Q->v[Q->t]);
161
+ }
162
+ QUEUE_INT QUEUE_ext_tail (QUEUE *Q){
163
+ if ( Q->s == Q->t ) error_num ("QUEUE_ext_tail: empty queue", Q->s, EXIT0);
164
+ QUEUE_DECREMENT(*Q,Q->t);
165
+ return (Q->v[Q->t]);
166
+ }
167
+
168
+ /* remove the j-th element and replace it by the tail */
169
+ void QUEUE_rm_ (QUEUE *Q, QUEUE_ID j){
170
+ Q->t--;
171
+ Q->v[j] = Q->v[Q->t];
172
+ }
173
+ void QUEUE_rm (QUEUE *Q, QUEUE_ID j){
174
+ if ( Q->s <= Q->t ){
175
+ if ( j < Q->s || j >= Q->t ) error ("QUEUE_rm: j is out of queue", EXIT);
176
+ } else if ( j < Q->s && j >= Q->t ) error ("QUEUE_rm: j is out of queue", EXIT);
177
+ QUEUE_DECREMENT(*Q,Q->t);
178
+ Q->v[j] = Q->v[Q->t];
179
+ }
180
+
181
+ /* remove the j-th element and replace it by the head */
182
+ void QUEUE_rm_head_ (QUEUE *Q, QUEUE_ID j){
183
+ Q->v[j] = Q->v[Q->s];
184
+ Q->s++;
185
+ }
186
+ void QUEUE_rm_head (QUEUE *Q, QUEUE_ID j){
187
+ if ( Q->s <= Q->t ){
188
+ if ( j < Q->s || j >= Q->t ) error ("QUEUE_rm: j is out of queue", EXIT);
189
+ } else if ( j < Q->s && j >= Q->t ) error ("QUEUE_rm: j is out of queue", EXIT);
190
+ Q->v[j] = Q->v[Q->s];
191
+ QUEUE_INCREMENT(*Q,Q->s);
192
+ }
193
+
194
+ /* remove the j-th element and shift the following elements to fill the gap */
195
+ int QUEUE_rm_ele_ (QUEUE *Q, QUEUE_INT e){
196
+ QUEUE_ID i;
197
+ QUEUE_F_LOOP (*Q, i){
198
+ if ( Q->v[i] == e ){
199
+ memcpy ( &(Q->v[i]), &(Q->v[i+1]), (Q->t-i-1)*sizeof(QUEUE_INT));
200
+ Q->t--;
201
+ return (1);
202
+ }
203
+ }
204
+ return (0);
205
+ }
206
+ /* insert e to the position determined by the increasing order of elements */
207
+ void QUEUE_ins_ele_ (QUEUE *Q, QUEUE_INT e){
208
+ QUEUE_ID i;
209
+ QUEUE_INT ee;
210
+ QUEUE_BE_LOOP_ (*Q, i, ee){
211
+ if ( ee<e ) break;
212
+ Q->v[i+1] = ee;
213
+ }
214
+ Q->v[i+1] = e;
215
+ Q->t++;
216
+ }
217
+
218
+ /* Append Q2 to the tail of Q1. Q2 will not be deleted */
219
+ void QUEUE_concat_ (QUEUE *Q1, QUEUE *Q2){
220
+ memcpy ( &(Q1->v[Q1->t]), &(Q2->v[Q2->s]), (Q2->t-Q2->s)*sizeof(QUEUE_INT));
221
+ Q1->t += Q2->t-Q2->s;
222
+ }
223
+ void QUEUE_concat (QUEUE *Q1, QUEUE *Q2){
224
+ QUEUE_ID e = Q2->s;
225
+ while ( e != Q2->t){
226
+ QUEUE_ins (Q1, Q2->v[e]);
227
+ QUEUE_INCREMENT(*Q2,e);
228
+ }
229
+ }
230
+ /* Append Q2 to the tail of Q1. Q2 will be deleted */
231
+ void QUEUE_append_ (QUEUE *Q1, QUEUE *Q2){
232
+ QUEUE_concat_ (Q1, Q2);
233
+ QUEUE_RMALL (*Q2);
234
+ }
235
+ void QUEUE_append (QUEUE *Q1, QUEUE *Q2){ // more improvement can be
236
+ while ( Q2->s != Q2->t )
237
+ QUEUE_ins (Q1, QUEUE_ext(Q2));
238
+ }
239
+
240
+ /* Append from j to jj th elements to the tail of Q1. Q2 will not be deleted */
241
+ void QUEUE_subconcat_ (QUEUE *Q1, QUEUE *Q2, QUEUE_ID j, QUEUE_ID jj){
242
+ for ( ; j<=jj ; j++){
243
+ Q1->v[Q1->t] = Q2->v[j];
244
+ Q1->t++;
245
+ }
246
+ }
247
+ void QUEUE_subconcat (QUEUE *Q1, QUEUE *Q2, QUEUE_ID j, QUEUE_ID jj){
248
+ while (1){
249
+ QUEUE_ins (Q1, Q2->v[j]);
250
+ if ( j == jj ) break;
251
+ QUEUE_INCREMENT(*Q2,j);
252
+ }
253
+ }
254
+
255
+ /* initialize Q1 by length of Q2, and copy Q2 to Q1 */
256
+ void QUEUE_store_ (QUEUE *Q1, QUEUE *Q2){
257
+ QUEUE_alloc (Q1, QUEUE_LENGTH(*Q2));
258
+ QUEUE_concat_ (Q1, Q2);
259
+ }
260
+ void QUEUE_store (QUEUE *Q1, QUEUE *Q2){
261
+ QUEUE_alloc (Q1, QUEUE_LENGTH(*Q2));
262
+ QUEUE_concat (Q1, Q2);
263
+ }
264
+ /* copy Q2 to Q1 and delete Q2 */
265
+ void QUEUE_restore_ (QUEUE *Q1, QUEUE *Q2){
266
+ QUEUE_RMALL (*Q1);
267
+ QUEUE_concat_ (Q1, Q2);
268
+ QUEUE_end (Q2);
269
+ }
270
+ void QUEUE_restore (QUEUE *Q1, QUEUE *Q2){
271
+ QUEUE_RMALL (*Q1);
272
+ QUEUE_concat (Q1, Q2);
273
+ QUEUE_end (Q2);
274
+ }
275
+
276
+ /* copy Q2 to Q1 */
277
+ void QUEUE_cpy_ (QUEUE *Q1, QUEUE *Q2){
278
+ Q1->s = Q1->t = 0;
279
+ QUEUE_concat_ (Q1, Q2);
280
+ }
281
+ void QUEUE_cpy (QUEUE *Q1, QUEUE *Q2){
282
+ QUEUE_RMALL (*Q1);
283
+ QUEUE_concat (Q1, Q2);
284
+ }
285
+
286
+ /* compare two queues */
287
+ int QUEUE_cmp_ (QUEUE *Q1, QUEUE *Q2){
288
+ QUEUE_INT *x, *y=Q2->v;
289
+ MQUE_FLOOP (*Q1, x){
290
+ if ( *x != *y ) return (0);
291
+ y++;
292
+ }
293
+ return (1);
294
+ }
295
+
296
+ /* copy l elements of Q2 starting from s2 to the s1th position of Q1.
297
+ size of Q1 is not increasing */
298
+ void QUEUE_subcpy_ (QUEUE *Q1, QUEUE_ID s1, QUEUE *Q2, QUEUE_ID s2, QUEUE_ID l){
299
+ memcpy ( &(Q1->v[s1]), &(Q2->v[s2]), (l-s2)*sizeof(QUEUE_INT));
300
+ }
301
+ void QUEUE_subcpy (QUEUE *Q1, QUEUE_ID s1, QUEUE *Q2, QUEUE_ID s2, QUEUE_ID l){
302
+ for ( ; s2!=l ; QUEUE_INCREMENT(*Q1,s1),QUEUE_INCREMENT(*Q2,s2) )
303
+ Q1->v[s1] = Q2->v[s2];
304
+ Q1->v[s1] = Q2->v[s2];
305
+ }
306
+
307
+ /* duplicate Q2 to Q1. The memory size will be the length of Q2 */
308
+ QUEUE QUEUE_dup_ (QUEUE *Q){
309
+ QUEUE QQ;
310
+ QUEUE_alloc (&QQ, MAX(Q->t+1, Q->end-1));
311
+ QUEUE_cpy_ (&QQ, Q);
312
+ return (QQ);
313
+ }
314
+
315
+ /* merge Q1 and Q2 by insert all elements of Q2 to Q1 with deleting duplications. Both Q1 and Q2 have to be sorted in increasing order */
316
+ void QUEUE_merge_ (QUEUE *Q1, QUEUE *Q2){
317
+ QUEUE_ID i=Q1->t-1, j=Q2->t-1, t=i+j-Q2->s+1;
318
+ QUEUE_INT ei, ej;
319
+ if ( i+1 == Q1->s || j+1 == Q2->s ){
320
+ QUEUE_concat_ (Q1, Q2);
321
+ return;
322
+ }
323
+ Q1->t = t+1;
324
+ ei = Q1->v[i];
325
+ ej = Q2->v[j];
326
+ while (1){
327
+ if ( ei > ej ){
328
+ Q1->v[t] = ei;
329
+ if ( i == Q1->s ){
330
+ QUEUE_subcpy_ (Q1, Q1->s, Q2, Q2->s, j);
331
+ return;
332
+ }
333
+ i--;
334
+ ei = Q1->v[i];
335
+ } else {
336
+ Q1->v[t] = ej;
337
+ if ( j == Q2->s ) return;
338
+ j--;
339
+ ej = Q2->v[j];
340
+ }
341
+ t--;
342
+ }
343
+ }
344
+ void QUEUE_merge (QUEUE *Q1, QUEUE *Q2){
345
+ QUEUE_ID i=Q1->t, j=Q2->t;
346
+ QUEUE_INT ei, ej;
347
+ QUEUE_ID t = (Q1->t + QUEUE_LENGTH(*Q2)-1) % Q1->end;
348
+ if ( QUEUE_LENGTH(*Q1) + QUEUE_LENGTH(*Q2) >= Q1->end ){
349
+ print_err ("QUEUE_merge: overflow Q1->end="QUEUE_INTF", Q1length="QUEUE_INTF", Q2length="QUEUE_INTF"\n", Q1->end, QUEUE_LENGTH(*Q1), QUEUE_LENGTH(*Q2));
350
+ exit (1);
351
+ }
352
+ if ( i == Q1->s || j == Q2->s ){
353
+ QUEUE_concat (Q1, Q2);
354
+ return;
355
+ }
356
+
357
+ Q1->t = t;
358
+ QUEUE_DECREMENT(*Q1,i);
359
+ QUEUE_DECREMENT(*Q2,j);
360
+ ei = Q1->v[i];
361
+ ej = Q2->v[j];
362
+ while (1){
363
+ if ( ei > ej ){
364
+ Q1->v[t] = ei;
365
+ if ( i == Q1->s ){
366
+ QUEUE_subcpy (Q1, Q1->s, Q2, Q2->s, (j+Q2->end-Q2->s)%Q2->end);
367
+ return;
368
+ }
369
+ QUEUE_DECREMENT(*Q1,i);
370
+ ei = Q1->v[i];
371
+ } else {
372
+ Q1->v[t] = ej;
373
+ if ( j == Q2->s ) return;
374
+ QUEUE_DECREMENT(*Q2,j);
375
+ ej = Q2->v[j];
376
+ }
377
+ QUEUE_DECREMENT(*Q1,t);
378
+ }
379
+ }
380
+
381
+ /* delete all elements of Q1 included in Q2.
382
+ both Q1 and Q2 have to be sorted in increasing order */
383
+ void QUEUE_minus_ (QUEUE *Q1, QUEUE *Q2){
384
+ QUEUE_ID i=Q1->s, i2 = Q2->s, ii=Q1->s;
385
+ while ( i != Q1->t && i2 != Q2->t){
386
+ if (Q1->v[i] > Q2->v[i2] ) i2++;
387
+ else {
388
+ if (Q1->v[i] < Q2->v[i2] ){
389
+ Q1->v[ii] = Q1->v[i];
390
+ ii++;
391
+ }
392
+ i++;
393
+ }
394
+ }
395
+ while ( i != Q1->t ){
396
+ Q1->v[ii] = Q1->v[i];
397
+ i++;
398
+ ii++;
399
+ }
400
+ Q1->t = ii;
401
+ }
402
+ void QUEUE_minus (QUEUE *Q1, QUEUE *Q2){
403
+ QUEUE_ID i=Q1->s, i2 = Q2->s, ii=Q1->s;
404
+ while ( i != Q1->t && i2 != Q2->t ){
405
+ if ( Q1->v[i] > Q2->v[i2] ) QUEUE_INCREMENT (*Q2, i2);
406
+ else {
407
+ if ( Q1->v[i] < Q2->v[i2] ){
408
+ Q1->v[ii] = Q1->v[i];
409
+ QUEUE_INCREMENT (*Q1, ii);
410
+ }
411
+ QUEUE_INCREMENT (*Q1, i);
412
+ }
413
+ }
414
+ while ( i != Q1->t ){
415
+ Q1->v[ii] = Q1->v[i];
416
+ QUEUE_INCREMENT (*Q1, i);
417
+ QUEUE_INCREMENT (*Q1, ii);
418
+ }
419
+ Q1->t = ii;
420
+ }
421
+
422
+ /* Delete all elements of Q1 which are not included in Q2.
423
+ both Q1 and Q2 have to be sorted in increasing order */
424
+ QUEUE_ID QUEUE_intsec_ (QUEUE *Q1, QUEUE *Q2){
425
+ QUEUE_ID i=Q1->s, i2 = Q2->s, c=0;
426
+ while ( i != Q1->t ){
427
+ if ( Q1->v[i] > Q2->v[i2] ){
428
+ if ( ++i2 == Q2->t ) break;
429
+ } else {
430
+ if ( Q1->v[i] == Q2->v[i2] ) c++;
431
+ i++;
432
+ }
433
+ }
434
+ return (c);
435
+ }
436
+ void QUEUE_and_ (QUEUE *Q1, QUEUE *Q2){
437
+ QUEUE_ID i=Q1->s, i2 = Q2->s, ii=Q1->s;
438
+ while ( i != Q1->t ){
439
+ if ( Q1->v[i] > Q2->v[i2] ){
440
+ if ( ++i2 == Q2->t ) break;
441
+ } else {
442
+ if ( Q1->v[i] == Q2->v[i2] ) Q1->v[ii++] = Q1->v[i];
443
+ i++;
444
+ }
445
+ }
446
+ Q1->t = ii;
447
+ }
448
+ void QUEUE_and (QUEUE *Q1, QUEUE *Q2){
449
+ QUEUE_ID i=Q1->s, i2 = Q2->s, ii=Q1->s;
450
+ while ( i != Q1->t && i2 != Q2->t){
451
+ if ( Q1->v[i] > Q2->v[i2] ) QUEUE_INCREMENT (*Q2, i2);
452
+ else {
453
+ if ( Q1->v[i] == Q2->v[i2] ){
454
+ Q1->v[ii] = Q1->v[i];
455
+ QUEUE_INCREMENT (*Q1, ii);
456
+ }
457
+ QUEUE_INCREMENT (*Q1, i);
458
+ }
459
+ }
460
+ Q1->t = ii;
461
+ }
462
+
463
+ /* insertion sort */
464
+ void QUEUE_sort (QUEUE *Q){
465
+ QUEUE_ID i = Q->s, j, jj;
466
+ QUEUE_INT e;
467
+ if ( i== Q->t ) return;
468
+ QUEUE_INCREMENT(*Q,i);
469
+ for ( ; i!=Q->t ; QUEUE_INCREMENT(*Q,i) ){
470
+ e=Q->v[i];
471
+ j=i;
472
+ while (1){
473
+ jj = j;
474
+ QUEUE_DECREMENT(*Q,j);
475
+ if ( Q->v[j] <= e ) { Q->v[jj] = e; break; }
476
+ Q->v[jj] = Q->v[j];
477
+ if ( j == Q->s) { Q->v[j] = e; break; }
478
+ }
479
+ }
480
+ }
481
+
482
+
483
+ /* print a queue */
484
+ void QUEUE_print (QUEUE *Q){
485
+ QUEUE_ID i;
486
+ for ( i=Q->s ; i!=Q->t ; ){
487
+ printf (QUEUE_INTF" ", Q->v[i]);
488
+ QUEUE_INCREMENT(*Q,i);
489
+ }
490
+ printf ("\n");
491
+ }
492
+ /* permutation version */
493
+ void QUEUE_perm_print (QUEUE *Q, QUEUE_ID *q){
494
+ QUEUE_ID i;
495
+ for ( i=Q->s ; i!=Q->t ; ){
496
+ printf (QUEUE_INTF" ", q[Q->v[i]]);
497
+ QUEUE_INCREMENT(*Q,i);
498
+ }
499
+ printf ("\n");
500
+ }
501
+ void QUEUE_printn (QUEUE *Q){
502
+ QUEUE_ID i;
503
+ for ( i=Q->s ; i!=Q->t ; ){
504
+ printf (QUEUE_INTF" ", Q->v[i]);
505
+ QUEUE_INCREMENT(*Q,i);
506
+ }
507
+ }
508
+ void QUEUE_perm_printn (QUEUE *Q, QUEUE_ID *q){
509
+ QUEUE_ID i;
510
+ for ( i=Q->s ; i!=Q->t ; ){
511
+ printf (QUEUE_INTF" ",q[Q->v[i]]);
512
+ QUEUE_INCREMENT(*Q,i);
513
+ }
514
+ }
515
+ void QUEUE_print_ (QUEUE *Q){
516
+ QUEUE_ID i;
517
+ printf("s="QUEUE_IDF",t="QUEUE_INTF": ", Q->s, Q->t);
518
+ for ( i=Q->s ; i!=Q->t ; ){
519
+ printf (QUEUE_INTF" ",Q->v[i]);
520
+ QUEUE_INCREMENT(*Q,i);
521
+ }
522
+ printf ("\n");
523
+ }
524
+
525
+ void QUEUE_print__ (QUEUE *Q){
526
+ QUEUE_ID i;
527
+ printf("s="QUEUE_IDF",t="QUEUE_IDF": ", Q->s, Q->t);
528
+ for ( i=Q->s ; i!=Q->t ; i++ ) printf (QUEUE_INTF" ",Q->v[i]);
529
+ printf ("\n");
530
+ }
531
+
532
+
533
+ #endif
@@ -0,0 +1,182 @@
1
+ /* Library of queue: spped priority implementation
2
+ 12/Apr/2001 by Takeaki Uno e-mail:uno@nii.jp,
3
+ homepage: http://research.nii.ac.jp/~uno/index.html */
4
+ /* This program is available for only academic use, basically.
5
+ Anyone can modify this program, but he/she has to write down
6
+ the change of the modification on the top of the source code.
7
+ Neither contact nor appointment to Takeaki Uno is needed.
8
+ If one wants to re-distribute this code, please
9
+ refer the newest code, and show the link to homepage of
10
+ Takeaki Uno, to notify the news about the codes for the users. */
11
+
12
+ #ifndef _queue_h_
13
+ #define _queue_h_
14
+
15
+ #include"stdlib2.h"
16
+
17
+ #ifndef QUEUE_INT
18
+ #ifdef QUEUE_INT_LONG
19
+ #define QUEUE_INT LONG // define the type before if change is needed
20
+ #define QUEUE_INTHUGE LONGHUGE // comment out if QUEUE_INT is "short"
21
+ #define QUEUE_INTF LONGF
22
+ #ifndef QUEUE_INT_END
23
+ #define QUEUE_INT_END LONGHUGE
24
+ #endif
25
+ #else
26
+ #define QUEUE_INT int // define the type before if change is needed
27
+ #define QUEUE_INTHUGE INTHUGE // comment out if QUEUE_INT is "short"
28
+ #define QUEUE_INTF "%d"
29
+ #ifndef QUEUE_INT_END
30
+ #define QUEUE_INT_END INTHUGE
31
+ #endif
32
+ #endif
33
+ #endif
34
+
35
+ #ifndef QUEUE_ID
36
+ #ifdef QUEUE_ID_LONG
37
+ #define QUEUE_ID LONG // define the type before if change is needed
38
+ #define QUEUE_IDHUGE LONGHUGE // comment out if QUEUE_INT is "short"
39
+ #define QUEUE_IDF LONGF
40
+ #else
41
+ #define QUEUE_ID int // define the type before if change is needed
42
+ #define QUEUE_IDHUGE INTHUGE // comment out if QUEUE_INT is "short"
43
+ #define QUEUE_IDF "%d"
44
+ #endif
45
+ #endif
46
+ #define SWAP_QUEUE_INT(a,b) (common_QUEUE_INT=a,a=b,b=common_QUEUE_INT)
47
+ #define SWAP_QUEUE_ID(a,b) (common_QUEUE_ID=a,a=b,b=common_QUEUE_ID)
48
+
49
+ typedef struct {
50
+ unsigned char type; // type of the structure
51
+ QUEUE_INT *v; // pointer to the array
52
+ QUEUE_ID end; // the length of the array
53
+ QUEUE_ID t; // end position+1
54
+ QUEUE_ID s; // start position
55
+ } QUEUE;
56
+
57
+ /* QUEUE stores at most end-1 elements. Overflow occurs after inserting end-1 elements */
58
+
59
+ #define QUEUE_INCREMENT(Q,i) ((i)=((i)>=(Q).end-1)?0:(i)+1)
60
+ #define QUEUE_DECREMENT(Q,i) ((i)=(i)==0?(Q).end-1:(i)-1)
61
+ #define QUEUE_LENGTH(Q) (((Q).t-(Q).s+(Q).end)%(Q).end)
62
+ #define QUEUE_LENGTH_(Q) ((Q).t-(Q).s)
63
+
64
+ /* macro for loop w.r.t., QUEUE */
65
+ #define QUEUE_F_LOOP(Q,i) for((i)=(Q).s;(i)!=(Q).t;((i)=((i)>=(Q).end-1)?0:(i)+1))
66
+ #define QUEUE_F_LOOP_(Q,i) for((i)=(Q).s;(i)<(Q).t;(i)++)
67
+ #define QUEUE_FE_LOOP(Q,i,x) for((i)=(Q).s,x=(Q).v[i];(i)!=(Q).t;((i)=((i)>=(Q).end-1)?0:(i)+1),x=(Q).v[i])
68
+ #define QUEUE_FE_LOOP_(Q,i,x) for((i)=(Q).s,x=(Q).v[i];(i)<(Q).t;(i)++,x=(Q).v[i])
69
+ #define QUEUE_B_LOOP(Q,i) for((i)=(Q).t==0?(Q).end-1:(Q).t-1;(i)!=(Q).s;(i)=(i)==0?(Q).end-1:(i)-1)
70
+ #define QUEUE_B_LOOP_(Q,i) for((i)=(Q).t-1;(i)>=(Q).s;(i)--)
71
+ #define QUEUE_BE_LOOP(Q,i,x) for((i)=(Q).t==0?(Q).end-1:(Q).t-1,x=(Q).v[i];(i)!=(Q).s;(i)=(i)==0?(Q).end-1:(i)-1,x=(Q).v[i])
72
+ #define QUEUE_BE_LOOP_(Q,i,x) for((i)=(Q).t-1;((i)>=(Q).s)?((x=(Q).v[i])||1):0;(i)--)
73
+
74
+ #define QUEUE_RMALL(Q) ((Q).t=(Q).s)
75
+ #define QUEUE_RMALL_(Q) ((Q).t=0)
76
+ #define QUEUE_HEAD(Q) ((Q).v[(Q).s])
77
+ #define QUEUE_TAIL_(Q) ((Q).v[(Q).t-1])
78
+
79
+ extern QUEUE INIT_QUEUE;
80
+ extern QUEUE_INT common_QUEUE_INT, *common_QUEUE_INTp;
81
+ QSORT_TYPE_HEADER(QUEUE_INT, QUEUE_INT)
82
+ QSORT_TYPE_HEADER(QUEUE_ID, QUEUE_ID)
83
+
84
+
85
+ /* initialization, not fill the memory by 0 */
86
+ void QUEUE_alloc (QUEUE *Q, QUEUE_ID siz);
87
+
88
+ /* termination processing */
89
+ void QUEUE_end (QUEUE *Q);
90
+
91
+ /* delivery: transpose that matrinx (transaction database) Q. Each row of the
92
+ transposed matrix is called occurrence.
93
+
94
+ variables to be set.
95
+ OQ:array for occurrences, c: for counting frequency, jump: list of items with non-empty OQ
96
+ if c!=NULL, count the frequency and set to c, and set occurrences to OQ, otherwise.
97
+ if jump==NULL, then the list of non-empty item will not be generated
98
+ Q:matrix, of an array of QUEUE, occ: list of rows of Q to be scaned, t; maximum ID of the
99
+ row to be scaned; if occ==NULL, occ will be ignored, otherwise t will be ignored.
100
+ M: end mark of each QUEUE. */
101
+ void QUEUE_delivery(QUEUE *OQ, VEC_ID *c, QUEUE *jump, QUEUE *Q, QUEUE *occ, VEC_ID t, QUEUE_INT M);
102
+ /* sort a QUEUE with WEIGHT, with already allocated memory (size have to no less than the size of QUEUE) */
103
+ void QUEUE_perm_WEIGHT (QUEUE *Q, WEIGHT *w, PERM *invperm, int flag);
104
+
105
+ /* remove (or unify) the consecutive same ID's in a QUEUE (duplication delete, if sorted) */
106
+ void QUEUE_rm_dup_WEIGHT (QUEUE *Q, WEIGHT *w);
107
+
108
+ /***********************************************************************/
109
+ /* duplicate occ's in jump, ( copy occ's to allocated QUEUE array) */
110
+ /* Q[i].end := original item, clear each original occ */
111
+ /* buffer size is multiplied by u */
112
+ /*******************************************************/
113
+
114
+
115
+ void QUEUE_occ_dup (QUEUE *jump, QUEUE **QQ, QUEUE *Q, WEIGHT **ww, WEIGHT *w, WEIGHT **ppw, WEIGHT *pw, int u);
116
+
117
+ /* return the position of the first element having value e. return -1 if no such element exists */
118
+ LONG QUEUE_ele (QUEUE *Q, QUEUE_INT e);
119
+
120
+ /* insert an element to the tail/head */
121
+ void QUEUE_ins_ (QUEUE *Q, QUEUE_INT e);
122
+ void QUEUE_ins (QUEUE *Q, QUEUE_INT e);
123
+ void QUEUE_ins_head_ (QUEUE *Q, QUEUE_INT e);
124
+ void QUEUE_ins_head (QUEUE *Q, QUEUE_INT e);
125
+
126
+ /* extract an element from the head/tail, without checking the underflow */
127
+ QUEUE_INT QUEUE_ext_ (QUEUE *Q);
128
+ QUEUE_INT QUEUE_ext (QUEUE *Q);
129
+ QUEUE_INT QUEUE_ext_tail_ (QUEUE *Q);
130
+ QUEUE_INT QUEUE_ext_tail (QUEUE *Q);
131
+
132
+ /* remove the j-th element and replace it by the tail/head or shift */
133
+ void QUEUE_rm_ (QUEUE *Q, QUEUE_ID j);
134
+ void QUEUE_rm (QUEUE *Q, QUEUE_ID j);
135
+ void QUEUE_rm_head_ (QUEUE *Q, QUEUE_ID j);
136
+ void QUEUE_rm_head (QUEUE *Q, QUEUE_ID j);
137
+ int QUEUE_rm_ele_ (QUEUE *Q, QUEUE_INT e);
138
+
139
+ /* Append Q2 to the tail of Q1. Q2 will (not) be deleted */
140
+ void QUEUE_append_ (QUEUE *Q1, QUEUE *Q2);
141
+ void QUEUE_append (QUEUE *Q1, QUEUE *Q2);
142
+ void QUEUE_concat_ (QUEUE *Q1, QUEUE *Q2);
143
+ void QUEUE_concat (QUEUE *Q1, QUEUE *Q2);
144
+
145
+ /* Append from j to jj th elements to the tail of Q1. Q2 will not be deleted */
146
+ void QUEUE_subconcat_ (QUEUE *Q1, QUEUE *Q2, QUEUE_ID j, QUEUE_ID jj);
147
+ void QUEUE_subconcat (QUEUE *Q1, QUEUE *Q2, QUEUE_ID j, QUEUE_ID jj);
148
+
149
+ /* initialize Q1 by length of Q2, and copy Q2 to Q1 */
150
+ void QUEUE_store_ (QUEUE *Q1, QUEUE *Q2);
151
+ void QUEUE_store (QUEUE *Q1, QUEUE *Q2);
152
+ /* copy Q2 to Q1 and delete Q2 */
153
+ void QUEUE_restore_ (QUEUE *Q1, QUEUE *Q2);
154
+ void QUEUE_restore (QUEUE *Q1, QUEUE *Q2);
155
+
156
+ /* copy Q2 to Q1 */
157
+ void QUEUE_cpy_ (QUEUE *Q1, QUEUE *Q2);
158
+ void QUEUE_cpy (QUEUE *Q1, QUEUE *Q2);
159
+ QUEUE QUEUE_dup_ (QUEUE *Q);
160
+ /* copy l elements of Q2 starting from s2 to the s1th position of Q1.
161
+ size of Q1 is not increasing */
162
+ void QUEUE_subcpy_ (QUEUE *Q1, QUEUE_ID s1, QUEUE *Q2, QUEUE_ID s2, QUEUE_ID l);
163
+ void QUEUE_subcpy (QUEUE *Q1, QUEUE_ID s1, QUEUE *Q2, QUEUE_ID s2, QUEUE_ID l);
164
+
165
+ /* merge/minum/intersection of Q1 and Q2, and set Q1 to it.
166
+ Both Q1 and Q2 have to be sorted in increasing order */
167
+ void QUEUE_merge_ (QUEUE *Q1, QUEUE *Q2);
168
+ void QUEUE_merge (QUEUE *Q1, QUEUE *Q2);
169
+ void QUEUE_minus_ (QUEUE *Q1, QUEUE *Q2);
170
+ void QUEUE_minus (QUEUE *Q1, QUEUE *Q2);
171
+ void QUEUE_and_ (QUEUE *Q1, QUEUE *Q2);
172
+ void QUEUE_and (QUEUE *Q1, QUEUE *Q2);
173
+
174
+ /* insertion sort */
175
+ void QUEUE_sort (QUEUE *Q);
176
+
177
+ /* print */
178
+ void QUEUE_print (QUEUE *Q);
179
+ void QUEUE_print_ (QUEUE *Q);
180
+
181
+
182
+ #endif