net.sf.javabdd
Class BDD.AllSatIterator

java.lang.Object
  extended by net.sf.javabdd.BDD.AllSatIterator
All Implemented Interfaces:
Iterator
Enclosing class:
BDD

public static class BDD.AllSatIterator
extends Object
implements Iterator

Iterator that returns all satisfying assignments as byte arrays. In the byte arrays, -1 means dont-care, 0 means 0, and 1 means 1.


Field Summary
protected  byte[] allsatProfile
           
protected  BDDFactory f
           
protected  LinkedList hiStack
           
protected  LinkedList loStack
           
protected  boolean useLevel
           
 
Constructor Summary
  BDD.AllSatIterator(BDD r)
          Constructs a satisfying-assignment iterator on the given BDD.
  BDD.AllSatIterator(BDD r, boolean lev)
          Constructs a satisfying-assignment iterator on the given BDD.
protected BDD.AllSatIterator(BDDFactory factory, boolean level)
           
 
Method Summary
 boolean hasNext()
           
 Object next()
           
 byte[] nextSat()
          Return the next satisfying var setting.
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

f

protected final BDDFactory f

loStack

protected LinkedList loStack

hiStack

protected LinkedList hiStack

allsatProfile

protected byte[] allsatProfile

useLevel

protected final boolean useLevel
Constructor Detail

BDD.AllSatIterator

protected BDD.AllSatIterator(BDDFactory factory,
                             boolean level)

BDD.AllSatIterator

public BDD.AllSatIterator(BDD r)
Constructs a satisfying-assignment iterator on the given BDD. next() returns a byte array indexed by BDD variable number.

Parameters:
r - BDD to iterate over

BDD.AllSatIterator

public BDD.AllSatIterator(BDD r,
                          boolean lev)
Constructs a satisfying-assignment iterator on the given BDD. If lev is true, next() will returns a byte array indexed by level. If lev is false, the byte array will be indexed by BDD variable number.

Parameters:
r - BDD to iterate over
lev - whether to index byte array by level instead of var
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

nextSat

public byte[] nextSat()
Return the next satisfying var setting.

Returns:
byte[]

next

public Object next()
Specified by:
next in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator


Copyright © 2003-2007 John Whaley. All Rights Reserved.