Vector.Ramp Method

Overload List

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

Overload 1: function Ramp: TVec;

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
var a: Vector;
begin
    a.Size(5,True);
    a.Ramp(0,PI);
    a.Sin;
end;
a.Size(5,True);
for i:= 0 to a.Length-1 do a[i] := sin(i*PI);
See Also: Vector.SetVal

Overload 2: function Ramp(Offset: TCplx; Step: TCplx): TVec;

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.
Examples
Values[k] :=  k

Indexed: function Ramp(Offset: TCplx; Step: TCplx; Index: Integer; Len: Integer): TVec;

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

#NameTypeDescription
1OffsetTCplxscalar
2StepTCplxscalar
3IndexIntegerstart index
4LenIntegerelement 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: function Ramp(Offset: TCplx; Step: Double): TVec;

The Offset is complex, but the step is real.

#NameTypeDescription
1OffsetTCplxscalar
2StepDoublescalar

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

Indexed: function Ramp(Offset: TCplx; Step: Double; Index: Integer; Len: Integer): TVec;

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

#NameTypeDescription
1OffsetTCplxscalar
2StepDoublescalar
3IndexIntegerstart index
4LenIntegerelement 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: function Ramp(Offset: Double; Step: Double): TVec;

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.

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

Indexed: function Ramp(Offset: Double; Step: Double; Index: Integer; Len: Integer): TVec;

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

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

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