Aggregator<T, TResult>.AggregateWhere Method

Definition

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

Overload List

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

AggregateWhere<TPredicate>(IEnumerable<T>, TPredicate, Boolean)

Aggregates the elements of a sequence and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	IEnumerable<T> values,
	TPredicate predicate,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

values  IEnumerable<T>
A sequence of values.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult

Exceptions

ArgumentNullException

values is null.

AggregateWhere<TPredicate>(ReadOnlySpan<T>, TPredicate, Boolean)

Aggregates the elements of a span and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	ReadOnlySpan<T> values,
	TPredicate predicate,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

values  ReadOnlySpan<T>
A read-only span of values.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult
The result of the aggregation.

AggregateWhere<TPredicate>(Vector<T>, TPredicate, Nullable<Boolean>)

Aggregates the elements of a vector and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	Vector<T> values,
	TPredicate predicate,
	bool? skipMissingValues = null
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

values  Vector<T>
A vector of values.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
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.

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult
The result of the aggregation.

Exceptions

ArgumentNullException

values is null.

AggregateWhere(Int32, ReadOnlySpan<T>, Int32, Func<T, Boolean>, Boolean)

Aggregates over a span and returns the result.
C#
public TResult AggregateWhere(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	Func<T, bool> predicate,
	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.
predicate  Func<T, Boolean>
A 'fast' predicate that returns whether a value should be included in the aggregation.
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.

AggregateWhere<TPredicate>(Int32, ReadOnlySpan<T>, Int32, TPredicate, Boolean)

Aggregates the elements of a vector and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	TPredicate predicate,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

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

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult
The result of the aggregation.

AggregateWhere<TPredicate>(Vector<T>, Int32, Int32, TPredicate, Nullable<Boolean>)

Aggregates the specified range of elements of a vector and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	Vector<T> values,
	int startIndex,
	int endIndex,
	TPredicate predicate,
	bool? skipMissingValues = null
)
where TPredicate : struct, new(), IFastFunc<T, bool>

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.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
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.

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult
The result of the aggregation.

Exceptions

ArgumentNullException

values is null.

AggregateWhere<TPredicate>(Int32, ReadOnlySpan<T>, Int32, ReadOnlySpan<Int32>, TPredicate, Boolean)

Aggregates the specified range of elements of a vector and returns the result.
C#
public TResult AggregateWhere<TPredicate>(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	ReadOnlySpan<int> indexes,
	TPredicate predicate,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, bool>

Parameters

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

Type Parameters

TPredicate
The type of predicate.

Return Value

TResult
The result of the aggregation.

AggregateWhere<T2, TPredicate>(Int32, ReadOnlySpan<T>, Int32, ReadOnlySpan<T2>, Int32, TPredicate, Boolean)

Aggregates the elements of a vector and returns the result.
C#
public TResult AggregateWhere<T2, TPredicate>(
	int length,
	ReadOnlySpan<T> values,
	int stride,
	ReadOnlySpan<T2> values2,
	int stride2,
	TPredicate predicate,
	bool skipMissingValues = false
)
where TPredicate : struct, new(), IFastFunc<T, T2, bool>

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.
values2  ReadOnlySpan<T2>
A read-only span of secondary input values.
stride2  Int32
The distance between successive elements in values2.
predicate  TPredicate
A predicate that filters the values that are to be included in the aggregation.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the aggregation. The default is false.

Type Parameters

T2
TPredicate

Return Value

TResult
The result of the aggregation.

See Also