Exemplo n.º 1
0
 public static M Sum <M>(this IAdditiveMonoid <M> g, params M[] source)
 {
     return(g.Sum(source.ToList()));
 }
Exemplo n.º 2
0
        public static M SumNSmallest <M>(this IAdditiveMonoid <M> g, IEnumerable <M> source, int n)
        {
            var nsmallest = g.GetNSmallest(source, n);

            return(g.Sum(nsmallest));
        }