TMtx.MulElem Method

Overload List

#SignatureDescription
1function MulElem(const Mtx: TMtx): TMtx; overload;Matrix element-wise multiplication.
2function MulElem(const Mtx1, Mtx2: TMtx): TMtx; overload;Multiplies elements in Mtx1 matrix with the elements in Mtx2 matrix (array multiplication) and stores the results in calling matrix.
3function MulElem(const X,Y: TMtxVec; const Z: Double): TMtx; overload;self = X*Y*zScalar
4function MulElem(const X,Y: TMtxVec; const Z: TCplx): TMtx; overload;self = X*Y*zScalar
5function MulElem(const X, Y,Z: TMtxVec): TMtx; overload;self = X*Y*Z

Overload 1: function MulElem(const Mtx: TMtx): TMtx; overload;

Matrix element-wise multiplication.

#NameTypeDescription
1MtxTMtxsource TMtx

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

Remarks:

Multiplies elements in Mtx matrix with the elements in the calling matrix (array multiplication) and stores the results in calling matrix. The TMtx.Rows, TMtx.Cols and TMtxVec.Complex properties of both matrices must match, otherwise an exception is raised.

Examples
var  A,B,C: TMtx;
begin
    CreateIt(A,B,C);
    try
        A.SetIt(2,2,False,[1,2,
            2,4]);
        B.SetIt(2,2,False,[1,2,
            2,4]);
        C.MulElem(A,B);
        // C becomes:
        // [1, 4,
        //  4,16]
    finally
        FreeIt(A,B,C);
    end;
end;
See Also: TMtx.InvElem, TMtx.InvElem, TMtx.InvElem

Overload 2: function MulElem(const Mtx1, Mtx2: TMtx): TMtx; overload;

Multiplies elements in Mtx1 matrix with the elements in Mtx2 matrix (array multiplication) and stores the results in calling matrix.

#NameTypeDescription
1Mtx1TMtxsource TMtx
2Mtx2TMtxsource TMtx

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

Remarks:

The TMtx.Rows, TMtx.Cols and TMtxVec.Complex properties of calling matrix are set implicitly to match those of Mtx1 and Mtx2 matrices. Mtx1 and Mtx2 Rows, Cols, and Complex properties must be the same, otherwise an excetion is raised. raised.

Overload 3: function MulElem(const X,Y: TMtxVec; const Z: Double): TMtx; overload;

Compute X*Y*zScalar

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2YTMtxVecsource TVec or TMtx
3ZDoublescalar

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

Remarks:

The following expression would also run at the same or higher speed, when passing X also for the Z parameter:

X^2*zScalar

Overload 4: function MulElem(const X,Y: TMtxVec; const Z: TCplx): TMtx; overload;

Compute X*Y*zScalar

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2YTMtxVecsource TVec or TMtx
3ZTCplxscalar

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

Remarks:

The following expression would also run at the same or higher speed, when passing X also for the Z parameter:

X^2*zScalar

Overload 5: function MulElem(const X, Y,Z: TMtxVec): TMtx; overload;

Compute X*Y*Z

#NameTypeDescription
1XTMtxVecsource TVec or TMtx
2YTMtxVecsource TVec or TMtx
3ZTMtxVecsource TVec or TMtx

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

Remarks:

The following expression would also run at the same or higher speed, when passing X also for the Z parameter:

X^2*Y