abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cubehack.c File Reference
#include "espresso.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START void cautious_define_cube_size (int n)
 
void define_cube_size (int n)
 
void undefine_cube_size ()
 
void set_espresso_flags ()
 

Function Documentation

ABC_NAMESPACE_IMPL_START void cautious_define_cube_size ( int  n)

Definition at line 35 of file cubehack.c.

37 {
38  if (cube.fullset != 0 && cube.num_binary_vars == n)
39  return;
40  if (cube.fullset != 0) {
41  setdown_cube();
42  FREE(cube.part_size);
43  }
44  cube.num_binary_vars = cube.num_vars = n;
45  cube.part_size = ALLOC(int, n);
46  cube_setup();
47 }
ABC_NAMESPACE_IMPL_START void cube_setup()
Definition: cubestr.c:27
#define ALLOC(type, num)
Definition: avl.h:27
void setdown_cube()
Definition: cubestr.c:95
#define FREE(obj)
Definition: avl.h:31
void define_cube_size ( int  n)

Definition at line 51 of file cubehack.c.

53 {
54  register int q, i;
55  static int called_before = 0;
56 
57  /* check if the cube is already just the right size */
58  if (cube.fullset != 0 && cube.num_binary_vars == n && cube.num_vars == n)
59  return;
60 
61  /* We can't handle more than 100 inputs */
62  if (n > 100) {
64  called_before = 0;
65  return;
66  }
67 
68  if (cube.fullset == 0 || ! called_before) {
70  called_before = 1;
71  }
72 
73  cube.num_vars = n;
74  cube.num_binary_vars = n;
75  cube.num_mv_vars = 0;
76  cube.output = -1;
77  cube.size = n * 2;
78 
79  /* first_part, last_part, first_word, last_word, part_size OKAY */
80  /* cube.sparse is OKAY */
81 
82  /* need to completely re-make cube.fullset and cube.binary_mask */
83  (void) set_fill(cube.fullset, n*2);
84  (void) set_fill(cube.binary_mask, n*2);
85 
86  /* need to resize each set in cube.var_mask and cube.temp */
87  q = cube.fullset[0];
88  for(i = 0; i < cube.num_vars; i++)
89  cube.var_mask[i][0] = q;
90  for(i = 0; i < CUBE_TEMP; i++)
91  cube.temp[i][0] = q;
92 
93  /* need to resize cube.emptyset and cube.mv_mask */
94  cube.emptyset[0] = q;
95  cube.mv_mask[0] = q;
96 
97  /* need to reset the inword and inmask */
98  if (cube.num_binary_vars != 0) {
99  cube.inword = cube.last_word[cube.num_binary_vars - 1];
100  cube.inmask = cube.binary_mask[cube.inword] & DISJOINT;
101  } else {
102  cube.inword = -1;
103  cube.inmask = 0;
104  }
105 
106  /* cdata (entire structure) is OKAY */
107 }
#define CUBE_TEMP
Definition: espresso.h:469
ABC_NAMESPACE_IMPL_START void cautious_define_cube_size(int n)
Definition: cubehack.c:35
#define DISJOINT
Definition: espresso.h:514
pset set_fill()
void set_espresso_flags ( )

Definition at line 129 of file cubehack.c.

130 {
131  summary = FALSE;
132  trace = FALSE;
135  unwrap_onset = TRUE;
137  pos = FALSE;
141 }
bool single_expand
Definition: globals.c:34
#define FALSE
Definition: cudd.h:91
bool unwrap_onset
Definition: globals.c:37
bool pos
Definition: globals.c:30
bool summary
Definition: globals.c:35
bool trace
Definition: globals.c:36
bool force_irredundant
Definition: globals.c:27
bool use_super_gasp
Definition: globals.c:39
bool use_random_order
Definition: globals.c:38
#define TRUE
Definition: cudd.h:88
bool remove_essential
Definition: globals.c:33
bool recompute_onset
Definition: globals.c:32
void undefine_cube_size ( )

Definition at line 111 of file cubehack.c.

112 {
113  if (cube.num_binary_vars > 100) {
114  if (cube.fullset != 0) {
115  setdown_cube();
116  FREE(cube.part_size);
117  }
118  } else {
119  cube.num_vars = cube.num_binary_vars = 100;
120  if (cube.fullset != 0) {
121  setdown_cube();
122  FREE(cube.part_size);
123  }
124  }
125 }
void setdown_cube()
Definition: cubestr.c:95
#define FREE(obj)
Definition: avl.h:31