// AFTER public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > After <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, TKey startKey, bool startInclusive = true) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { return(series.Range(startKey, Opt <TKey> .Missing, startInclusive, true)); }
// BEFORE public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Before <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, TKey endKey, bool endInclusive = true) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { return(series.Range(Opt <TKey> .Missing, endKey, true, endInclusive)); }
public static Series <TKey, TValue, Fill <TKey, TValue, TCursor> > Fill <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, TValue value) where TCursor : ICursor <TKey, TValue, TCursor> { var cursor = new Fill <TKey, TValue, TCursor>(series.GetContainerCursor(), value); return(cursor.Source); }
public static Series <TKey, TResult, Map <TKey, TValue, TResult, TCursor> > Map <TKey, TValue, TResult, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, Func <TValue, TResult> selector) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { var cursor = new Map <TKey, TValue, TResult, TCursor>(series.GetContainerCursor(), selector); return(cursor.Source); }
public static Series <TKey, (TValue, (TKey, TValue)), Lag <TKey, TValue, TCursor> > Lag <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, int lag = 1, int step = 1) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { var cursor = new Lag <TKey, TValue, TCursor>(series.GetContainerCursor(), lag + 1, step); return(cursor.Source); }
public static Series <TKey, TValue, Filter <TKey, TValue, TCursor> > Filter <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, Func <TValue, bool> predicate) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { var cursor = new Filter <TKey, TValue, TCursor>(series.GetContainerCursor(), predicate); return(cursor.Source); }
public static Series <TKey, Stat2 <TKey>, Stat2Cursor <TKey, TValue, TCursor> > Stat2 <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, TKey width, Lookup lookup = Lookup.GE) where TCursor : ICursor <TKey, TValue, TCursor> { var cursor = new Stat2Cursor <TKey, TValue, TCursor>(series.GetContainerCursor(), width, lookup); return(cursor.Source); }
public static Series <TKey, Stat2 <TKey>, Stat2Cursor <TKey, TValue, TCursor> > Stat2 <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, int count, bool allowIncomplete = false) where TCursor : ICursor <TKey, TValue, TCursor> { var cursor = new Stat2Cursor <TKey, TValue, TCursor>(series.GetContainerCursor(), count, allowIncomplete); return(cursor.Source); }
public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Range <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, TKey startKey, TKey endKey, bool startInclusive = true, bool endInclusive = true) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { // NB cast to Opt for overload resolution return(series.Range((Opt <TKey>)startKey, endKey, startInclusive, endInclusive)); }
public static Series <TKey, TValue, Repeat <TKey, TValue, TCursor> > Repeat <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { var cursor = new Repeat <TKey, TValue, TCursor>(series.GetContainerCursor()); return(cursor.Source); }
public static Series <TKey, (TKey, TValue), RepeatWithKey <TKey, TValue, TCursor> > RepeatWithKey <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series) where TCursor : ICursor <TKey, TValue, TCursor> { var cursor = new RepeatWithKey <TKey, TValue, TCursor>(series.GetContainerCursor()); return(cursor.Source); }
// TODO see the trick with implicit conversion in ContainerSeries.* operator. Here it is also needed. // TODO! Series'3 extensions // TODO convenience methods on ValueTuple'3...'8 that accept a selector and flatten nested tuples // NB having methods that accept a selector achieves nothing in performance terms, only convenient signature #region ContainerSeries public static Series <TKey, (TLeft, TRight), Zip <TKey, TLeft, TRight, TCursorLeft, TCursorRight> > Zip <TKey, TLeft, TRight, TCursorLeft, TCursorRight>( this ContainerSeries <TKey, TLeft, TCursorLeft> series, ContainerSeries <TKey, TRight, TCursorRight> other) where TCursorLeft : ISpecializedCursor <TKey, TLeft, TCursorLeft> where TCursorRight : ISpecializedCursor <TKey, TRight, TCursorRight> { var zip = new Zip <TKey, TLeft, TRight, TCursorLeft, TCursorRight>(series.GetContainerCursor(), other.GetContainerCursor()); return(zip.Source); }
internal static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Range <TKey, TValue, TCursor>( this ContainerSeries <TKey, TValue, TCursor> series, Opt <TKey> startKey, Opt <TKey> endKey, bool startInclusive = true, bool endInclusive = true) where TCursor : ISpecializedCursor <TKey, TValue, TCursor> { var cursor = new Range <TKey, TValue, TCursor>( series.GetContainerCursor(), startKey, endKey, startInclusive, endInclusive); return(cursor.Source); }
public static Stat2 <TKey> Stat2 <TKey, TValue, TCursor>(this ContainerSeries <TKey, TValue, TCursor> series) where TCursor : ICursor <TKey, TValue, TCursor> { var stat = new Stat2 <TKey>(); using (var cursor = series.GetContainerCursor()) { var first = true; while (cursor.MoveNext()) { if (first) { stat._start = cursor.CurrentKey; first = false; } stat.AddValue(DoubleUtil.GetDouble(cursor.CurrentValue)); } stat._end = cursor.CurrentKey; stat._endValue = DoubleUtil.GetDouble(cursor.CurrentValue); } return(stat); }
this ContainerSeries <TKey, TValue, TCursor> series, Func <((TKey, TValue) current, (TKey, TValue) previous), TResult> selector, int lag = 1, int step = 1)
this ContainerSeries <TKey, TLeft, TCursorLeft> series, ContainerSeries <TKey, TRight, TCursorRight> other, Func <TKey, TLeft, TRight, TResult> selector)