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
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));
 }
Example #2
0
 /// <summary>
 /// Sorts the given Matrix by the specified row or column and returns the new Matrix.
 /// </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>
 /// <returns>New Matrix and Vector of original indices.</returns>
 public static Matrix Sort(this Matrix m, Func <Vector, double> keySelector, VectorType t, bool isAscending = true)
 {
     return(Matrix.Sort(m, keySelector, t, isAscending));
 }
Example #3
0
        /// <summary>
        /// Sorts the given Matrix by the specified row or column selector and returns the new Matrix
        /// </summary>
        /// <param name="source">The Matrix</param>
        /// <param name="keySelector">Property selector to sort by.</param>
        /// <param name="t">Specifies whether to sort horizontally or vertically.</param>
        /// <param name="ascending">Determines whether to sort ascending or descending (Default: True)</param>
        /// <returns>New Matrix and Vector of original indices.</returns>
        public static Matrix Sort(Matrix source, Func <Vector, double> keySelector, VectorType t, bool ascending = true)
        {
            Vector v;

            return(Matrix.Sort(source, keySelector, t, ascending, out v));
        }