Function Math.Sum<T>(IEnumerable<T>, Func<T, Double>) Method
Computes the sum of an expression evaluated for each member of a collection.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
The sum of terms evaluated for each element of collection.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public static double Sum<T>(
IEnumerable<T> collection,
Func<T, double> terms
)
Parameters
- collection IEnumerable<T>
- An enumerable collection of elements of type T.
- terms Func<T, Double>
- A delegate that returns the value of the specified term.
Type Parameters
- T
- The type of the elements of the collection.
Return Value
DoubleThe sum of terms evaluated for each element of collection.
Exceptions
Argument | terms is null. |