TAbstractMtxVecInt.Max Method

Overload List

#SignatureDescription
1function Max(): integer; overload;Maximum value.
└ indexed: function Max(Index, Len: integer): integer; overload;
2function Max(out aIndex: integer): integer; overload;Calculate the maximum value of all calling object elements.
└ indexed: function Max(out aIndex: integer; Index, Len: integer): integer; overload;

Overload 1: function Max(): integer; overload;

Maximum value.

Returns: integer - The maximum value of all calling object elements. The result is an integer value.

Examples
var a: Matrix;
    b: double;
begin
    a := [[1,2],[3,4]];
    b := a.Max; // b = 4
end;

Indexed: function Max(Index, Len: integer): integer; overload;

Calculate the maximum value from calling object elements [Index]..[Index+Len-1].

#NameTypeDescription
1Indexintegerstart index
2Lenintegerelement count

Returns: integer

Remarks:

The result is an integer value. An exception is raised if array borders are overrun.

Overload 2: function Max(out aIndex: integer): integer; overload;

Calculate the maximum value of all calling object elements.

#NameDescription
1aIndex

Stores maximum value index.

Returns: integer - the maximum of all calling vector integer elements in-place.

Examples
Uses MtxExprInt;

procedure Example;
var a: MatrixInt;
    max, ind: integer;
begin
    a := [[1, 2], [3, 4]];
    max := a.Max(ind); // max = 4, ind = 3
end;

Indexed: function Max(out aIndex: integer; Index, Len: integer): integer; overload;

Calculate the maximum value of calling object elements [Index..Index+Len-1].

#NameDescription
1aIndex

Returns maximum value index.

2Index

The starting index at which to start the search.

3Len

The number of elements to search starting from Index.

Returns: integer - the maximum of calling vector integer elements [Index..Index+Len-1].

Remarks:

An exception is raised if array borders are overrun/underrun.