Matrix<T>.Reduce<U> Method
Applies a function to each row or column in a matrix and returns the result as a vector.
Definition
Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
C#
A DenseVector<T> whose elements are the result of applying function to each row or column of the matrix.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
public DenseVector<U> Reduce<U>(
Func<Vector<T>, U> function,
DimensionType dimension
)
Parameters
- function Func<Vector<T>, U>
- A delegate that represents a multivariate function.
- dimension DimensionType
- The dimension that should be reduced.
Type Parameters
- U
Return Value
DenseVector<U>A DenseVector<T> whose elements are the result of applying function to each row or column of the matrix.
Remarks
The length of the returned vector equals the number of rows or columns in the matrix.
Exceptions
Argument | function is null. |