TOpenCLVector.SetVal Method

Overload List

#SignatureDescription
1function SetVal(const Value: TCplx): TOpenCLMtxVec;Set all calling object complex elements to complex Value.
└ indexed: function SetVal(const Value: TCplx; Index: Integer; Len: Integer): TOpenCLMtxVec;
2function SetVal(const Value: Double): TOpenCLMtxVec;Initialize elements to Value.
└ indexed: function SetVal(const Value: Double; Index: Integer; Len: Integer): TOpenCLMtxVec;

Overload 1: function SetVal(const Value: TCplx): TOpenCLMtxVec;

Set all calling object complex elements to complex Value.

#NameTypeDescription
1ValueTCplxscalar

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

Indexed: function SetVal(const Value: TCplx; Index: Integer; Len: Integer): TOpenCLMtxVec;

Set calling object complex elements [Index]..[Index+Len-1] to complex Value.

#NameTypeDescription
1ValueTCplxscalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

TOpenCLBase.Complex property of the calling object are set to true even before the call it was false. An exception is raised if calling object array borders are overrun/underrun.

Overload 2: function SetVal(const Value: Double): TOpenCLMtxVec;

Initialize elements to Value.

#NameTypeDescription
1ValueDoublescalar

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

Remarks:

Set all calling object elements to Value. If the calling object is complex then the real part is set to Value and the imaginary is set to zero.

Examples
var a: clVector;
begin
    a.Size(4,False);
    a.SetVal(1); // a = [1,1,1,1]
end;

Indexed: function SetVal(const Value: Double; Index: Integer; Len: Integer): TOpenCLMtxVec;

Set all calling object elements [Index]..[Index+Len-1] to real Value.

#NameTypeDescription
1ValueDoublescalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

If the calling object is complex then the real part is set to Value and the imaginary is set to zero. An exception is raised if array borders are overrun/underrun.