nysol-take 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/mbiclique.rb +317 -0
- data/bin/mbipolish.rb +362 -0
- data/bin/mccomp.rb +235 -0
- data/bin/mclique.rb +295 -0
- data/bin/mclique2g.rb +105 -0
- data/bin/mcliqueInfo.rb +203 -0
- data/bin/mfriends.rb +202 -0
- data/bin/mgdiff.rb +252 -0
- data/bin/mhifriend.rb +456 -0
- data/bin/mhipolish.rb +465 -0
- data/bin/mitemset.rb +168 -0
- data/bin/mpal.rb +410 -0
- data/bin/mpolishing.rb +399 -0
- data/bin/msequence.rb +165 -0
- data/bin/mtra2g.rb +476 -0
- data/bin/mtra2gc.rb +360 -0
- data/ext/grhfilrun/extconf.rb +12 -0
- data/ext/grhfilrun/grhfilrun.c +85 -0
- data/ext/grhfilrun/src/_sspc.c +358 -0
- data/ext/grhfilrun/src/aheap.c +545 -0
- data/ext/grhfilrun/src/aheap.h +251 -0
- data/ext/grhfilrun/src/base.c +92 -0
- data/ext/grhfilrun/src/base.h +59 -0
- data/ext/grhfilrun/src/fstar.c +497 -0
- data/ext/grhfilrun/src/fstar.h +80 -0
- data/ext/grhfilrun/src/grhfil.c +214 -0
- data/ext/grhfilrun/src/itemset.c +713 -0
- data/ext/grhfilrun/src/itemset.h +170 -0
- data/ext/grhfilrun/src/problem.c +415 -0
- data/ext/grhfilrun/src/problem.h +179 -0
- data/ext/grhfilrun/src/queue.c +533 -0
- data/ext/grhfilrun/src/queue.h +182 -0
- data/ext/grhfilrun/src/sample.c +19 -0
- data/ext/grhfilrun/src/sspc.c +597 -0
- data/ext/grhfilrun/src/sspc2.c +491 -0
- data/ext/grhfilrun/src/stdlib2.c +1482 -0
- data/ext/grhfilrun/src/stdlib2.h +892 -0
- data/ext/grhfilrun/src/trsact.c +817 -0
- data/ext/grhfilrun/src/trsact.h +160 -0
- data/ext/grhfilrun/src/vec.c +745 -0
- data/ext/grhfilrun/src/vec.h +172 -0
- data/ext/lcmrun/extconf.rb +20 -0
- data/ext/lcmrun/lcmrun.cpp +99 -0
- data/ext/lcmrun/src/aheap.c +216 -0
- data/ext/lcmrun/src/aheap.h +111 -0
- data/ext/lcmrun/src/base.c +92 -0
- data/ext/lcmrun/src/base.h +59 -0
- data/ext/lcmrun/src/itemset.c +496 -0
- data/ext/lcmrun/src/itemset.h +157 -0
- data/ext/lcmrun/src/lcm.c +427 -0
- data/ext/lcmrun/src/problem.c +349 -0
- data/ext/lcmrun/src/problem.h +177 -0
- data/ext/lcmrun/src/queue.c +528 -0
- data/ext/lcmrun/src/queue.h +176 -0
- data/ext/lcmrun/src/sgraph.c +359 -0
- data/ext/lcmrun/src/sgraph.h +173 -0
- data/ext/lcmrun/src/stdlib2.c +1282 -0
- data/ext/lcmrun/src/stdlib2.h +823 -0
- data/ext/lcmrun/src/trsact.c +747 -0
- data/ext/lcmrun/src/trsact.h +159 -0
- data/ext/lcmrun/src/vec.c +731 -0
- data/ext/lcmrun/src/vec.h +171 -0
- data/ext/lcmseq0run/extconf.rb +20 -0
- data/ext/lcmseq0run/lcmseq0run.cpp +59 -0
- data/ext/lcmseq0run/src/aheap.c +216 -0
- data/ext/lcmseq0run/src/aheap.h +111 -0
- data/ext/lcmseq0run/src/base.c +92 -0
- data/ext/lcmseq0run/src/base.h +59 -0
- data/ext/lcmseq0run/src/itemset.c +518 -0
- data/ext/lcmseq0run/src/itemset.h +157 -0
- data/ext/lcmseq0run/src/itemset_zero.c +522 -0
- data/ext/lcmseq0run/src/lcm_seq.c +446 -0
- data/ext/lcmseq0run/src/lcm_seq_zero.c +446 -0
- data/ext/lcmseq0run/src/problem.c +439 -0
- data/ext/lcmseq0run/src/problem.h +179 -0
- data/ext/lcmseq0run/src/problem_zero.c +439 -0
- data/ext/lcmseq0run/src/queue.c +533 -0
- data/ext/lcmseq0run/src/queue.h +182 -0
- data/ext/lcmseq0run/src/stdlib2.c +1350 -0
- data/ext/lcmseq0run/src/stdlib2.h +864 -0
- data/ext/lcmseq0run/src/trsact.c +747 -0
- data/ext/lcmseq0run/src/trsact.h +159 -0
- data/ext/lcmseq0run/src/vec.c +779 -0
- data/ext/lcmseq0run/src/vec.h +172 -0
- data/ext/lcmseqrun/extconf.rb +20 -0
- data/ext/lcmseqrun/lcmseqrun.cpp +101 -0
- data/ext/lcmseqrun/src/aheap.c +216 -0
- data/ext/lcmseqrun/src/aheap.h +111 -0
- data/ext/lcmseqrun/src/base.c +92 -0
- data/ext/lcmseqrun/src/base.h +59 -0
- data/ext/lcmseqrun/src/itemset.c +518 -0
- data/ext/lcmseqrun/src/itemset.h +157 -0
- data/ext/lcmseqrun/src/itemset_zero.c +522 -0
- data/ext/lcmseqrun/src/lcm_seq.c +447 -0
- data/ext/lcmseqrun/src/lcm_seq_zero.c +446 -0
- data/ext/lcmseqrun/src/problem.c +439 -0
- data/ext/lcmseqrun/src/problem.h +179 -0
- data/ext/lcmseqrun/src/problem_zero.c +439 -0
- data/ext/lcmseqrun/src/queue.c +533 -0
- data/ext/lcmseqrun/src/queue.h +182 -0
- data/ext/lcmseqrun/src/stdlib2.c +1350 -0
- data/ext/lcmseqrun/src/stdlib2.h +864 -0
- data/ext/lcmseqrun/src/trsact.c +747 -0
- data/ext/lcmseqrun/src/trsact.h +159 -0
- data/ext/lcmseqrun/src/vec.c +779 -0
- data/ext/lcmseqrun/src/vec.h +172 -0
- data/ext/lcmtransrun/extconf.rb +18 -0
- data/ext/lcmtransrun/lcmtransrun.cpp +264 -0
- data/ext/macerun/extconf.rb +20 -0
- data/ext/macerun/macerun.cpp +57 -0
- data/ext/macerun/src/aheap.c +217 -0
- data/ext/macerun/src/aheap.h +112 -0
- data/ext/macerun/src/itemset.c +491 -0
- data/ext/macerun/src/itemset.h +158 -0
- data/ext/macerun/src/mace.c +503 -0
- data/ext/macerun/src/problem.c +346 -0
- data/ext/macerun/src/problem.h +174 -0
- data/ext/macerun/src/queue.c +529 -0
- data/ext/macerun/src/queue.h +177 -0
- data/ext/macerun/src/sgraph.c +360 -0
- data/ext/macerun/src/sgraph.h +174 -0
- data/ext/macerun/src/stdlib2.c +993 -0
- data/ext/macerun/src/stdlib2.h +811 -0
- data/ext/macerun/src/vec.c +634 -0
- data/ext/macerun/src/vec.h +170 -0
- data/ext/sspcrun/extconf.rb +20 -0
- data/ext/sspcrun/src/_sspc.c +358 -0
- data/ext/sspcrun/src/aheap.c +545 -0
- data/ext/sspcrun/src/aheap.h +251 -0
- data/ext/sspcrun/src/base.c +92 -0
- data/ext/sspcrun/src/base.h +59 -0
- data/ext/sspcrun/src/fstar.c +496 -0
- data/ext/sspcrun/src/fstar.h +80 -0
- data/ext/sspcrun/src/grhfil.c +213 -0
- data/ext/sspcrun/src/itemset.c +713 -0
- data/ext/sspcrun/src/itemset.h +170 -0
- data/ext/sspcrun/src/problem.c +415 -0
- data/ext/sspcrun/src/problem.h +179 -0
- data/ext/sspcrun/src/queue.c +533 -0
- data/ext/sspcrun/src/queue.h +182 -0
- data/ext/sspcrun/src/sample.c +19 -0
- data/ext/sspcrun/src/sspc.c +598 -0
- data/ext/sspcrun/src/sspc2.c +491 -0
- data/ext/sspcrun/src/stdlib2.c +1482 -0
- data/ext/sspcrun/src/stdlib2.h +892 -0
- data/ext/sspcrun/src/trsact.c +817 -0
- data/ext/sspcrun/src/trsact.h +160 -0
- data/ext/sspcrun/src/vec.c +745 -0
- data/ext/sspcrun/src/vec.h +172 -0
- data/ext/sspcrun/sspcrun.cpp +54 -0
- data/lib/nysol/enumLcmEp.rb +338 -0
- data/lib/nysol/enumLcmEsp.rb +284 -0
- data/lib/nysol/enumLcmIs.rb +275 -0
- data/lib/nysol/enumLcmSeq.rb +143 -0
- data/lib/nysol/items.rb +201 -0
- data/lib/nysol/seqDB.rb +256 -0
- data/lib/nysol/take.rb +39 -0
- data/lib/nysol/taxonomy.rb +113 -0
- data/lib/nysol/traDB.rb +257 -0
- metadata +239 -0
@@ -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
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#define _FILE2_LOAD_FROM_MEMORY_
|
2
|
+
#include "sspc.c"
|
3
|
+
|
4
|
+
|
5
|
+
int a[11] = {1,2,3,INTHUGE,2,4,INTHUGE,3,4,INTHUGE-1}, *buf;
|
6
|
+
|
7
|
+
main (int argc, char *argv[]){
|
8
|
+
__load_from_memory_org__ = a;
|
9
|
+
EXECSUB (SSPC_main, 0, exit, "sspc R void 0.2 void", 0);
|
10
|
+
buf = (int *)__write_to_memory_org__;
|
11
|
+
while (*buf != INTHUGE-1){
|
12
|
+
printf ("%d\n", *buf);
|
13
|
+
buf++;
|
14
|
+
}
|
15
|
+
free2 (__write_to_memory_org__);
|
16
|
+
}
|
17
|
+
|
18
|
+
|
19
|
+
|