TSparseMtx.SetVal Method

Overload List

#SignatureDescription
1function SetVal(const Value: TCplx): TMtxVec; overload;Set all calling object complex elements to complex Value.
└ indexed: function SetVal(const Value: TCplx; Index: integer; Len: integer): TMtxVec; overload;
2function SetVal(const Value: double): TMtxVec; overload;Initialize elements to Value.
└ indexed: function SetVal(const Value: double; Index, Len: integer): TMtxVec; overload;

Overload 1: function SetVal(const Value: TCplx): TMtxVec; overload;

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): TMtxVec; overload;

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:

TMtxVec.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): TMtxVec; overload;

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: Matrix;
begin
    a.Size(1,4,False);
    a.SetVal(1); // a = [1,1,1,1]
end;

Indexed: function SetVal(const Value: double; Index, Len: integer): TMtxVec; overload;

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.