TSparseMtx.Mul Method

Overload List

#SignatureDescription
1procedure Mul(const C: TSparseMtx; const B: TSparseMtx; MaxNonZeroCount: Integer);Multiply two sparse matrices (matrix multiplication).
2function Mul(const Value: TCplx): TMtxVec;Multiply all calling object elements with complex Value in-place.
└ indexed: function Mul(const Value: TCplx; Index: Integer; Len: Integer): TMtxVec;
3function Mul(const Vec: TMtxVec; const Value: TCplx): TMtxVec;Multiply each element of Vec with complex Value.
└ indexed: function Mul(const Vec: TMtxVec; const Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
4function Mul(const Vec: TMtxVec; const Value: Double): TMtxVec;Multiply each element of Vec with Value.
└ indexed: function Mul(const Vec: TMtxVec; const Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;
5function Mul(const Value: Double): TMtxVec;Multiply object elements with Value.
└ indexed: function Mul(const Value: Double; Index: Integer; Len: Integer): TMtxVec;

Overload 1: procedure Mul(const C: TSparseMtx; const B: TSparseMtx; MaxNonZeroCount: Integer);

Multiply two sparse matrices (matrix multiplication).

#NameTypeDescription
1CTSparseMtx
2BTSparseMtx
3MaxNonZeroCountInteger

Result: stored in self (calling object)

Remarks:

Multiply sparse matrices A and B and place the result in the calling matrix. Because the resulting matrix can be much less sparse, the memory requirements can increase beyond the available system memory. This method will raise an exception, if the requested memory size will exceed the value of MaxNonZeroCount.

See Also: TSparseMtx.MulLeft, TSparseMtx.MulRight

Overload 2: function Mul(const Value: TCplx): TMtxVec;

Multiply all calling object elements with complex Value in-place.

#NameTypeDescription
1ValueTCplxscalar

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

Indexed: function Mul(const Value: TCplx; Index: Integer; Len: Integer): TMtxVec;

Multipy calling object elements [Index]..[Index+Len-1] with complex Value in-place.

#NameTypeDescription
1ValueTCplxscalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

An exception is raised if array borders are overrun or underrun.

Overload 3: function Mul(const Vec: TMtxVec; const Value: TCplx): TMtxVec;

Multiply each element of Vec with complex Value.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueTCplxscalar

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

Remarks:

Store the result in the calling object. Size of the calling object is set automatically. TMtxVec.Complex property of the calling object is set to True.

Indexed: function Mul(const Vec: TMtxVec; const Value: TCplx; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;

Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with complex Value.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueTCplxscalar
3VecIndexInteger
4IndexIntegerstart index
5LenIntegerelement count

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

Remarks:

Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. TMtxVec.Complex propertiy of the calling object is set to True.

Overload 4: function Mul(const Vec: TMtxVec; const Value: Double): TMtxVec;

Multiply each element of Vec with Value.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueDoublescalar

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

Remarks:

Store the result in the calling object. Size and TMtxVec.Complex properties of the calling object are adjusted automatically.

Indexed: function Mul(const Vec: TMtxVec; const Value: Double; VecIndex: Integer; Index: Integer; Len: Integer): TMtxVec;

Multiply Vec elements [VecIndex]..[VecIndex+Len-1] with Value.

#NameTypeDescription
1VecTMtxVecsource TVec or TMtx
2ValueDoublescalar
3VecIndexInteger
4IndexIntegerstart index
5LenIntegerelement count

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

Remarks:

Store the result in calling object elements [Index]..[Index+Len-1]. Size of the calling object is not changed. An exception is raised if array borders are overrun or underrun. TMtxVec.Complex propertiy of the calling object is set implicitly.

Overload 5: function Mul(const Value: Double): TMtxVec;

Multiply object elements with Value.

#NameTypeDescription
1ValueDoublescalar

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

Remarks:

Multiplies all calling object elements with Value in-place.

Examples
var v: Vector;
begin
    v.SetIt(1,3,false,[2,3,5]);  // v = [2,3,5]
    v := v*3; // v = [6,9,15]
end;

Indexed: function Mul(const Value: Double; Index: Integer; Len: Integer): TMtxVec;

Multipy calling object elements [Index]..[Index+Len-1] with Value in-place.

#NameTypeDescription
1ValueDoublescalar
2IndexIntegerstart index
3LenIntegerelement count

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

Remarks:

An exception is raised if array borders are overrun or underrun.