Example #1
0
 public static IStat <TIn, IEnumerable <TOut> > Report <TIn, TOut, TFeature>(this IConnectableStat <TIn, TOut> connection,
                                                                             int maxSize,
                                                                             Func <TOut, TFeature> featureSelector,
                                                                             Func <TOut, TOut, int> comparer) where TFeature : IComparable
 {
     return(connection.ConnectTo(new Report <TOut, TFeature>(maxSize, featureSelector, comparer)));
 }
Example #2
0
 public static IStat <TIn, IEnumerable <TOut> > Top <TIn, TOut>(
     this IConnectableStat <TIn, TOut> connection,
     int maxSize,
     Func <TOut, TOut, bool> comparer)
 {
     return(connection.ConnectTo(new TopStat <TOut>(maxSize, comparer)));
 }
Example #3
0
 public static IStat <TIn, IEnumerable <TOut> > Popular <TIn, TOut>(
     this IConnectableStat <TIn, TOut> connection,
     int maxSize) where TOut : IComparable
 {
     return(connection.ConnectTo(new PopularStat <TOut>(maxSize)));
 }
Example #4
0
 public static IStat <TIn, double> Average <TIn>(this IConnectableStat <TIn, double> connection)
 {
     return(connection.ConnectTo(new AverageStat <double>(x => x)));
 }
Example #5
0
 public static IStat <TIn, double> Average <TIn, TOut>(this IConnectableStat <TIn, TOut> connection,
                                                       Func <TOut, double> selector)
 {
     return(connection.ConnectTo(new AverageStat <TOut>(selector)));
 }
Example #6
0
 public static IStat <TIn, int> Sum <TIn>(this IConnectableStat <TIn, int> connection)
 {
     return(connection.ConnectTo(new SumStat <int>(x => x)));
 }
Example #7
0
 public static IStat <TIn, int> Sum <TIn, TOut>(this IConnectableStat <TIn, TOut> connection,
                                                Func <TOut, int> selector)
 {
     return(connection.ConnectTo(new SumStat <TOut>(selector)));
 }
Example #8
0
 public static IStat <TIn, int> Count <TIn, TOut>(this IConnectableStat <TIn, TOut> connection, int initValue = 0)
 {
     return(connection.ConnectTo(new CounterStat <TOut>(initValue)));
 }
Example #9
0
 public static IStat <TIn, TOut> Min <TIn, TOut>(this IConnectableStat <TIn, TOut> connection)
 {
     return(connection.ConnectTo(new MinMaxStat <TOut, TOut>(x => x).Select(minMax => minMax.Item1)));
 }
Example #10
0
 public static IStat <TIn, TStat> Min <TIn, TOut, TStat>(this IConnectableStat <TIn, TOut> connection,
                                                         Func <TOut, TStat> selector)
 {
     return(connection.ConnectTo(new MinMaxStat <TOut, TStat>(selector).Select(minMax => minMax.Item1)));
 }
Example #11
0
 public static IStat <TIn, IEnumerable <TOut> > Report <TIn, TOut, TFeature>(this IConnectableStat <TIn, TOut> connection,
                                                                             Func <TOut, TFeature> featureSelector,
                                                                             Func <TOut, TOut, bool> lessComparer) where TFeature : IComparable
 {
     return(connection.ConnectTo(new Report <TOut, TFeature>(featureSelector, lessComparer)));
 }