TMtxByte.SortAscend Method

Overload List

#SignatureDescription
1TMtxInt SortAscendSorts the elements in a matrix row(s) in ascending order.
└ indexed: TMtxVecInt SortAscend(Int32 Index, Int32 Len)
2TMtxInt SortAscend(Int32 Col)Performs row based sort in ascending order. The Col parameter defines the column based on which the rows are compared with each other.
3TMtxVecInt SortAscend(TMtxVecInt DstSortIdx, Int32 SortIdxIndex, Int32 Index, Int32 Len)Sort all calling vector elements in ascending order in-place.

Overload 1: TMtxInt SortAscend

Sorts the elements in a matrix row(s) in ascending order.

Result: stored in self (calling object), returns self for chaining

Remarks:

Sorts the elements in calling matrix row(s) in ascending order in-place.

Note
Each row is sorted independently from the other.

Examples
TMtx A;
MtxVec.CreateIt(out A);
try
    {
        A.SetIt(2,2,false,[1,2,
        4,2]);
        A.SortAscend;
        // A becomes:
        // [1,2]
        // [2,4]
    }
finally
    {
        MtxVec.FreeIt(ref A);
    }

Indexed: TMtxVecInt SortAscend(Int32 Index, Int32 Len)

Sort calling vector elements [Index..Index+Len-1] in ascending order in-place.

#NameTypeDescription
1IndexInt32start index
2LenInt32element count

Result: stored in self (calling object), returns self for chaining

Overload 2: TMtxInt SortAscend(Int32 Col)

Performs row based sort in ascending order. The Col parameter defines the column based on which the rows are compared with each other.

#NameTypeDescription
1ColInt32

Result: stored in self (calling object), returns self for chaining

Overload 3: TMtxVecInt SortAscend(TMtxVecInt DstSortIdx, Int32 SortIdxIndex, Int32 Index, Int32 Len)

Sort all calling vector elements in ascending order in-place.

#NameDescription
1DstSortIdxAfter execution stores sorted values indices.
2SortIdxIndexThe starting index at which to store sorted values indices in DstSortIdx.
3IndexThe starting index at which to start the sort.
4LenThe number of elements to sort starting from including zero-based Index.

Result: stored in self (calling object), returns self for chaining

Returns: calling vector, storing sorted values.

Remarks:

Size of DstSortIdx and calling vector are adjusted automatically.