88 static char rcsid[]
DD_UNUSED =
"$Id: cuddWindow.c,v 1.14 2009/02/20 02:14:58 fabio Exp $";
93 extern int ddTotalNISwaps;
172 if (table->
keys - table->
isolated != (
unsigned) supposedOpt) {
173 (void) fprintf(table->
err,
"Convergence failed! (%d != %d)\n",
183 if (table->
keys - table->
isolated != (
unsigned) supposedOpt) {
184 (void) fprintf(table->
err,
"Convergence failed! (%d != %d)\n",
225 assert(low >= 0 && high < table->size);
228 if (high-low < 1)
return(0);
231 for (x = low; x < high; x++) {
234 if (res == 0)
return(0);
237 if (res == 0)
return(0);
241 (void) fprintf(table->
out,
"-");
243 (void) fprintf(table->
out,
"=");
281 assert(low >= 0 && high < table->size);
288 if (events == NULL) {
292 for (x=0; x<nwin; x++) {
299 for (x=0; x<nwin; x++) {
315 if (x < nwin-1) events[x+1] = 1;
316 if (x > 0) events[x-1] = 1;
322 (void) fprintf(table->
out,
"-");
324 (void) fprintf(table->
out,
"=");
332 (void) fprintf(table->
out,
"|");
386 if (sizeNew < size) {
387 if (sizeNew == 0)
return(0);
393 if (sizeNew < size) {
394 if (sizeNew == 0)
return(0);
400 if (sizeNew < size) {
401 if (sizeNew == 0)
return(0);
407 if (sizeNew < size) {
408 if (sizeNew == 0)
return(0);
414 if (sizeNew < size) {
415 if (sizeNew == 0)
return(0);
469 if (high-low < 2)
return(
ddWindow2(table,low,high));
471 for (x = low; x+1 < high; x++) {
473 if (res == 0)
return(0);
476 (void) fprintf(table->
out,
"=");
478 (void) fprintf(table->
out,
"-");
522 if (events == NULL) {
526 for (x=0; x<nwin; x++) {
532 for (x=0; x<nwin; x++) {
539 if (x < nwin-1) events[x+1] = 1;
540 if (x > 1) events[x-2] = 1;
546 if (x < nwin-2) events[x+2] = 1;
547 if (x < nwin-1) events[x+1] = 1;
548 if (x > 0) events[x-1] = 1;
549 if (x > 1) events[x-2] = 1;
553 if (x < nwin-2) events[x+2] = 1;
554 if (x > 0) events[x-1] = 1;
564 (void) fprintf(table->
out,
"=");
566 (void) fprintf(table->
out,
"-");
574 (void) fprintf(table->
out,
"|");
615 x = w+1; y = x+1; z = y+1;
635 if (sizeNew < size) {
636 if (sizeNew == 0)
return(0);
642 if (sizeNew < size) {
643 if (sizeNew == 0)
return(0);
649 if (sizeNew < size || (sizeNew == size &&
ABDC < best)) {
650 if (sizeNew == 0)
return(0);
656 if (sizeNew < size) {
657 if (sizeNew == 0)
return(0);
663 if (sizeNew < size || (sizeNew == size &&
ADCB < best)) {
664 if (sizeNew == 0)
return(0);
670 if (sizeNew < size) {
671 if (sizeNew == 0)
return(0);
677 if (sizeNew < size) {
678 if (sizeNew == 0)
return(0);
684 if (sizeNew < size) {
685 if (sizeNew == 0)
return(0);
691 if (sizeNew < size || (sizeNew == size &&
BDAC < best)) {
692 if (sizeNew == 0)
return(0);
698 if (sizeNew < size || (sizeNew == size &&
BDCA < best)) {
699 if (sizeNew == 0)
return(0);
705 if (sizeNew < size) {
706 if (sizeNew == 0)
return(0);
712 if (sizeNew < size || (sizeNew == size &&
DCBA < best)) {
713 if (sizeNew == 0)
return(0);
719 if (sizeNew < size || (sizeNew == size &&
DCAB < best)) {
720 if (sizeNew == 0)
return(0);
726 if (sizeNew < size || (sizeNew == size &&
CDAB < best)) {
727 if (sizeNew == 0)
return(0);
733 if (sizeNew < size || (sizeNew == size &&
CDBA < best)) {
734 if (sizeNew == 0)
return(0);
740 if (sizeNew < size || (sizeNew == size &&
CBDA < best)) {
741 if (sizeNew == 0)
return(0);
747 if (sizeNew < size || (sizeNew == size &&
BCDA < best)) {
748 if (sizeNew == 0)
return(0);
754 if (sizeNew < size || (sizeNew == size &&
BCAD < best)) {
755 if (sizeNew == 0)
return(0);
761 if (sizeNew < size || (sizeNew == size &&
CBAD < best)) {
762 if (sizeNew == 0)
return(0);
768 if (sizeNew < size || (sizeNew == size &&
CABD < best)) {
769 if (sizeNew == 0)
return(0);
775 if (sizeNew < size || (sizeNew == size &&
CADB < best)) {
776 if (sizeNew == 0)
return(0);
782 if (sizeNew < size || (sizeNew == size &&
ACDB < best)) {
783 if (sizeNew == 0)
return(0);
789 if (sizeNew < size || (sizeNew == size &&
ACBD < best)) {
790 if (sizeNew == 0)
return(0);
870 if (high-low < 3)
return(
ddWindow3(table,low,high));
872 for (w = low; w+2 < high; w++) {
874 if (res == 0)
return(0);
877 (void) fprintf(table->
out,
"=");
879 (void) fprintf(table->
out,
"-");
923 if (events == NULL) {
927 for (x=0; x<nwin; x++) {
933 for (x=0; x<nwin; x++) {
940 if (x < nwin-1) events[x+1] = 1;
941 if (x > 2) events[x-3] = 1;
945 if (x < nwin-3) events[x+3] = 1;
946 if (x < nwin-1) events[x+1] = 1;
947 if (x > 0) events[x-1] = 1;
948 if (x > 2) events[x-3] = 1;
952 if (x < nwin-3) events[x+3] = 1;
953 if (x > 0) events[x-1] = 1;
959 if (x < nwin-3) events[x+3] = 1;
960 if (x < nwin-2) events[x+2] = 1;
961 if (x > 0) events[x-1] = 1;
962 if (x > 1) events[x-2] = 1;
978 if (x < nwin-3) events[x+3] = 1;
979 if (x < nwin-2) events[x+2] = 1;
980 if (x < nwin-1) events[x+1] = 1;
981 if (x > 0) events[x-1] = 1;
982 if (x > 1) events[x-2] = 1;
983 if (x > 2) events[x-3] = 1;
989 if (x < nwin-2) events[x+2] = 1;
990 if (x < nwin-1) events[x+1] = 1;
991 if (x > 1) events[x-2] = 1;
992 if (x > 2) events[x-3] = 1;
996 if (x < nwin-2) events[x+2] = 1;
997 if (x > 1) events[x-2] = 1;
1007 (void) fprintf(table->
out,
"=");
1009 (void) fprintf(table->
out,
"-");
1017 (void) fprintf(table->
out,
"|");
static int ddPermuteWindow3(DdManager *table, int x)
static int ddWindow2(DdManager *table, int low, int high)
static int ddWindow4(DdManager *table, int low, int high)
static int ddWindow3(DdManager *table, int low, int high)
static int ddWindowConv2(DdManager *table, int low, int high)
static int ddWindowConv4(DdManager *table, int low, int high)
#define ABC_ALLOC(type, num)
static int ddPermuteWindow4(DdManager *table, int w)
int cuddWindowReorder(DdManager *table, int low, int high, Cudd_ReorderingType submethod)
static ABC_NAMESPACE_IMPL_START char rcsid[] DD_UNUSED
int ddTotalNumberSwapping
#define ABC_NAMESPACE_IMPL_END
#define ABC_NAMESPACE_IMPL_START
int cuddSwapInPlace(DdManager *table, int x, int y)
static int ddWindowConv3(DdManager *table, int low, int high)