Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Max: Integer; | Maximum value. |
| └ indexed: function Max(const Index: Integer; const Len: Integer): Integer; | ||
| 2 | function Max(out aIndex: Integer): Integer; | Calculate the maximum value of all calling object elements. |
| └ indexed: function Max(out aIndex: Integer; const Index: Integer; const Len: Integer): Integer; |
Overload 1: function Max: Integer;
Maximum value.
Returns: Int32 - The maximum value of all calling object elements. The result is an integer value.
Examples
var
a: TMtxInt;
begin
MtxVecInt.CreateIt(out a);
try
a.SetIt(False, [1,2,3,4]);
int b = a.Max; // 4
finally
MtxVecInt.FreeIt(ref a);
end;
end;
See Also: MatrixInt.Max
Indexed: function Max(const Index: Integer; const Len: Integer): Integer;
Calculate the maximum value from calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Integer | start index |
| 2 | Len | Integer | element count |
Returns: Int32
Remarks:
The result is an integer value. An exception is raised if array borders are overrun.
Overload 2: function Max(out aIndex: Integer): Integer;
Calculate the maximum value of all calling object elements.
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Stores maximum value index. |
Returns: Int32 - the maximum of all calling vector integer elements in-place.
Examples
var
a: TMtxInt;
ind: Integer;
begin
MtxVecInt.CreateIt(out a);
try
a.SetIt(new int[] {1,2,3,4})
int max = a.Max(out ind); //max=3, ind = 3
finally
MtxVecInt.FreeIt(ref a);
end;
end;
See Also: MatrixInt.Min
Indexed: function Max(out aIndex: Integer; const Index: Integer; const Len: Integer): Integer;
Calculate the maximum value of calling object elements [Index..Index+Len-1].
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Returns maximum value index. |
| 2 | Index | The starting index at which to start the search. |
| 3 | Len | The number of elements to search starting from Index. |
Returns: Int32 - the maximum of calling vector integer elements [Index..Index+Len-1].
Remarks:
An exception is raised if array borders are overrun/underrun.