numl.Math.LinearAlgebra.Matrix.Sort C# (CSharp) Method

Sort() public static method

Sorts the given Matrix by the specified row or column selector and returns the new Matrix
public static Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending = true ) : Matrix
source Matrix The Matrix
keySelector double>.Func Property selector to sort by.
t VectorType Specifies whether to sort horizontally or vertically.
ascending bool Determines whether to sort ascending or descending (Default: True)
return Matrix
        public static Matrix Sort(Matrix source, Func<Vector, double> keySelector, VectorType t, bool ascending = true)
        {
            Vector v;
            return Sort(source, keySelector, t, ascending, out v);
        }

Same methods

Matrix::Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending, Vector &indices ) : Matrix

Usage Example

示例#1
0
 /// <summary>
 ///   Sorts the given Matrix by the specified row or column index and returns the new Matrix
 ///   along with the original indices.
 /// </summary>
 /// <param name="m">The Matrix</param>
 /// <param name="keySelector">Property selector to sort by.</param>
 /// <param name="t">
 ///   Specifies whether to sort horizontally (<see cref="VectorType.Col" />) or vertically (
 ///   <see cref="VectorType.Row" />).
 /// </param>
 /// <param name="isAscending">Determines whether to sort ascending or descending (Default: True)</param>
 /// <param name="indices">Vector of the original (<paramref name="t" />) indices before the sort operation.</param>
 /// <returns>New Matrix and Vector of original indices.</returns>
 public static Matrix Sort(
     this Matrix m,
     Func <Vector, double> keySelector,
     VectorType t,
     bool isAscending,
     out Vector indices)
 {
     return(Matrix.Sort(m, keySelector, t, isAscending, out indices));
 }
All Usage Examples Of numl.Math.LinearAlgebra.Matrix::Sort