TMtxByte.MulElem Method

Overload List

#SignatureDescription
1function MulElem(const Mtx: TMtxInt): TMtxInt;Matrix array multiplication.
2function MulElem(const Mtx1: TMtxInt; const Mtx2: TMtxInt): TMtxInt;Multiplies elements in Mtx1 matrix with the elements in Mtx2 matrix (array multiplication) and stores the results in calling matrix.

Overload 1: function MulElem(const Mtx: TMtxInt): TMtxInt;

Matrix array multiplication.

#NameTypeDescription
1MtxTMtxIntsource TMtxInt

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 TMtxInt.Rows, TMtxInt.Cols and TMtxVecInt.IntPrecision properties of both matrices must match, otherwise an exception is raised.

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

Overload 2: function MulElem(const Mtx1: TMtxInt; const Mtx2: TMtxInt): TMtxInt;

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

#NameTypeDescription
1Mtx1TMtxIntsource TMtxInt
2Mtx2TMtxIntsource TMtxInt

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

Remarks:

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