Class BDD.AllSatIterator

  • All Implemented Interfaces:
    Iterator<byte[]>
    Enclosing class:
    BDD

    public static class BDD.AllSatIterator
    extends Object
    implements Iterator<byte[]>
    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 Detail

      • allsatProfile

        protected byte[] allsatProfile
      • useLevel

        protected final boolean useLevel
    • Constructor Detail

      • AllSatIterator

        protected AllSatIterator​(BDDFactory factory,
                                 boolean level)
      • AllSatIterator

        public 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
      • AllSatIterator

        public 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<byte[]>
      • nextSat

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

        public byte[] next()
        Specified by:
        next in interface Iterator<byte[]>
      • remove

        public void remove()
        Specified by:
        remove in interface Iterator<byte[]>