Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Ramp: TVecInt; | Fills the calling vector with a series following linear rule. |
| 2 | function Ramp(Offset: Double; Step: Double): TVecInt; | Fills the calling vector. |
| └ indexed: function Ramp(Offset: Double; Step: Double; Index: Integer; Len: Integer): TMtxVecInt; |
Overload 1: function Ramp: TVecInt;
Fills the calling vector with a series following linear rule.
Result: stored in self (calling object), returns self for chaining
Remarks:
Fills the calling vector with a series following the rule:
Values[k] := k
(Offset is zero and Step is one).
Examples
var a: TVecInt;
begin
CreateIt(a);
try
a.Size(5,prInt32);
a.Ramp(0,2); // [0, 2, 4, 6, 8]
finally
FreeIt(a);
end;
end;
CreateIt(a);
try
a.Size(5,prInt32);
for i:= 0 to a.Length-1 do a[i] := i*2;
finally
FreeIt(a);
end;
See Also: TMtxVecInt.SetVal
Overload 2: function Ramp(Offset: Double; Step: Double): TVecInt;
Fills the calling vector.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Offset | Double | scalar |
| 2 | Step | Double | scalar |
Result: stored in self (calling object), returns self for chaining
Remarks:
Method uses the following rule:
Values[k] := Offset + k*Step.
Examples
Values[k] := k
Indexed: function Ramp(Offset: Double; Step: Double; Index: Integer; Len: Integer): TMtxVecInt;
Fills the calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Offset | Double | scalar |
| 2 | Step | Double | scalar |
| 3 | Index | Integer | start index |
| 4 | Len | Integer | element count |
Result: stored in self (calling object), returns self for chaining
Remarks:
Method uses the following rule:
Values[k] := Offset + k*Step.
An exception is raised if calling vector array borders are overrun.
Examples
Values[k] := Offset + k*Step.