TOpenCLVector.Ramp Method

Overload List

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

Overload 1: function Ramp: TOpenCLVector;

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;
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: Int32)

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

Fills the calling vector with a series.

#NameTypeDescription
1OffsetTCplx
2StepTCplx

Returns: TOpenCLVector

Remarks:

Method follow the rule:

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

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

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

#NameTypeDescription
1OffsetTCplx
2StepTCplx
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;

The Offset is complex, but the step is real.

#NameTypeDescription
1OffsetTCplx
2StepDouble

Returns: TOpenCLVector

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

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

#NameTypeDescription
1OffsetTCplx
2StepDouble
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: Double; const Step: Double): TOpenCLVector;

Fills the calling vector.

#NameTypeDescription
1OffsetDouble
2StepDouble

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.

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

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

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

#NameTypeDescription
1OffsetDouble
2StepDouble
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.

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