# You are allowed to redistribute it and sell it, alone or is a part of
# another product.
-# Cartesian products, combinations and permutation on collections.
+# Memory-efficient Cartesian products, combinations and permutation on collections.
#
# This module offers memory-efficient views on combinatoric collections.
# Methods of the views create objects only when needed.
var collection: CartesianCollection[E]
# The array of iterations that will be increased in the lexicographic order.
- private var iterators = new Array[Iterator[E]]
+ var iterators = new Array[Iterator[E]]
init
do
super Iterator[SequenceRead[E]]
var product: CombinationCollection[E]
- private var iterators = new Array[Iterator[E]]
- private var indices = new Array[Int]
+ var iterators = new Array[Iterator[E]]
+ var indices = new Array[Int]
var are_sorted: Bool is noinit
var are_unique: Bool is noinit
end
end
- private fun next_free(rank: Int, start: Int): Int
+ fun next_free(rank: Int, start: Int): Int
do
loop
for i in [0..rank[ do
return start
end
- private fun reset_iterator(rank: Int): Iterator[E]
+ fun reset_iterator(rank: Int): Iterator[E]
do
var it = product.collection.iterator
iterators[rank] = it