So, since its Google code jam time, I figure I’ll do another TMD.Algo release. Still the same licensing as before.
New features: (Beware bugs due to insufficient testing… especially in the first 2)
- MaxFlowMinCost algorithm for Graph.
- Generic TernarySearch extension for lists.
- SortedDictionary2 – a sorted dictionary with ‘near’ lookup support. Finds the element equal or less than the search element and then you can enumerate from that position.
- Pattern support. Algorithms for efficiently finding the sum or value at index in a repeating pattern with optional non-repeating start. Uses sequence generation state as a key to detect loops.
- Memotizer – a simple function adapter to automatically cache results – not exactly nice to use if the function needs to be recursive…
- LookupQueue – amortized O(1) lookup/remove/append queue using a dictionary augmented linked list. Presumes queue elements are all distinct. (Internal implementation uses arrays to avoid the GC and random location dereferencing penalties of a normal linked list.)
Improvements:
- Fraction improvements: Truncate to closest integer in direction of 0, explicit cast for integer to fraction, <= and >= operators added, absolute value function.
Bug fixes:
- Corner case in reverse comparer (if base comparer returned int.MinValue it would fail).
- One of the error messages in LookupHeap had a typo.
Link: http://www.themissingdocs.net/downloads/TMD.Algo.0.0.5.0.zip