| Version History |
KwCombinatorics version 1.2 (2009-03-03) - Implements generic IEquatable interface.
- Implements proper null tests for comparison operators.
KwCombinatorics version 1.3 (2012-01-05) - Updates build environment to Visual Studio 2010.
KwCombinatorics version 1.4 (2012-03-23) - Adds increment, decrement operators for all classes.
- Fixes bugs on empty sequences.
- Renames many parameters.
- Adds minor optimizations.
KwCombinatorics version 2.2 (2012-04-01) - Adds Multicombination.GetRowsForPicks (startPicks, stopPicks).
- Adds CopyTo (array) to all combinatorics.
- Removes Multicombination.GetRows (picks, startRank).
KwCombinatorics version 2.3 (2012-04-17) - Adds Permutation.Backtrack method.
- Multicombination ranking constructor accepts unsorted data.
- Combination ranking constructor accepts unsorted data.
- Fixes numeric overflow bug in Combination.Rank setter.
- Fixes missing numeric overflow checks in Product constructors.
- Fixes missing bounds checks in Product ranking constructor.
- Removes increment and decrement operators.
KwCombinatorics version 2.4 (2012-07-01) - Optimizes Combination.Rank setter.
- >Optimizes Multicombination.Rank setter.
- Adds methods Combinatoric.BinomialCoefficient, Combinatoric.Factorial.
KwCombinatorics version 4.0 (2012-11-14)
This release makes several changes to the Permutation class to add support for plain changes.
There are also several breaking changes to improve API readability.
- Adds Permutation.Choices property to support k-permutations.
- Adds Permutation constructors to support k-permutations.
- Adds property Permutation.PlainChange.
- Adds property Permutation.Swaps.
- Adds method Permutation.GetRowsForAllPicks.
- Adds method Permutation.GetRowsOfPlainChanges.
- Renames all Height properties to RowCount.
- Renames Permutation.Width to Picks.
- Renames Permutation.MaxWidth to MaxChoices.
- Renames Permutation.GetRowsForAllWidths to GetRowsForAllChoices.
- Removes Permutation (int, long) constructor.
- Removes ICloneable base class and Clone methods from all combinatorics.
KaosCombinatorics version 5.0 (2017-04-14)
This release updates tooling to 2017.
The new .NET Standard has been embraced for compatibility and future-proofing.
Development now requires Visual Studio 2017 with the repository changed to Git.
Binary now hosted at NuGet.org.
- Renames namespace from Kw to Kaos.
- Changes binary to .NET Standard 1.0 multitargeted to .NET 3.5, .NET 4.0.
- Updates build environment to Visual Studio 2017.
KaosCombinatorics version Next (2018-??-??) Summary
- Optimize Permutation class for speed and allocations
- Updates behavior of iterators to produce consistent operand side effects
- Changes thrown exceptions
Details
Optimize Permutation class for speed and allocations
The Permutation class has seen the elimination of some temporary memory allocations in constructors taking int[], the Rank setter, and backtracking.
This change also comes with slight performance improvements.
Updates behavior of iterators to produce consistent operand side effects
Previous versions of iterators produced inconsistent side affects to their operands.
New behavior is to synchronize the operand to the values yielded and restore their operand to its original state after the iteration is complete.
All iterators are affected:
- Combination.GetRows, Combination.GetRowsForAllPicks
- Multicombination.GetRows, Multicombination.GetRowsForPicks
- Permutation.GetRows, Permutation.GetRowsForAllChoices, Permutation.GetRowsForAllPicks, Permutation.GetRowsOfPlainChanges
- Product.GetRows
There is no impact for the typical scenario where the operand is not directly accessible as in this snippet:
foreach (var cn in new Combination (choices:3, picks:2).GetRowsForAllPicks())
Console.WriteLine (cn);
This change only impacts the atypical scenario where the operand is accessible independent of the yielded result such as in this snippet:
var cn0 = new Combination (choices:3, picks:2);
foreach (var cn in cn0.GetRowsForAllPicks())
Console.WriteLine ($"cn={cn} cn0={cn0}");
Console.WriteLine ($"After complete, cn0={cn0}");
Changes thrown exceptions
Minor changes have been made to exception throwing in:
- Methods Permutation.Permute, Product.Permute
- Constructors Permutation (int[]), Permutation (int[], int)
Where Permute methods threw IndexOutOfRangeException they now throw ArgumentException with a fail fast approach.
Where Permutation constructors taking an element array threw IndexOutOfRangeException they now throw ArgumentException.
See Also