Package edu.jas.ps

Class ExpVectorIterator

  • All Implemented Interfaces:
    java.util.Iterator<ExpVector>

    class ExpVectorIterator
    extends java.lang.Object
    implements java.util.Iterator<ExpVector>
    ExpVector iterator using CartesianProductLongIterator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) ExpVector current
      data structure.
      protected boolean empty  
      (package private) boolean infinite  
      (package private) java.util.Iterator<java.util.List<java.lang.Long>> liter  
      (package private) int nvar  
      protected int totalDegree  
      (package private) long upperBound  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        ExpVectorIterator​(int nv)
      ExpVector iterator constructor.
      protected ExpVectorIterator​(int nv, boolean inf, long ub)
      ExpVector iterator constructor.
        ExpVectorIterator​(int nv, long ub)
      ExpVector iterator constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Test for availability of a next long.
      ExpVector next()
      Get next ExpVector.
      void remove()
      Remove a tuple if allowed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • liter

        java.util.Iterator<java.util.List<java.lang.Long>> liter
      • totalDegree

        protected int totalDegree
      • empty

        protected boolean empty
      • upperBound

        final long upperBound
      • infinite

        final boolean infinite
      • nvar

        final int nvar
    • Constructor Detail

      • 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 Detail

      • hasNext

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

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

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