MtxExpr.MulElem Method

Overload List

#SignatureDescription
1function MulElem(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix;Result = X*Y*zScalar, where X is a Matrix
2function MulElem(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;Result = X*Y*Z, when X is a Matrix
3function MulElem(const X: TMtx; const Y: TMtxVec; const Z: Double): Matrix;Result = X*Y*zScalar, when X is a Matrix
4function MulElem(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;Result = X*Y*zScalar
5function MulElem(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;Result = X*Y*Z
6function MulElem(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;Result = X*Y*zScalar

Overload 1: function MulElem(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix;

Compute X*Y*zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTCplx

Returns: Matrix

Overload 2: function MulElem(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;

Compute X*Y*Z, when X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTMtxVec

Returns: Matrix

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

Compute X*Y*zScalar, when X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZDouble

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 4: function MulElem(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;

Compute X*Y*zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTCplx

Returns: Vector

Overload 5: function MulElem(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;

Compute X*Y*Z

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec

Returns: Vector

Remarks:

Computes the product X*Y*Z without temporary objects.

Examples
var
    X, Y, Z, A1, A2, A3: Vector;
begin
X := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
Z := [3, 4, 5, 6];
A1 := X * Y * Z;
A2 := MulElem(X, Y, Z);
A3.Mul(X, Y, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 6: function MulElem(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;

Compute X*Y*zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZDouble

Returns: Vector

Remarks:

Computes the product of X and Y multiplied by the scalar zScalar without temporary objects.

Examples
var
    zScalar: Double;
    X, Y, A1, A2, A3: Vector;
begin
zScalar := 2.0;
X := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
A1 := (X * Y) * zScalar;
A2 := MulElem(X, Y, zScalar);
A3.Mul(X, Y, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;