|
Enhanced C#
Loyc library documentation
|
This class efficiently lets you keep track of simple commutative statistics (such as total, average, sum of squares, and min/max) derived from the items of AList{T} and its variants (BList, BDictionary, and BMultiMap). More...
This class efficiently lets you keep track of simple commutative statistics (such as total, average, sum of squares, and min/max) derived from the items of AList{T} and its variants (BList, BDictionary, and BMultiMap).
Note: this class relies on the "tree observer" feature of ALists, but SparseAList doesn't support tree observers as of 2020/01.
Typically a statistic tracker is created by calling an extension method on AList, BList, etc.
Public Member Functions | |
| AListStatisticTracker (Func< T, TSummary > selector, Func< TSummary[], TSummary > aggregator, TSummary emptyResult, AListBase< K, T > list=null) | |
| AListStatisticTracker (Func< T, TSummary > selector, Func< TSummary, TSummary, TSummary > aggregator, TSummary emptyResult, AListBase< K, T > list=null) | |
Public Member Functions inherited from Loyc.Collections.AListStatisticTrackerBase< K, T, TSummary > | |
| TSummary | GetSummary () |
Public Member Functions inherited from Loyc.Collections.Impl.IAListTreeObserver< K, T > | |
| void | Detach (AListBase< K, T > list, AListNode< K, T >?root) |
| Called when the observer is being detached from an AList. Detach(), unlike Attach(), is not paired with a call to RootChanged. More... | |
| void | RootChanged (AListBase< K, T > list, AListNode< K, T >?root, bool clear) |
| Called when the root of the tree changes, or when the list is cleared. Also called after Attach(), but not after Detach(). More... | |
Protected Member Functions | |
| override TSummary | Aggregate (TSummary[] data) |
| override TSummary | Summarize (AListLeafBase< K, T > data) |
Protected Member Functions inherited from Loyc.Collections.AListStatisticTrackerBase< K, T, TSummary > | |
| TSummary | GetSummary (AListNode< K, T > node) |
Protected fields | |
| override TSummary | EmptyResult => _emptyResult |
Protected fields inherited from Loyc.Collections.AListStatisticTrackerBase< K, T, TSummary > | |
| virtual TSummary | EmptyResult => Aggregate(Empty<TSummary>.Array) |
Additional Inherited Members | |
Public fields inherited from Loyc.Collections.AListStatisticTrackerBase< K, T, TSummary > | |
| IEnumerable< AListBase< K, T > > | AttachedLists => _roots.Keys |
| int | TotalCountInAttachedLists => _roots.Sum(pair => pair.Key.Count) |
| TSummary | Summary => GetSummary() |
1.8.7