IMatrixModel.Rank

Syntax

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

Parameters

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

Ascending. Parameter that determines direction of sorting. If True, sorting is ascending.

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.

Example

Sub Main;

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(10, 20);

Debug.Write(M[x, y] + " ");

End For;

Debug.WriteLine("");

End For;

Mm := M As IMatrixModel;

RankM := Mm.Rank(0, True, MatrixRankMethod.NoOrdered);

Debug.WriteLine("Rank 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 Main;

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

See also:

IMatrixModel