Matrix<T>.Aggregate Rows By Method
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
Overload List
Aggregate | Returns a new matrix that aggregates the rows according to the specified grouping. |
Aggregate | Returns a new matrix that aggregates the rows grouped by the specified row. |
Aggregate | Returns a new matrix that aggregates the rows grouped by the specified vector. |
Aggregate | Applies the specified aggregation function to the values in each row grouped by the specified grouping row. |
AggregateRowsBy<C, U>(C, AggregatorGroup<U>)
Returns a new matrix that aggregates the rows grouped by the specified row.
public Matrix<U> AggregateRowsBy<C, U>(
C groupingRowKey,
AggregatorGroup<U> aggregator
)
Parameters
- groupingRowKey C
- The key of the grouping row.
- aggregator AggregatorGroup<U>
- The aggregator to apply to each group.
Type Parameters
- C
- The type of the row keys.
- U
- The type of the result of the aggregator.
Return Value
Matrix<U>A new matrix, with columns indexed by the unique elements of the row with key groupingRowKey, and values the result of applying aggregator to each group of the remaining rows.
AggregateRowsBy<U>(IGrouping, AggregatorGroup<U>)
Returns a new matrix that aggregates the rows according to the specified grouping.
public Matrix<U> AggregateRowsBy<U>(
IGrouping grouping,
AggregatorGroup<U> aggregator
)
Parameters
- grouping IGrouping
- The grouping object.
- aggregator AggregatorGroup<U>
- The aggregator to apply to each group.
Type Parameters
- U
- The type of the result of the aggregator.
Return Value
Matrix<U>A new matrix, with columns indexed by the index associated with grouping, and as values the result of applying aggregator to each group of each row.
AggregateRowsBy<K, U>(IList<K>, AggregatorGroup<U>)
Returns a new matrix that aggregates the rows grouped by the specified vector.
public Matrix<U> AggregateRowsBy<K, U>(
IList<K> groupingVector,
AggregatorGroup<U> aggregator
)
Parameters
- groupingVector IList<K>
- The vector that contains the group memberships.
- aggregator AggregatorGroup<U>
- The aggregator to apply to each group.
Type Parameters
- K
- The element type of the grouping vector.
- U
- The type of the result of the aggregator.
Return Value
Matrix<U>A new matrix, with columns indexed by the unique elements of groupingVector, and as values the result of applying aggregator to each group of each row.
AggregateRowsBy<R, U>(R, Func<Vector<T>, U>)
Applies the specified aggregation function to the values
in each row grouped by the specified grouping row.
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.