TSparseMtx.SetVal Method

Overload List

#SignatureDescription
1TMtxVec SetVal(TCplx Value)Set all calling object complex elements to complex Value.
└ indexed: TMtxVec SetVal(TCplx Value, Int32 Index, Int32 Len)
2TMtxVec SetVal(Double Value)Initialize elements to Value.
└ indexed: TMtxVec SetVal(Double Value, Int32 Index, Int32 Len)

Overload 1: TMtxVec SetVal(TCplx Value)

Set all calling object complex elements to complex Value.

#NameTypeDescription
1ValueTCplxscalar

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

Indexed: TMtxVec SetVal(TCplx Value, Int32 Index, Int32 Len)

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

#NameTypeDescription
1ValueTCplxscalar
2IndexInt32start index
3LenInt32element count

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

Remarks:

Dew.Math.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: TMtxVec SetVal(Double Value)

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
Matrix a;
a.Size(1,4,false);
a.SetVal(1); // a = new double[] {1,1,1,1}

Indexed: TMtxVec SetVal(Double Value, Int32 Index, Int32 Len)

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

#NameTypeDescription
1ValueDoublescalar
2IndexInt32start index
3LenInt32element 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.