Overload List
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
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
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
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
Returns: Matrix
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
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
Returns: Matrix
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
Returns: Matrix
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
Returns: Matrix
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
Returns: Matrix
Overload 10: function MulAndSub(const X: TVec; const Y: TCplx; const Z: TMtxVec; const zScale: TCplx): Vector;
Compute X*yScalar - Z*zScale
Returns: Vector
Overload 11: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;
Overload 12: function MulAndSub(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec): Vector;
Compute X*Y*xyScale - Z
Returns: Vector
Overload 13: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;
Compute X*Y - Z
Returns: Vector
Computes the element-wise product of X and Y, then subtracts Z, without creating temporary objects.
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;
Overload 15: function MulAndSub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Vector;
Compute X*Y - Z*zScale
Returns: Vector
Computes the element-wise product of X and Y, then subtracts (Z multiplied by zScale), without creating temporary objects.
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
Returns: Vector
Computes the element-wise product of X and Y, then subtracts a scalar zScalar, without creating temporary objects.
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
Returns: Vector
Computes the element-wise product of X and Y scaled by xyScale, then subtracts Z, without creating temporary objects.
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
Returns: Vector
Computes the result of multiplying X by a scalar yScalar and then subtracting Z multiplied by zScale, without creating temporary objects.
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;