From: John W. <joe...@us...> - 2005-05-21 02:47:21
|
Update of /cvsroot/javabdd/JavaBDD/net/sf/javabdd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26026/net/sf/javabdd Modified Files: BDD.java Log Message: Fixed stupid bug. Now it seems to work OK. Index: BDD.java =================================================================== RCS file: /cvsroot/javabdd/JavaBDD/net/sf/javabdd/BDD.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** BDD.java 21 May 2005 02:03:22 -0000 1.6 --- BDD.java 21 May 2005 02:47:12 -0000 1.7 *************** *** 740,744 **** loStack = new LinkedList(); hiStack = new LinkedList(); ! if (!r.isOne()) loStack.addLast(r); if (!gotoNext()) allsatProfile = null; } --- 740,744 ---- loStack = new LinkedList(); hiStack = new LinkedList(); ! if (!r.isOne()) loStack.addLast(r.id()); if (!gotoNext()) allsatProfile = null; } *************** *** 749,756 **** boolean lo_empty = loStack.isEmpty(); if (lo_empty) { ! if (hiStack.isEmpty()) return false; ! r = (BDD) hiStack.getLast(); } else { ! r = (BDD) loStack.getLast(); } int LEVEL_r = r.level(); --- 749,758 ---- boolean lo_empty = loStack.isEmpty(); if (lo_empty) { ! if (hiStack.isEmpty()) { ! return false; ! } ! r = (BDD) hiStack.removeLast(); } else { ! r = (BDD) loStack.removeLast(); } int LEVEL_r = r.level(); *************** *** 1063,1071 **** public Iterator iterator3(final BDD var) { return new Iterator() { ! BDDFactory f = BDD.this.getFactory(); ! AllSatIterator i = new AllSatIterator(BDD.this); byte[] a; BDD b; - BDD v = var; BDD lastReturned; --- 1065,1073 ---- public Iterator iterator3(final BDD var) { return new Iterator() { ! final BDDFactory f = BDD.this.getFactory(); ! final AllSatIterator i = new AllSatIterator(BDD.this); ! final BDD v = var; byte[] a; BDD b; BDD lastReturned; *************** *** 1088,1100 **** public boolean hasNext() { ! return b != null || a != null; } public Object next() { if (b == null) { ! gotoNext(); ! if (a == null) { ! throw new NoSuchElementException(); ! } } lastReturned = b.satOne(v, false); --- 1090,1099 ---- public boolean hasNext() { ! return b != null; } public Object next() { if (b == null) { ! throw new NoSuchElementException(); } lastReturned = b.satOne(v, false); *************** *** 1102,1106 **** if (b.isZero()) { b.free(); ! b = null; } return lastReturned; --- 1101,1105 ---- if (b.isZero()) { b.free(); ! gotoNext(); } return lastReturned; |