combinatoricslib icon indicating copy to clipboard operation
combinatoricslib copied to clipboard

Use the Visistor pattern for ComplexCombinationIterator to avoid unnecessary creation of objects

Open axkr opened this issue 10 years ago • 0 comments

Suppose you would like to analyze the combinations only until you have found a "match" and then stop the iteration. Wouldn't it be better to use the Visitor pattern for each generated combination to avoid the creation of all combinations in ComplexCombinationIterator#init() method for the iterator in the _resultSet variable? See: https://en.wikipedia.org/wiki/Visitor_pattern

axkr avatar Aug 05 '15 17:08 axkr