TMtx::SortDescend Method

Overload List

#SignatureDescription
1TMtx *SortDescend();Sorts the elements in a matrix row(s) in descending order.
2TMtx *SortDescend(int Col);Performs row based sort in descending order. The Col parameter defines the column based on which the rows are compared with each other.

Overload 1: TMtx *SortDescend();

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

Remarks:

Sorts the elements in calling matrix row(s) in descending order in-place. If the calling matrix is complex, then complex values are first compared by the absolute value and then by the argument.

Note
Each row is sorted independently from the other.

Examples
#include "MtxVec.h"
#include "Units.MtxVec.h"

using namespace Dew;
using namespace Dew::Math;
using namespace Dew::Math::Units::MtxVec;

void Example()
{
    TMtx* A;

    CreateIt(A);
    A->SetIt(2, 2, false, DewArray<double>{1, 2, 4, 2});
    A->SortDescend();
    // A becomes:
    // [2,1]
    // [4,2]
    FreeIt(A);
}
See Also: TMtx::SortAscend
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler

Overload 2: TMtx *SortDescend(int Col);

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

#NameTypeDescription
1Colint
Declared in Dew::Math::TMtx · Dew.Math/MtxVec.h · Cross-compiler