TOpenCLVector.Ramp Method

Overload List

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

Overload 1: function Ramp: TOpenCLVector; overload;

Fills the calling vector with a series following linear rule.

Returns: TOpenCLVector

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: TOpenCLVector;
begin
    ClMtxVec.CreateIt(a);
    try
        a.Size(5,True);
        a.Ramp(0,PI);
        a.Sin;
    finally
        ClMtxVec.FreeIt(a);
    end;
end;

which is identical to:

ClMtxVec.CreateIt(a);
try
    a.Size(5,True);
    for i:= 0 to a.Length-1 do a[i] := sin(i * PI);
finally
    ClMtxVec.FreeIt(a);
end;
See Also: TOpenCLMtxVec.SetVal, TOpenCLMtxVec.SetVal, TOpenCLMtxVec.SetVal, TOpenCLMtxVec.SetVal

Overload 2: function Ramp(const Offset, Step: TCplx): TOpenCLVector; overload;

Fills the calling vector with a series.

#NameTypeDescription
1OffsetTCplxscalar
2StepTCplxscalar

Returns: TOpenCLVector

Remarks:

Method follow the rule:

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

Indexed: function Ramp(const Offset, Step: TCplx; Index,Len: integer): TOpenCLVector; overload;

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

#NameTypeDescription
1OffsetTCplxscalar
2StepTCplxscalar
3Indexintegerstart index
4Lenintegerelement count

Returns: TOpenCLVector

Remarks:

Following 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(const Offset: TCplx; const Step: double): TOpenCLVector; overload;

The Offset is complex, but the step is real.

#NameTypeDescription
1OffsetTCplxscalar
2Stepdoublescalar

Returns: TOpenCLVector

Indexed: function Ramp(const Offset: TCplx; const Step: double; Index,Len: integer): TOpenCLVector; overload;

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

#NameTypeDescription
1OffsetTCplxscalar
2Stepdoublescalar
3Indexintegerstart index
4Lenintegerelement count

Returns: TOpenCLVector

Remarks:

Following the rule:

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

The Offset is complex, but the step is real.

Overload 4: function Ramp(const Offset, Step: double): TOpenCLVector; overload;

Fills the calling vector.

#NameTypeDescription
1Offsetdoublescalar
2Stepdoublescalar

Returns: TOpenCLVector

Remarks:

Method uses the following rule:

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

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

Indexed: function Ramp(const Offset,Step: double; Index,Len: integer): TOpenCLVector; overload;

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

#NameTypeDescription
1Offsetdoublescalar
2Stepdoublescalar
3Indexintegerstart index
4Lenintegerelement count

Returns: TOpenCLVector

Remarks:

Method uses the following 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.