Package edu.jas.util
Class CartesianProductLongIterator
java.lang.Object
edu.jas.util.CartesianProductLongIterator
Cartesian product iterator for Longs. Similar to CartesianProductIterator but
returns only tuples of given total degree.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final List
<LongIterator> (package private) final List
<LongIterable> data structure.(package private) boolean
final long
-
Constructor Summary
ConstructorsConstructorDescriptionCartesianProductLongIterator
(List<LongIterable> comps, long ub) CartesianProduct iterator constructor. -
Method Summary
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 Details
-
comps
data structure. -
compit
-
current
-
empty
boolean empty -
upperBound
public final long upperBound
-
-
Constructor Details
-
CartesianProductLongIterator
CartesianProduct iterator constructor.- Parameters:
comps
- components of the Cartesian product.ub
- an upper bound for the total degree of the elements.
-
-
Method Details
-
hasNext
public boolean hasNext()Test for availability of a next tuple. -
next
Get next tuple. -
totalDegree
Total degree of a tuple.- Parameters:
e
- list of Longs.- Returns:
- sum of all elements in e.
-
remove
public void remove()Remove a tuple if allowed.
-