force fixed bits to be equal for all PIs found by a task
This commit is contained in:
parent
4c506892fb
commit
12030db2c3
1 changed files with 17 additions and 12 deletions
|
@ -258,25 +258,30 @@ ccubes_task(int k,
|
||||||
}
|
}
|
||||||
// Rprintf("task: %d; rows: %d\n", task, *found);
|
// Rprintf("task: %d; rows: %d\n", task, *found);
|
||||||
|
|
||||||
|
// this should rarely be more than 5 (because k rarely exceeds 5)
|
||||||
|
// if it reaches 10 something is way wrong
|
||||||
|
int bit_index[10];
|
||||||
|
|
||||||
|
unsigned int fixed[IMPLICANT_WORDS];
|
||||||
|
for (int i = 0; i < IMPLICANT_WORDS; i++) {
|
||||||
|
fixed[i] = 0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int c = 0; c < k; c++) {
|
||||||
|
bit_index[c] = (tempk[c] % (BITS_PER_WORD / VALUE_BIT_WIDTH)) * VALUE_BIT_WIDTH;
|
||||||
|
int word_index = tempk[c] / (BITS_PER_WORD / VALUE_BIT_WIDTH);
|
||||||
|
fixed_bits[word_index] |= (VALUE_BIT_MASK << bit_index[c]);
|
||||||
|
}
|
||||||
|
|
||||||
for (int f = 0; f < *found; f++) {
|
for (int f = 0; f < *found; f++) {
|
||||||
|
|
||||||
// create a temporary vector of length k, containing the values from the initial ON set
|
|
||||||
// plus 1 (because 0 now signals a minimization, it becomes 1, and 1 becomes 2 etc).
|
|
||||||
int tempc[NINPUTS];
|
|
||||||
|
|
||||||
for (int c = 0; c < k; c++) {
|
for (int c = 0; c < k; c++) {
|
||||||
int value = ON_set[tempk[c] * POSROWS + frows[f]];
|
|
||||||
tempc[c] = value + 1;
|
|
||||||
|
|
||||||
int word_index = tempk[c] / (BITS_PER_WORD / VALUE_BIT_WIDTH);
|
int word_index = tempk[c] / (BITS_PER_WORD / VALUE_BIT_WIDTH);
|
||||||
int bit_index = (tempk[c] % (BITS_PER_WORD / VALUE_BIT_WIDTH)) * VALUE_BIT_WIDTH;
|
fixed_bits[f * POSROWS + word_index] = fixed_bits[word_index];
|
||||||
|
value_bits[f * POSROWS + word_index] |= ((unsigned int)ON_set[tempk[c] * POSROWS + frows[f]] << bit_index[c]);
|
||||||
fixed_bits[f * POSROWS + word_index] |= (VALUE_BIT_MASK << bit_index);
|
|
||||||
value_bits[f * POSROWS + word_index] |= ((unsigned int)value << bit_index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the current PI is not redundant
|
// check if the current PI is not redundant
|
||||||
// bool redundant = false;
|
|
||||||
redundant[f] = false;
|
redundant[f] = false;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue