Vector.Ramp Method

Overload List

#SignatureDescription
1TVec RampFills the calling vector with a series following linear rule.
2TVec Ramp(TCplx Offset, TCplx Step)Fills the calling vector with a series.
└ indexed: TVec Ramp(TCplx Offset, TCplx Step, Int32 Index, Int32 Len)
3TVec Ramp(TCplx Offset, Double Step)The Offset is complex, but the step is real.
└ indexed: TVec Ramp(TCplx Offset, Double Step, Int32 Index, Int32 Len)
4TVec Ramp(Double Offset, Double Step)Fills the calling vector with a series.
└ indexed: TVec Ramp(Double Offset, Double Step, Int32 Index, Int32 Len)

Overload 1: TVec 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). If the calling vector is complex, only the real part is set.

Examples
Vector a;
a.Size(5,true);
a.Ramp(0,PI);
a.Sin;
a.Size(5,true);
for i = 0 to a.Length-1 do a[i] = sin(i*PI);
See Also: Vector.SetVal

Overload 2: TVec Ramp(TCplx Offset, TCplx Step)

Fills the calling vector with a series.

#NameTypeDescription
1OffsetTCplxscalar
2StepTCplxscalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Follow the rule:

CValues[k] := Offset + k*Step.

Indexed: TVec Ramp(TCplx Offset, TCplx Step, Int32 Index, Int32 Len)

Fills the calling vector elements [Index]..[Index+Len-1] with a series.

#NameTypeDescription
1OffsetTCplxscalar
2StepTCplxscalar
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Follow the rule:

Values[k] := Offset + k*Step.

If the calling vector is complex, only the real part is set. An exception is raised if array borders of the calling vector are overrun.

Overload 3: TVec Ramp(TCplx Offset, Double Step)

The Offset is complex, but the step is real.

#NameTypeDescription
1OffsetTCplxscalar
2StepDoublescalar

Result: stored in self (calling object), returns self for chaining

Indexed: TVec Ramp(TCplx Offset, Double Step, Int32 Index, Int32 Len)

Fills the calling vector elements [Index]..[Index+Len-1] with a series.

#NameTypeDescription
1OffsetTCplxscalar
2StepDoublescalar
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Follow the rule:

Values[k] := Offset + k*Step.

The Offset is complex, but the step is real.

Overload 4: TVec Ramp(Double Offset, Double Step)

Fills the calling vector with a series.

#NameTypeDescription
1OffsetDoublescalar
2StepDoublescalar

Result: stored in self (calling object), returns self for chaining

Remarks:

Follow the rule:

Values[k] := Offset + k*Step.

If the calling vector is complex, only the real part is set.

Indexed: TVec Ramp(Double Offset, Double Step, Int32 Index, Int32 Len)

Fills the calling vector elements [Index]..[Index+Len-1] with a series.

#NameTypeDescription
1OffsetDoublescalar
2StepDoublescalar
3IndexInt32start index
4LenInt32element count

Result: stored in self (calling object), returns self for chaining

Remarks:

Follow the rule:

Values[k] := Offset + k*Step.

If the calling vector is complex, only the real part is set. An exception is raised if calling vector array borders are overrun.