Package edu.jas.ps

Class ExpVectorIterator

java.lang.Object
edu.jas.ps.ExpVectorIterator
All Implemented Interfaces:
Iterator<ExpVector>

class ExpVectorIterator extends Object implements Iterator<ExpVector>
ExpVector iterator using CartesianProductLongIterator.
  • Field Details

    • current

      ExpVector current
      data structure.
    • liter

      Iterator<List<Long>> liter
    • totalDegree

      protected int totalDegree
    • empty

      protected boolean empty
    • upperBound

      final long upperBound
    • infinite

      final boolean infinite
    • nvar

      final int nvar
  • Constructor Details

    • ExpVectorIterator

      public ExpVectorIterator(int nv)
      ExpVector iterator constructor.
      Parameters:
      nv - number of variables.
    • ExpVectorIterator

      public ExpVectorIterator(int nv, long ub)
      ExpVector iterator constructor.
      Parameters:
      nv - number of variables.
      ub - upper bound for the components.
    • ExpVectorIterator

      protected ExpVectorIterator(int nv, boolean inf, long ub)
      ExpVector iterator constructor.
      Parameters:
      nv - number of variables.
      inf - true, if all elements between 0 and upper bound are enumerated, false, if only elements of exact upper bund are to be processed.
      ub - an upper bound for the entries.
  • Method Details

    • hasNext

      public boolean hasNext()
      Test for availability of a next long.
      Specified by:
      hasNext in interface Iterator<ExpVector>
      Returns:
      true if the iteration has more ExpVectors, else false.
    • next

      public ExpVector next()
      Get next ExpVector.
      Specified by:
      next in interface Iterator<ExpVector>
      Returns:
      next ExpVector.
    • remove

      public void remove()
      Remove a tuple if allowed.
      Specified by:
      remove in interface Iterator<ExpVector>