Stats.Harmonic Mean Method
Definition
Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
Overload List
Harmonic | Returns the harmonic mean of the elements of an array. |
Harmonic | Returns the harmonic mean of the elements of an array. |
Harmonic | Returns the harmonic mean of the elements of a span. |
Harmonic | Returns the harmonic mean of the elements of a vector. |
HarmonicMean<T>(T[])
Returns the harmonic mean of the elements of an array.
public static T HarmonicMean<T>(
this T[] values
)
Parameters
- values T[]
- An array of values.
Type Parameters
- T
Return Value
TThe harmonic mean of the elements of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type T[]. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.
Exceptions
Argument | values is null. |
HarmonicMean(Int32[])
Returns the harmonic mean of the elements of an array.
public static double HarmonicMean(
int[] values
)
Parameters
Return Value
DoubleThe harmonic mean of the elements of values.
Remarks
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.
The harmonic mean is a Double value.
Exceptions
Argument | values is null. |
HarmonicMean<T>(ReadOnlySpan<T>)
Returns the harmonic mean of the elements of a span.
public static T HarmonicMean<T>(
this ReadOnlySpan<T> values
)
Parameters
- values ReadOnlySpan<T>
- A span of values.
Type Parameters
- T
Return Value
TThe harmonic mean of the elements of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type ReadOnlySpan<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.
Exceptions
Argument | values is null. |
HarmonicMean<T>(Vector<T>)
Returns the harmonic mean of the elements of a vector.
public static T HarmonicMean<T>(
this Vector<T> values
)
Parameters
- values Vector<T>
- A vector.
Type Parameters
- T
Return Value
TThe harmonic mean of the elements of values.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Vector<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Remarks
The harmonic mean is the reciprocal of the arithmetic mean of the reciprocals of the values values.
Exceptions
Argument | values is null. |