Matrix<T>.AggregateRowsBy<R, U>(R, Func<Vector<T>, U>) Method

Applies the specified aggregation function to the values in each row grouped by the specified grouping row.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public Matrix<U> AggregateRowsBy<R, U>(
	R groupingRowKey,
	Func<Vector<T>, U> aggregator
)

Parameters

groupingRowKey  R
The key of the grouping row.
aggregator  Func<Vector<T>, U>
A function that transforms a vector of type T to a value of type U.

Type Parameters

R
The element type of the row index of the matrix.
U
The type of the result of the aggregation.

Return Value

Matrix<U>
A new matrix with columns indexed by the unique elements of row groupingRowKey and values the result of aggregator applied to each grouping.

See Also