src/misc/espresso/cubehack.c File Reference

#include "espresso.h"
Include dependency graph for cubehack.c:

Go to the source code of this file.

Functions

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

Function Documentation

void cautious_define_cube_size ( int  n  ) 

Definition at line 32 of file cubehack.c.

00034 {
00035     if (cube.fullset != 0 && cube.num_binary_vars == n)
00036         return;
00037     if (cube.fullset != 0) {
00038         setdown_cube();
00039         FREE(cube.part_size);
00040     }
00041     cube.num_binary_vars = cube.num_vars = n;
00042     cube.part_size = ALLOC(int, n);
00043     cube_setup();
00044 }

void define_cube_size ( int  n  ) 

Definition at line 48 of file cubehack.c.

00050 {
00051     register int q, i;
00052     static int called_before = 0;
00053 
00054     /* check if the cube is already just the right size */
00055     if (cube.fullset != 0 && cube.num_binary_vars == n && cube.num_vars == n)
00056         return;
00057 
00058     /* We can't handle more than 100 inputs */
00059     if (n > 100) {
00060         cautious_define_cube_size(n);
00061         called_before = 0;
00062         return;
00063     }
00064 
00065     if (cube.fullset == 0 || ! called_before) {
00066         cautious_define_cube_size(100);
00067         called_before = 1;
00068     }
00069 
00070     cube.num_vars = n;
00071     cube.num_binary_vars = n;
00072     cube.num_mv_vars = 0;
00073     cube.output = -1;
00074     cube.size = n * 2;
00075 
00076     /* first_part, last_part, first_word, last_word, part_size OKAY */
00077     /* cube.sparse is OKAY */
00078 
00079     /* need to completely re-make cube.fullset and cube.binary_mask */
00080     (void) set_fill(cube.fullset, n*2);
00081     (void) set_fill(cube.binary_mask, n*2);
00082 
00083     /* need to resize each set in cube.var_mask and cube.temp */
00084     q = cube.fullset[0];
00085     for(i = 0; i < cube.num_vars; i++)
00086         cube.var_mask[i][0] = q;
00087     for(i = 0; i < CUBE_TEMP; i++)
00088         cube.temp[i][0] = q;
00089 
00090     /* need to resize cube.emptyset and cube.mv_mask */
00091     cube.emptyset[0] = q;
00092     cube.mv_mask[0] = q;
00093 
00094     /* need to reset the inword and inmask */
00095     if (cube.num_binary_vars != 0) {
00096         cube.inword = cube.last_word[cube.num_binary_vars - 1];
00097         cube.inmask = cube.binary_mask[cube.inword] & DISJOINT;
00098     } else {
00099         cube.inword = -1;
00100         cube.inmask = 0;
00101     }
00102 
00103     /* cdata (entire structure) is OKAY */
00104 }

void set_espresso_flags (  ) 

Definition at line 126 of file cubehack.c.

00127 {
00128     summary = FALSE;
00129     trace = FALSE;
00130     remove_essential = TRUE;
00131     force_irredundant = TRUE;
00132     unwrap_onset = TRUE;
00133     single_expand = FALSE;
00134     pos = FALSE;
00135     recompute_onset = FALSE;
00136     use_super_gasp = FALSE;
00137     use_random_order = FALSE;
00138 }

void undefine_cube_size (  ) 

Definition at line 108 of file cubehack.c.

00109 {
00110     if (cube.num_binary_vars > 100) {
00111         if (cube.fullset != 0) {
00112             setdown_cube();
00113             FREE(cube.part_size);
00114         }
00115     } else {
00116         cube.num_vars = cube.num_binary_vars = 100;
00117         if (cube.fullset != 0) {
00118             setdown_cube();
00119             FREE(cube.part_size);
00120         }
00121     }
00122 }


Generated on Tue Jan 5 12:19:10 2010 for abc70930 by  doxygen 1.6.1