abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
set.c
Go to the documentation of this file.
1 /*
2  * Revision Control Information
3  *
4  * $Source$
5  * $Author$
6  * $Revision$
7  * $Date$
8  *
9  */
10 /*
11  * set.c -- routines for maniuplating sets and set families
12  */
13 
14 /* LINTLIBRARY */
15 
16 #include "espresso.h"
17 
19 
21 
22 static void intcpy(d, s, n)
23 register unsigned int *d, *s;
24 register long n;
25 {
26  register int i;
27  for(i = 0; i < n; i++) {
28  *d++ = *s++;
29  }
30 }
31 
32 
33 /* bit_index -- find first bit (from LSB) in a word (MSB=bit n, LSB=bit 0) */
34 int bit_index(a)
35 register unsigned int a;
36 {
37  register int i;
38  if (a == 0)
39  return -1;
40  for(i = 0; (a & 1) == 0; a >>= 1, i++)
41  ;
42  return i;
43 }
44 
45 
46 /* set_ord -- count number of elements in a set */
47 int set_ord(a)
48 register pset a;
49 {
50  register int i, sum = 0;
51  register unsigned int val;
52  for(i = LOOP(a); i > 0; i--)
53  if ((val = a[i]) != 0)
54  sum += count_ones(val);
55  return sum;
56 }
57 
58 /* set_dist -- distance between two sets (# elements in common) */
59 int set_dist(a, b)
60 register pset a, b;
61 {
62  register int i, sum = 0;
63  register unsigned int val;
64  for(i = LOOP(a); i > 0; i--)
65  if ((val = a[i] & b[i]) != 0)
66  sum += count_ones(val);
67  return sum;
68 }
69 
70 /* set_clear -- make "r" the empty set of "size" elements */
72 register pset r;
73 int size;
74 {
75  register int i = LOOPINIT(size);
76  *r = i; do r[i] = 0; while (--i > 0);
77  return r;
78 }
79 
80 /* set_fill -- make "r" the universal set of "size" elements */
82 register pset r;
83 register int size;
84 {
85  register int i = LOOPINIT(size);
86  *r = i;
87  r[i] = ~ (unsigned) 0;
88  r[i] >>= i * BPI - size;
89  while (--i > 0)
90  r[i] = ~ (unsigned) 0;
91  return r;
92 }
93 
94 /* set_copy -- copy set a into set r */
96 register pset r, a;
97 {
98  register int i = LOOPCOPY(a);
99  do r[i] = a[i]; while (--i >= 0);
100  return r;
101 }
102 
103 /* set_and -- compute intersection of sets "a" and "b" */
104 pset set_and(r, a, b)
105 register pset r, a, b;
106 {
107  register int i = LOOP(a);
108  PUTLOOP(r,i); do r[i] = a[i] & b[i]; while (--i > 0);
109  return r;
110 }
111 
112 /* set_or -- compute union of sets "a" and "b" */
113 pset set_or(r, a, b)
114 register pset r, a, b;
115 {
116  register int i = LOOP(a);
117  PUTLOOP(r,i); do r[i] = a[i] | b[i]; while (--i > 0);
118  return r;
119 }
120 
121 /* set_diff -- compute difference of sets "a" and "b" */
122 pset set_diff(r, a, b)
123 register pset r, a, b;
124 {
125  register int i = LOOP(a);
126  PUTLOOP(r,i); do r[i] = a[i] & ~b[i]; while (--i > 0);
127  return r;
128 }
129 
130 /* set_xor -- compute exclusive-or of sets "a" and "b" */
131 pset set_xor(r, a, b)
132 register pset r, a, b;
133 {
134  register int i = LOOP(a);
135 #ifdef IBM_WATC
136  PUTLOOP(r,i); do r[i] = (a[i]&~b[i]) | (~a[i]&b[i]); while (--i > 0);
137 #else
138  PUTLOOP(r,i); do r[i] = a[i] ^ b[i]; while (--i > 0);
139 #endif
140  return r;
141 }
142 
143 /* set_merge -- compute "a" & "mask" | "b" & ~ "mask" */
144 pset set_merge(r, a, b, mask)
145 register pset r, a, b, mask;
146 {
147  register int i = LOOP(a);
148  PUTLOOP(r,i); do r[i] = (a[i]&mask[i]) | (b[i]&~mask[i]); while (--i > 0);
149  return r;
150 }
151 
152 /* set_andp -- compute intersection of sets "a" and "b" , TRUE if nonempty */
153 bool set_andp(r, a, b)
154 register pset r, a, b;
155 {
156  register int i = LOOP(a);
157  register unsigned int x = 0;
158  PUTLOOP(r,i); do {r[i] = a[i] & b[i]; x |= r[i];} while (--i > 0);
159  return x != 0;
160 }
161 
162 /* set_orp -- compute union of sets "a" and "b" , TRUE if nonempty */
163 bool set_orp(r, a, b)
164 register pset r, a, b;
165 {
166  register int i = LOOP(a);
167  register unsigned int x = 0;
168  PUTLOOP(r,i); do {r[i] = a[i] | b[i]; x |= r[i];} while (--i > 0);
169  return x != 0;
170 }
171 
172 /* setp_empty -- check if the set "a" is empty */
173 bool setp_empty(a)
174 register pset a;
175 {
176  register int i = LOOP(a);
177  do if (a[i]) return FALSE; while (--i > 0);
178  return TRUE;
179 }
180 
181 /* setp_full -- check if the set "a" is the full set of "size" elements */
182 bool setp_full(a, size)
183 register pset a;
184 register int size;
185 {
186  register int i = LOOP(a);
187  register unsigned int test;
188  test = ~ (unsigned) 0;
189  test >>= i * BPI - size;
190  if (a[i] != test)
191  return FALSE;
192  while (--i > 0)
193  if (a[i] != (~(unsigned) 0))
194  return FALSE;
195  return TRUE;
196 }
197 
198 /* setp_equal -- check if the set "a" equals set "b" */
199 bool setp_equal(a, b)
200 register pset a, b;
201 {
202  register int i = LOOP(a);
203  do if (a[i] != b[i]) return FALSE; while (--i > 0);
204  return TRUE;
205 }
206 
207 /* setp_disjoint -- check if intersection of "a" and "b" is empty */
208 bool setp_disjoint(a, b)
209 register pset a, b;
210 {
211  register int i = LOOP(a);
212  do if (a[i] & b[i]) return FALSE; while (--i > 0);
213  return TRUE;
214 }
215 
216 /* setp_implies -- check if "a" implies "b" ("b" contains "a") */
217 bool setp_implies(a, b)
218 register pset a, b;
219 {
220  register int i = LOOP(a);
221  do if (a[i] & ~b[i]) return FALSE; while (--i > 0);
222  return TRUE;
223 }
224 
225 /* sf_or -- form the "or" of all sets in a set family */
227 pset_family A;
228 {
229  register pset or, last, p;
230 
231  or = set_new(A->sf_size);
232  foreach_set(A, last, p)
233  INLINEset_or(or, or, p);
234  return or;
235 }
236 
237 /* sf_and -- form the "and" of all sets in a set family */
239 pset_family A;
240 {
241  register pset and, last, p;
242 
243  and = set_fill(set_new(A->sf_size), A->sf_size);
244  foreach_set(A, last, p)
245  INLINEset_and(and, and, p);
246  return and;
247 }
248 
249 /* sf_active -- make all members of the set family active */
251 pset_family A;
252 {
253  register pset p, last;
254  foreach_set(A, last, p) {
255  SET(p, ACTIVE);
256  }
257  A->active_count = A->count;
258  return A;
259 }
260 
261 
262 /* sf_inactive -- remove all inactive cubes in a set family */
264 pset_family A;
265 {
266  register pset p, last, pdest;
267 
268  pdest = A->data;
269  foreach_set(A, last, p) {
270  if (TESTP(p, ACTIVE)) {
271  if (pdest != p) {
272  INLINEset_copy(pdest, p);
273  }
274  pdest += A->wsize;
275  } else {
276  A->count--;
277  }
278  }
279  return A;
280 }
281 
282 
283 /* sf_copy -- copy a set family */
285 pset_family R, A;
286 {
287  R->sf_size = A->sf_size;
288  R->wsize = A->wsize;
289 /*R->capacity = A->count;*/
290 /*R->data = REALLOC(unsigned int, R->data, (long) R->capacity * R->wsize);*/
291  R->count = A->count;
292  R->active_count = A->active_count;
293  intcpy(R->data, A->data, (long) A->wsize * A->count);
294  return R;
295 }
296 
297 
298 /* sf_join -- join A and B into a single set_family */
300 pset_family A, B;
301 {
302  pset_family R;
303  long asize = A->count * A->wsize;
304  long bsize = B->count * B->wsize;
305 
306  if (A->sf_size != B->sf_size) fatal("sf_join: sf_size mismatch");
307  R = sf_new(A->count + B->count, A->sf_size);
308  R->count = A->count + B->count;
309  R->active_count = A->active_count + B->active_count;
310  intcpy(R->data, A->data, asize);
311  intcpy(R->data + asize, B->data, bsize);
312  return R;
313 }
314 
315 
316 /* sf_append -- append the sets of B to the end of A, and dispose of B */
318 pset_family A, B;
319 {
320  long asize = A->count * A->wsize;
321  long bsize = B->count * B->wsize;
322 
323  if (A->sf_size != B->sf_size) fatal("sf_append: sf_size mismatch");
324  A->capacity = A->count + B->count;
325  A->data = REALLOC(unsigned int, A->data, (long) A->capacity * A->wsize);
326  intcpy(A->data + asize, B->data, bsize);
327  A->count += B->count;
328  A->active_count += B->active_count;
329  sf_free(B);
330  return A;
331 }
332 
333 
334 /* sf_new -- allocate "num" sets of "size" elements each */
336 int num, size;
337 {
338  pset_family A;
339  if (set_family_garbage == NULL) {
340  A = ALLOC(set_family_t, 1);
341  } else {
342  A = set_family_garbage;
343  set_family_garbage = A->next;
344  }
345  A->sf_size = size;
346  A->wsize = SET_SIZE(size);
347  A->capacity = num;
348  A->data = ALLOC(unsigned int, (long) A->capacity * A->wsize);
349  A->count = 0;
350  A->active_count = 0;
351  return A;
352 }
353 
354 
355 /* sf_save -- create a duplicate copy of a set family */
357 register pset_family A;
358 {
359  return sf_copy(sf_new(A->count, A->sf_size), A);
360 }
361 
362 
363 /* sf_free -- free the storage allocated for a set family */
364 void sf_free(A)
365 pset_family A;
366 {
367  FREE(A->data);
368  A->next = set_family_garbage;
369  set_family_garbage = A;
370 }
371 
372 
373 /* sf_cleanup -- free all of the set families from the garbage list */
375 {
376  register pset_family p, pnext;
377  for(p = set_family_garbage; p != (pset_family) NULL; p = pnext) {
378  pnext = p->next;
379  FREE(p);
380  }
381  set_family_garbage = (pset_family) NULL;
382 }
383 
384 
385 /* sf_addset -- add a set to the end of a set family */
387 pset_family A;
388 pset s;
389 {
390  register pset p;
391 
392  if (A->count >= A->capacity) {
393  A->capacity = A->capacity + A->capacity/2 + 1;
394  A->data = REALLOC(unsigned int, A->data, (long) A->capacity * A->wsize);
395  }
396  p = GETSET(A, A->count++);
397  INLINEset_copy(p, s);
398  return A;
399 }
400 
401 /* sf_delset -- delete a set from a set family */
402 void sf_delset(A, i)
403 pset_family A;
404 int i;
405 { (void) set_copy(GETSET(A,i), GETSET(A, --A->count));}
406 
407 /* sf_print -- print a set_family as a set (list the element numbers) */
408 void sf_print(A)
409 pset_family A;
410 {
411  char *ps1();
412  register pset p;
413  register int i;
414  foreachi_set(A, i, p)
415  printf("A[%d] = %s\n", i, ps1(p));
416 }
417 
418 /* sf_bm_print -- print a set_family as a bit-matrix */
419 void sf_bm_print(A)
420 pset_family A;
421 {
422  char *pbv1();
423  register pset p;
424  register int i;
425  foreachi_set(A, i, p)
426  printf("[%4d] %s\n", i, pbv1(p, A->sf_size));
427 }
428 
429 
430 /* sf_write -- output a set family in an unintelligable manner */
431 void sf_write(fp, A)
432 FILE *fp;
433 pset_family A;
434 {
435  register pset p, last;
436  (void) fprintf(fp, "%d %d\n", A->count, A->sf_size);
437  foreach_set(A, last, p)
438  set_write(fp, p);
439  (void) fflush(fp);
440 }
441 
442 
443 /* sf_read -- read a set family written by sf_write */
445 FILE *fp;
446 {
447  int i, j;
448  register pset p, last;
449  pset_family A;
450 
451  (void) fscanf(fp, "%d %d\n", &i, &j);
452  A = sf_new(i, j);
453  A->count = i;
454  foreach_set(A, last, p) {
455  (void) fscanf(fp, "%x", p);
456  for(j = 1; j <= LOOP(p); j++)
457  (void) fscanf(fp, "%x", p+j);
458  }
459  return A;
460 }
461 
462 
463 /* set_write -- output a set in an unintelligable manner */
464 void set_write(fp, a)
465 register FILE *fp;
466 register pset a;
467 {
468  register int n = LOOP(a), j;
469 
470  for(j = 0; j <= n; j++) {
471  (void) fprintf(fp, "%x ", a[j]);
472  if ((j+1) % 8 == 0 && j != n)
473  (void) fprintf(fp, "\n\t");
474  }
475  (void) fprintf(fp, "\n");
476 }
477 
478 
479 /* sf_bm_read -- read a set family written by sf_bm_print (almost) */
481 FILE *fp;
482 {
483  int i, j, rows, cols;
484  register pset pdest;
485  pset_family A;
486 
487  (void) fscanf(fp, "%d %d\n", &rows, &cols);
488  A = sf_new(rows, cols);
489  for(i = 0; i < rows; i++) {
490  pdest = GETSET(A, A->count++);
491  (void) set_clear(pdest, A->sf_size);
492  for(j = 0; j < cols; j++) {
493  switch(getc(fp)) {
494  case '0':
495  break;
496  case '1':
497  set_insert(pdest, j);
498  break;
499  default:
500  fatal("Error reading set family");
501  }
502  }
503  if (getc(fp) != '\n') {
504  fatal("Error reading set family (at end of line)");
505  }
506  }
507  return A;
508 }
509 
510 
511 
512 /* ps1 -- convert a set into a printable string */
513 #define largest_string 120
514 static char s1[largest_string];
515 char *ps1(a)
516 register pset a;
517 {
518  register int i, num, l, len = 0, n = NELEM(a);
519  char temp[20];
520  bool first = TRUE;
521 
522  s1[len++] = '[';
523  for(i = 0; i < n; i++)
524  if (is_in_set(a,i)) {
525  if (! first)
526  s1[len++] = ',';
527  first = FALSE; num = i;
528  /* Generate digits (reverse order) */
529  l = 0; do temp[l++] = num % 10 + '0'; while ((num /= 10) > 0);
530  /* Copy them back in correct order */
531  do s1[len++] = temp[--l]; while (l > 0);
532  if (len > largest_string-15) {
533  s1[len++] = '.'; s1[len++] = '.'; s1[len++] = '.';
534  break;
535  }
536  }
537 
538  s1[len++] = ']';
539  s1[len++] = '\0';
540  return s1;
541 }
542 
543 /* pbv1 -- print bit-vector */
544 char *pbv1(s, n)
545 pset s;
546 int n;
547 {
548  register int i;
549  for(i = 0; i < n; i++)
550  s1[i] = is_in_set(s,i) ? '1' : '0';
551  s1[n] = '\0';
552  return s1;
553 }
554 
555 
556 /* set_adjcnt -- adjust the counts for a set by "weight" */
557 void
558 set_adjcnt(a, count, weight)
559 register pset a;
560 register int *count, weight;
561 {
562  register int i, base;
563  register unsigned int val;
564 
565  for(i = LOOP(a); i > 0; ) {
566  for(val = a[i], base = --i << LOGBPI; val != 0; base++, val >>= 1) {
567  if (val & 1) {
568  count[base] += weight;
569  }
570  }
571  }
572 }
573 
574 
575 
576 /* sf_count -- perform a column sum over a set family */
577 int *sf_count(A)
578 pset_family A;
579 {
580  register pset p, last;
581  register int i, base, *count;
582  register unsigned int val;
583 
584  count = ALLOC(int, A->sf_size);
585  for(i = A->sf_size - 1; i >= 0; i--) {
586  count[i] = 0;
587  }
588 
589  foreach_set(A, last, p) {
590  for(i = LOOP(p); i > 0; ) {
591  for(val = p[i], base = --i << LOGBPI; val != 0; base++, val >>= 1) {
592  if (val & 1) {
593  count[base]++;
594  }
595  }
596  }
597  }
598  return count;
599 }
600 
601 
602 /* sf_count_restricted -- perform a column sum over a set family, restricting
603  * to only the columns which are in r; also, the columns are weighted by the
604  * number of elements which are in each row
605  */
607 pset_family A;
608 register pset r;
609 {
610  register pset p;
611  register int i, base, *count;
612  register unsigned int val;
613  int weight;
614  pset last;
615 
616  count = ALLOC(int, A->sf_size);
617  for(i = A->sf_size - 1; i >= 0; i--) {
618  count[i] = 0;
619  }
620 
621  /* Loop for each set */
622  foreach_set(A, last, p) {
623  weight = 1024 / (set_ord(p) - 1);
624  for(i = LOOP(p); i > 0; ) {
625  for(val=p[i]&r[i], base= --i<<LOGBPI; val!=0; base++, val >>= 1) {
626  if (val & 1) {
627  count[base] += weight;
628  }
629  }
630  }
631  }
632  return count;
633 }
634 
635 
636 /*
637  * sf_delc -- delete columns first ... last of A
638  */
639 pset_family sf_delc(A, first, last)
640 pset_family A;
641 int first, last;
642 {
643  return sf_delcol(A, first, last-first + 1);
644 }
645 
646 
647 /*
648  * sf_addcol -- add columns to a set family; includes a quick check to see
649  * if there is already enough room (and hence, can avoid copying)
650  */
651 pset_family sf_addcol(A, firstcol, n)
652 pset_family A;
653 int firstcol, n;
654 {
655  int maxsize;
656 
657  /* Check if adding columns at the end ... */
658  if (firstcol == A->sf_size) {
659  /* If so, check if there is already enough room */
660  maxsize = BPI * LOOPINIT(A->sf_size);
661  if ((A->sf_size + n) <= maxsize) {
662  A->sf_size += n;
663  return A;
664  }
665  }
666  return sf_delcol(A, firstcol, -n);
667 }
668 
669 /*
670  * sf_delcol -- add/delete columns to/from a set family
671  *
672  * if n > 0 then n columns starting from firstcol are deleted if n < 0
673  * then n blank columns are inserted starting at firstcol
674  * (i.e., the first new column number is firstcol)
675  *
676  * This is done by copying columns in the array which is a relatively
677  * slow operation.
678  */
679 pset_family sf_delcol(A, firstcol, n)
680 pset_family A;
681 register int firstcol, n;
682 {
683  register pset p, last, pdest;
684  register int i;
685  pset_family B;
686 
687  B = sf_new(A->count, A->sf_size - n);
688  foreach_set(A, last, p) {
689  pdest = GETSET(B, B->count++);
690  INLINEset_clear(pdest, B->sf_size);
691  for(i = 0; i < firstcol; i++)
692  if (is_in_set(p, i))
693  set_insert(pdest, i);
694  for(i = n > 0 ? firstcol + n : firstcol; i < A->sf_size; i++)
695  if (is_in_set(p, i))
696  set_insert(pdest, i - n);
697  }
698  sf_free(A);
699  return B;
700 }
701 
702 
703 /*
704  * sf_copy_col -- copy column "srccol" from "src" to column "dstcol" of "dst"
705  */
706 pset_family sf_copy_col(dst, dstcol, src, srccol)
707 pset_family dst, src;
708 int dstcol, srccol;
709 {
710  register pset last, p, pdest;
711  register int word_test, word_set;
712  unsigned int bit_set, bit_test;
713 
714  /* CHEAT! form these constants outside the loop */
715  word_test = WHICH_WORD(srccol);
716  bit_test = 1 << WHICH_BIT(srccol);
717  word_set = WHICH_WORD(dstcol);
718  bit_set = 1 << WHICH_BIT(dstcol);
719 
720  pdest = dst->data;
721  foreach_set(src, last, p) {
722  if ((p[word_test] & bit_test) != 0)
723  pdest[word_set] |= bit_set;
724 /*
725  * equivalent code for this is ...
726  * if (is_in_set(p, srccol)) set_insert(pdest, destcol);
727  */
728  pdest += dst->wsize;
729  }
730  return dst;
731 }
732 
733 
734 
735 /*
736  * sf_compress -- delete columns from a matrix
737  */
739 pset_family A; /* will be freed */
740 register pset c;
741 {
742  register pset p;
743  register int i, bcol;
744  pset_family B;
745 
746  /* create a clean set family for the result */
747  B = sf_new(A->count, set_ord(c));
748  for(i = 0; i < A->count; i++) {
749  p = GETSET(B, B->count++);
750  INLINEset_clear(p, B->sf_size);
751  }
752 
753  /* copy each column of A which has a 1 in c */
754  bcol = 0;
755  for(i = 0; i < A->sf_size; i++) {
756  if (is_in_set(c, i)) {
757  (void) sf_copy_col(B, bcol++, A, i);
758  }
759  }
760  sf_free(A);
761  return B;
762 }
763 
764 
765 
766 /*
767  * sf_transpose -- transpose a bit matrix
768  *
769  * There are trickier ways of doing this, but this works.
770  */
772 pset_family A;
773 {
774  pset_family B;
775  register pset p;
776  register int i, j;
777 
778  B = sf_new(A->sf_size, A->count);
779  B->count = A->sf_size;
780  foreachi_set(B, i, p) {
781  INLINEset_clear(p, B->sf_size);
782  }
783  foreachi_set(A, i, p) {
784  for(j = 0; j < A->sf_size; j++) {
785  if (is_in_set(p, j)) {
786  set_insert(GETSET(B, j), i);
787  }
788  }
789  }
790  sf_free(A);
791  return B;
792 }
793 
794 
795 /*
796  * sf_permute -- permute the columns of a set_family
797  *
798  * permute is an array of integers containing column numbers of A which
799  * are to be retained.
800  */
801 pset_family sf_permute(A, permute, npermute)
802 pset_family A;
803 register int *permute, npermute;
804 {
805  pset_family B;
806  register pset p, last, pdest;
807  register int j;
808 
809  B = sf_new(A->count, npermute);
810  B->count = A->count;
811  foreach_set(B, last, p)
812  INLINEset_clear(p, npermute);
813 
814  pdest = B->data;
815  foreach_set(A, last, p) {
816  for(j = 0; j < npermute; j++)
817  if (is_in_set(p, permute[j]))
818  set_insert(pdest, j);
819  pdest += B->wsize;
820  }
821  sf_free(A);
822  return B;
823 }
825 
void fatal(char *s)
Definition: cvrmisc.c:140
pset_family sf_delcol(pset_family A, int firstcol, int n)
Definition: set.c:679
#define FALSE
Definition: cudd.h:91
void sf_delset(pset_family A, int i)
Definition: set.c:402
pset_family sf_addset(pset_family A, pset s)
Definition: set.c:386
pset set_clear(pset r, int size)
Definition: set.c:71
static Llb_Mgr_t * p
Definition: llb3Image.c:950
void sf_print(pset_family A)
Definition: set.c:408
pset_family sf_append(pset_family A, pset_family B)
Definition: set.c:317
struct set_family * next
Definition: espresso.h:83
bool set_andp(pset r, pset a, pset b)
Definition: set.c:153
pset_family sf_new(int num, int size)
Definition: set.c:335
int active_count
Definition: espresso.h:81
#define INLINEset_and(r, a, b)
Definition: espresso.h:202
pset sf_and(pset_family A)
Definition: set.c:238
#define PUTLOOP(set, i)
Definition: espresso.h:105
int count
Definition: espresso.h:80
pset set_fill(pset r, int size)
Definition: set.c:81
static void intcpy(unsigned int *d, unsigned int *s, long n)
Definition: set.c:22
pset_family sf_inactive(pset_family A)
Definition: set.c:263
#define SET(set, flag)
Definition: espresso.h:122
pset_family sf_copy(pset_family R, pset_family A)
Definition: set.c:284
pset set_merge(pset r, pset a, pset b, pset mask)
Definition: set.c:144
int * sf_count_restricted(pset_family A, pset r)
Definition: set.c:606
#define foreach_set(R, last, p)
Definition: espresso.h:135
void set_write(FILE *fp, pset a)
Definition: set.c:464
pset set_diff(pset r, pset a, pset b)
Definition: set.c:122
#define INLINEset_or(r, a, b)
Definition: espresso.h:205
void sf_cleanup()
Definition: set.c:374
char * pbv1(pset s, int n)
Definition: set.c:544
void sf_write(FILE *fp, pset_family A)
Definition: set.c:431
bool setp_full(pset a, int size)
Definition: set.c:182
bool set_orp(pset r, pset a, pset b)
Definition: set.c:163
int set_dist(pset a, pset b)
Definition: set.c:59
bool setp_disjoint(pset a, pset b)
Definition: set.c:208
pset_family sf_permute(pset_family A, int *permute, int npermute)
Definition: set.c:801
pset set_xor(pset r, pset a, pset b)
Definition: set.c:131
#define ALLOC(type, num)
Definition: avl.h:27
int bit_index(unsigned int a)
Definition: set.c:34
bool setp_implies(pset a, pset b)
Definition: set.c:217
#define LOGBPI
Definition: espresso.h:69
pset_family sf_delc(pset_family A, int first, int last)
Definition: set.c:639
pset_family sf_save(pset_family A)
Definition: set.c:356
#define INLINEset_copy(r, a)
Definition: espresso.h:195
pset_family sf_read(FILE *fp)
Definition: set.c:444
int sf_size
Definition: espresso.h:78
int set_ord(pset a)
Definition: set.c:47
#define ABC_NAMESPACE_IMPL_END
Definition: abc_global.h:108
#define FREE(obj)
Definition: avl.h:31
#define is_in_set(set, e)
Definition: espresso.h:170
#define NELEM(set)
Definition: espresso.h:116
static int size
Definition: cuddSign.c:86
unsigned int * pset
Definition: espresso.h:73
pset_family sf_compress(pset_family A, pset c)
Definition: set.c:738
static char s1[largest_string]
Definition: set.c:514
void set_adjcnt(pset a, int *count, int weight)
Definition: set.c:558
int * sf_count(pset_family A)
Definition: set.c:577
bool setp_equal(pset a, pset b)
Definition: set.c:199
#define REALLOC(type, obj, num)
Definition: avl.h:29
#define WHICH_BIT(element)
Definition: espresso.h:88
#define ABC_NAMESPACE_IMPL_START
Definition: abc_global.h:107
#define set_new(size)
Definition: espresso.h:164
#define TRUE
Definition: cudd.h:88
#define set_insert(set, e)
Definition: espresso.h:172
#define GETSET(family, index)
Definition: espresso.h:161
#define WHICH_WORD(element)
Definition: espresso.h:87
void sf_free(pset_family A)
Definition: set.c:364
void sf_bm_print(pset_family A)
Definition: set.c:419
struct set_family * pset_family
pset_family sf_copy_col(pset_family dst, int dstcol, pset_family src, int srccol)
Definition: set.c:706
#define LOOP(set)
Definition: espresso.h:104
#define LOOPINIT(size)
Definition: espresso.h:117
#define count_ones(v)
Definition: espresso.h:245
#define TESTP(set, flag)
Definition: espresso.h:124
pset_family sf_active(pset_family A)
Definition: set.c:250
pset sf_or(pset_family A)
Definition: set.c:226
pset_family sf_join(pset_family A, pset_family B)
Definition: set.c:299
pset_family sf_addcol(pset_family A, int firstcol, int n)
Definition: set.c:651
#define ACTIVE
Definition: espresso.h:129
pset_family sf_transpose(pset_family A)
Definition: set.c:771
pset data
Definition: espresso.h:82
#define largest_string
Definition: set.c:513
bool setp_empty(pset a)
Definition: set.c:173
pset set_and(pset r, pset a, pset b)
Definition: set.c:104
pset_family sf_bm_read(FILE *fp)
Definition: set.c:480
static ABC_NAMESPACE_IMPL_START pset_family set_family_garbage
Definition: set.c:20
int capacity
Definition: espresso.h:79
pset set_or(pset r, pset a, pset b)
Definition: set.c:113
#define LOOPCOPY(set)
Definition: espresso.h:111
int wsize
Definition: espresso.h:77
#define foreachi_set(R, i, p)
Definition: espresso.h:143
char * ps1(pset a)
Definition: set.c:515
pset set_copy(pset r, pset a)
Definition: set.c:95
#define SET_SIZE(size)
Definition: espresso.h:94
#define INLINEset_clear(r, size)
Definition: espresso.h:197