MtxExpr.MulAndSub Method

Overload List

#SignatureDescription
1function MulAndSub(const X: TMtx; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): Matrix;Result = X*yScalar - Z*zScale, where X is a Matrix
2function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix;Result = X*Y - zScalar, where X is a Matrix
3function MulAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec): Matrix;Result = X*Y*xyScale - Z, where X is a Matrix
4function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;Result = X*Y - Z, where X is a Matrix
5function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): Matrix;Result = X*Y - Z*zScale, where X is a Matrix
6function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Matrix;Result = X*Y - Z*zScale, where X is a Matrix
7function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: Double): Matrix;Result = X*Y - zScalar, where X is a Matrix
8function MulAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec): Matrix;Result = X*Y*xyScale - Z, where X is a Matrix
9function MulAndSub(const X: TMtx; const Y: Double; const Z: TMtxVec; const zScale: Double): Matrix;Result = X*yScalar - Z*zScale, where X is a Matrix
10function MulAndSub(const X: TVec; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): Vector;Result = X*yScalar - Z*zScale
11function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;Result = X*Y - zScalar
12function MulAndSub(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec): Vector;Result = X*Y*xyScale - Z
13function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;Result = X*Y - Z
14function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): Vector;Result = X*Y - Z*zScale
15function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Vector;Result = X*Y - Z*zScale
16function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;Result = X*Y - zScalar
17function MulAndSub(const X: TVec; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec): Vector;Result = X*Y*xyScale - Z
18function MulAndSub(const X: TVec; const Y: Double; const Z: TMtxVec; const zScale: Double): Vector;Result = X*yScalar - Z*zScale

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

Compute X*yScalar - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTCplx
3ZTMtxVec
4zScaleTCplx

Returns: Matrix

Overload 2: function MulAndSub(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 3: function MulAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec): Matrix;

Compute X*Y*xyScale - Z, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleTCplx
4ZTMtxVec

Returns: Matrix

Overload 4: function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;

Compute X*Y - Z, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTMtxVec

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 5: function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): Matrix;

Compute X*Y - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTMtxVec
4zScaleTCplx

Returns: Matrix

Overload 6: function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Matrix;

Compute X*Y - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZTMtxVec
4zScaleDouble

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 7: function MulAndSub(const X: TMtx; const Y: TMtxVec; const Z: Double): Matrix;

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

#NameTypeDescription
1XTMtx
2YTMtxVec
3ZDouble

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 8: function MulAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec): Matrix;

Compute X*Y*xyScale - Z, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleDouble
4ZTMtxVec

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 9: function MulAndSub(const X: TMtx; const Y: Double; const Z: TMtxVec; const zScale: Double): Matrix;

Compute X*yScalar - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YDouble
3ZTMtxVec
4zScaleDouble

Returns: Matrix

Overload 10: function MulAndSub(const X: TVec; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): Vector;

Compute X*yScalar - Z*zScale

#NameTypeDescription
1XTVec
2YTCplx
3ZTMtxVec
4zScaleTCplx

Returns: Vector

Overload 11: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;

Compute X*Y - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTCplx

Returns: Vector

Overload 12: function MulAndSub(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec): Vector;

Compute X*Y*xyScale - Z

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleTCplx
4ZTMtxVec

Returns: Vector

Overload 13: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;

Compute X*Y - Z

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec

Returns: Vector

Remarks:

Computes the element-wise product of X and Y, then subtracts Z, without creating temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

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

Overload 14: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: TCplx): Vector;

Compute X*Y - Z*zScale

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec
4zScaleTCplx

Returns: Vector

Overload 15: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Vector;

Compute X*Y - Z*zScale

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec
4zScaleDouble

Returns: Vector

Remarks:

Computes the element-wise product of X and Y, then subtracts (Z multiplied by zScale), without creating temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

var
    X, Y, Z, A1, A2, A3: Vector;
    zScale: Double;
begin
    zScale := 2.0;
    X := [3,6,9,12];
    Y := [1,2,3,4];
    Z := [2,2,2,2];
    A1 := (X * Y) - (Z * zScale);
    A2 := MulAndSub(X, Y, Z, zScale);
    A3.MulAndSub(X, Y, Z, zScale);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 16: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;

Compute X*Y - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZDouble

Returns: Vector

Remarks:

Computes the element-wise product of X and Y, then subtracts a scalar zScalar, without creating temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

var
    X, Y, A1, A2, A3: Vector;
    zScalar: Double;
begin
    zScalar := 2.0;
    X := [3,6,9,12];
    Y := [1,2,3,4];
    A1 := (X * Y) - zScalar;
    A2 := MulAndSub(X, Y, zScalar);
    A3.MulAndSub(X, Y, zScalar);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 17: function MulAndSub(const X: TVec; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec): Vector;

Compute X*Y*xyScale - Z

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleDouble
4ZTMtxVec

Returns: Vector

Remarks:

Computes the element-wise product of X and Y scaled by xyScale, then subtracts Z, without creating temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

var
    X, Y, Z, A1, A2, A3: Vector;
    xyScale: Double;
begin
    xyScale := 1.5;
    X := [3,6,9,12];
    Y := [1,2,3,4];
    Z := [2,2,2,2];
    A1 := (X * Y * xyScale) - Z;
    A2 := MulAndSub(X, Y, xyScale, Z);
    A3.MulAndSub(X, Y, xyScale, Z);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 18: function MulAndSub(const X: TVec; const Y: Double; const Z: TMtxVec; const zScale: Double): Vector;

Compute X*yScalar - Z*zScale

#NameTypeDescription
1XTVec
2YDouble
3ZTMtxVec
4zScaleDouble

Returns: Vector

Remarks:

Computes the result of multiplying X by a scalar yScalar and then subtracting Z multiplied by zScale, without creating temporary objects.

Examples
uses MtxVec, MtxExpr, Math387;

var
    X, Z, A1, A2, A3: Vector;
    yScalar, zScale: Double;
begin
    yScalar := 2.0;
    zScale := 3.0;
    X := [3,6,9,12];
    Z := [1,1,1,1];
    A1 := (X * yScalar) - (Z * zScale);
    A2 := MulAndSub(X, yScalar, Z, zScale);
    A3.MulAndSub(X, yScalar, Z, zScale);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;