Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Min: Integer; | Minimum value. |
| └ indexed: function Min(Index: Integer; Len: Integer): Integer; | ||
| 2 | function Min(out aIndex: Integer): Integer; | Calculate the minimum value of all calling object elements. |
| └ indexed: function Min(out aIndex: Integer; Index: Integer; Len: Integer): Integer; |
Overload 1: function Min: Integer;
Minimum value.
Returns: Int32 - The minimum value of all calling object elements. The result is an integer value.
Examples
var a: TVecInt;
b: integer;
begin
CreateIt(a);
try
a.SetIt([1,2,3,4]);
b := a.Min; // 1
finally
FreeIt(a);
end;
end;
Indexed: function Min(Index: Integer; Len: Integer): Integer;
Calculate the minimum 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.
Examples
Uses MtxVecInt;
procedure Example;
var a: TVecInt;
min, ind: integer;
begin
CreateIt(a);
try
a.SetIt([1,2,3,4]);
min := a.Min(ind); //min=1, ind = 0
finally
FreeIt(a);
end
end;
Overload 2: function Min(out aIndex: Integer): Integer;
Calculate the minimum value of all calling object elements.
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Stores minimum value index. |
Returns: Int32 - the minimum of all calling vector integer elements in-place.
Examples
var a: TMtxInt;
b: integer;
begin
CreateIt(a);
try
a.SetIt([1,2,3,4]);
b := a.Min; // 1
finally
FreeIt(a);
end;
end;
Indexed: function Min(out aIndex: Integer; Index: Integer; Len: Integer): Integer;
Calculate the maximum value of calling object elements [Index..Index+Len-1].
| # | Name | Description |
|---|---|---|
| 1 | aIndex | Returns minimum 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 minimum of calling vector integer elements [Index..Index+Len-1].
Remarks:
An exception is raised if array borders are overrun/underrun.
Examples
Uses MtxVecInt;
procedure Example;
var a: TMtxInt;
min, ind: integer;
begin
CreateIt(a);
try
a.SetIt(1,2,3,4]);
min := a.Min(ind); //min=1, ind = 0
finally
FreeIt(a);
end
end;