Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Abs: TMtxVecInt; | Absolute values. |
| └ indexed: function Abs(Index: Integer; Len: Integer): TMtxVecInt; | ||
| 2 | function Abs(const Src: TMtxVecInt): TMtxVecInt; | Absolute values of all Src vector elements. |
| └ indexed: function Abs(const Src: TMtxVecInt; SrcIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt; |
Overload 1: function Abs: TMtxVecInt;
Absolute values.
Result: stored in self (calling object), returns self for chaining
Calculate the absolute value of all calling object elements in-place.
Uses MtxVecInt;
procedure Example;
var a: TVecInt;
c: double;
begin
CreateIt(a);
a.SetIt([1,-2,3,4]);
a.Abs; // a = [1,2,3,4]
FreeIt(a);
end;
Indexed: function Abs(Index: Integer; Len: Integer): TMtxVecInt;
Absolute values of calling object elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Index | Integer | start index |
| 2 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Returns: calling vector elements [Index]..[Index+Len-1] ansolute vslues.
An exception is raised if array borders are overrun/underrun.
Note
Please note the calling vector elements [Index]..[Index+Len-1] are overwritten with result of routine call.
Uses MtxVecInt;
procedure Example;
var a: TMtxInt;
c: double;
begin
CreateIt(a);
a.SetIt([1,-2,3,4]);
a.Abs; // a = [1,2,3,4]
FreeIt(a);
end;
Overload 2: function Abs(const Src: TMtxVecInt): TMtxVecInt;
Absolute values of all Src vector elements.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecInt | source TVecInt or TMtxInt |
Result: stored in self (calling object), returns self for chaining
Returns: Src vector elements ansolute vslues.
Indexed: function Abs(const Src: TMtxVecInt; SrcIndex: Integer; Index: Integer; Len: Integer): TMtxVecInt;
Absolute values of Src vector elements [VecIndex]..[VecIndex+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Src | TMtxVecInt | source TVecInt or TMtxInt |
| 2 | SrcIndex | Integer | source start index |
| 3 | Index | Integer | start index |
| 4 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Returns: Src vector elements [VecIndex]..[VecIndex+Len-1] absolute values in calling vector elements [Index]..[Index+Len-1].
An exception is raised if array borders are overrun/underrun.
Note
Please note the calling vector elements [Index]..[Index+Len-1] are overwritten with result of routine call.