IMatrixModel.Rank

Syntax

Rank(DimIndex: Integer; Ascending: Boolean; Method: MatrixRankMethod): IMatrixModel;

Parameters

DimIndex. The matrix dimension, by which the ranking is executed.

Ascending. The parameter that determines sorting order.

Method. The method that is used to create a ranking matrix.

Description

The Rank method creates a ranking matrix, considering the specified parameters. The ranking matrix has the same dimensions as the source matrix.

Comments

If Ascending parameter is set to True, sorting is ascending.

Example

Add a link to the MathFin system assembly.

Sub UserProc;
Var
    M, RankM: Matrix[2];
    Mm: IMatrixModel;
    x, y: Integer;
Begin
    Debug.WriteLine("Source matrix");
    For x := 0 To 4 Do
        For y := 0 To 4 Do
            M[x, y] := Math.RandBetweenI(1020);
            Debug.Write(M[x, y] + " ");
            End For;
        Debug.WriteLine("");
    End For;
    Mm := M As IMatrixModel;
    RankM := Mm.Rank(0True, MatrixRankMethod.NoOrdered);
    Debug.WriteLine("Ranking matrix");
    For x := 0 To 4 Do
        For y := 0 To 4 Do
            Debug.Write(RankM[x, y] + " ");
        End For;
        Debug.WriteLine("");
    End For;
End Sub UserProc;

After executing the example a matrix containing random values is created. For this matrix a ranking matrix is obtained, both matrices are displayed in the development environment console.

See also:

IMatrixModel