Aggregator<T, TResult>.Aggregate Method

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3

Overload List

Aggregate(Vector<T>) Aggregates the elements of a vector and returns the result.
Aggregate(IEnumerable<T>, Boolean) Aggregates the elements of a sequence and returns the result.
Aggregate(ReadOnlySpan<T>, Boolean) Aggregates the elements of a vector and returns the result.
Aggregate(Vector<T>, Boolean) Aggregates the elements of a vector and returns the result.
Aggregate(ReadOnlySpan<T>, ReadOnlySpan<Boolean>, Boolean) Aggregates over a span and returns the result.
Aggregate(Int32, ReadOnlySpan<T>, Int32, Boolean) Aggregates the elements of a vector and returns the result.
Aggregate(Vector<T>, Int32, Int32, Nullable<Boolean>) Aggregates the specified range of elements of a vector and returns the result.
Aggregate(Int32, ReadOnlySpan<T>, Int32, ReadOnlySpan<Boolean>, Int32, Boolean) Aggregates over a span and returns the result.

Aggregate(Vector<T>)

Aggregates the elements of a vector and returns the result.
C#
public TResult Aggregate(
	Vector<T> values
)

Parameters

values  Vector<T>
A vector of values.

Return Value

TResult
The result of the aggregation.

Remarks

Whether missing values are excluded from the aggregation is inferred from the vector's CheckForMissingValues attribute.

Exceptions

ArgumentNullException

values is null.

Aggregate(IEnumerable<T>, Boolean)

Aggregates the elements of a sequence and returns the result.
C#
public TResult Aggregate(
	IEnumerable<T> values,
	bool skipMissingValues = false
)

Parameters

values  IEnumerable<T>
A sequence of values.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult

Exceptions

ArgumentNullException

values is null.

Aggregate(ReadOnlySpan<T>, Boolean)

Aggregates the elements of a vector and returns the result.
C#
public TResult Aggregate(
	ReadOnlySpan<T> values,
	bool skipMissingValues = false
)

Parameters

values  ReadOnlySpan<T>
A vector of values.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult
The result of the aggregation.

Aggregate(Vector<T>, Boolean)

Aggregates the elements of a vector and returns the result.
C#
public TResult Aggregate(
	Vector<T> values,
	bool skipMissingValues = false
)

Parameters

values  Vector<T>
A vector of values.
skipMissingValues  Boolean  (Optional)
Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult
The result of the aggregation.

Exceptions

ArgumentNullException

values is null.

Aggregate(ReadOnlySpan<T>, ReadOnlySpan<Boolean>, Boolean)

Aggregates over a span and returns the result.
C#
public TResult Aggregate(
	ReadOnlySpan<T> values,
	ReadOnlySpan<bool> mask,
	bool skipMissingValues = false
)

Parameters

values  ReadOnlySpan<T>
A read-only span of values.
mask  ReadOnlySpan<Boolean>
A read-only span of booleans.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult
The result of the aggregation.

Aggregate(Int32, ReadOnlySpan<T>, Int32, Boolean)

Aggregates the elements of a vector and returns the result.
C#
public TResult Aggregate(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	bool skipMissingValues = false
)

Parameters

length  Int32
The number of elements to aggregate.
values  ReadOnlySpan<T>
A read-only span of values.
stride  Int32
The distance between successive elements in values.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult
The result of the aggregation.

Aggregate(Vector<T>, Int32, Int32, Nullable<Boolean>)

Aggregates the specified range of elements of a vector and returns the result.
C#
public TResult Aggregate(
	Vector<T> values,
	int startIndex,
	int endIndex,
	bool? skipMissingValues = null
)

Parameters

values  Vector<T>
A vector of values.
startIndex  Int32
The zero-based index of the first element in values that should be aggregated.
endIndex  Int32
The zero-based index of the last element in values that should be aggregated.
skipMissingValues  Nullable<Boolean>  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. If null (the default), then the value is inferred from values.

Return Value

TResult
The result of the aggregation.

Exceptions

ArgumentNullException

values is null.

Aggregate(Int32, ReadOnlySpan<T>, Int32, ReadOnlySpan<Boolean>, Int32, Boolean)

Aggregates over a span and returns the result.
C#
public TResult Aggregate(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	ReadOnlySpan<bool> mask,
	int maskStride,
	bool skipMissingValues = false
)

Parameters

length  Int32
The number of elements to aggregate.
values  ReadOnlySpan<T>
A read-only span of values.
stride  Int32
The distance between successive elements in values.
mask  ReadOnlySpan<Boolean>
A read-only span of booleans.
maskStride  Int32
The distance between successive elements in mask.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Return Value

TResult
The result of the aggregation.

See Also