TVecInt.Ramp Method

Overload List

#SignatureDescription
1TVecInt RampFills the calling vector with a series following linear rule.
2TVecInt 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.

#NameTypeDescription
1OffsetDoublescalar
2StepDoublescalar

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].

#NameTypeDescription
1OffsetDoublescalar
2StepDoublescalar
3IndexInt32start index
4LenInt32element 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.