Overload List
| # | Signature | Description |
|---|---|---|
| 1 | TVecInt Ramp | Fills the calling vector with a series following linear rule. |
| 2 | TVecInt Ramp(Double Offset, Double Step) | Fills the calling vector. |
| └ indexed: TMtxVecInt Ramp(Double Offset, Double Step, Int32 Index, Int32 Len) |
Overload 1: TVecInt Ramp
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
TVecInt a;
MtxVec.CreateIt(out a);
try
{
a.Size(5,prInt32);
a.Ramp(0,2); // new double[] {0, 2, 4, 6, 8}
}
finally
{
MtxVec.FreeIt(ref a);
}
MtxVec.CreateIt(out a);
try
{
a.Size(5,prInt32);
for i = 0 to a.Length-1 do a[i] = i*2;
}
finally
{
MtxVec.FreeIt(ref a);
}
See Also: TMtxVecInt.SetVal
Overload 2: TVecInt Ramp(Double Offset, Double Step)
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.
Indexed: TMtxVecInt Ramp(Double Offset, Double Step, Int32 Index, Int32 Len)
Fills the calling vector elements [Index]..[Index+Len-1].
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Offset | Double | scalar |
| 2 | Step | Double | scalar |
| 3 | Index | Int32 | start index |
| 4 | Len | Int32 | 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.