MtxExpr.DivAndSub Method

Overload List

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

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

Compute (X / Y) * xyScale - zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleTCplx
4ZTCplx

Returns: Matrix

Remarks:

The operation does only per-element math.

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

Compute (X / Y) * xyScale - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleTCplx
4ZTMtxVec
5zScaleTCplx

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 5: function DivAndSub(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 6: function DivAndSub(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 7: function DivAndSub(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 8: function DivAndSub(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 9: function DivAndSub(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 10: function DivAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec; const zScale: Double): Matrix;

Compute (X / Y) * xyScale - Z*zScale, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleDouble
4ZTMtxVec
5zScaleDouble

Returns: Matrix

Remarks:

The operation does only per-element math.

Overload 11: function DivAndSub(const X: TMtx; const Y: TMtxVec; const xyScale: Double; const Z: Double): Matrix;

Compute (X / Y) * xyScale - zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleDouble
4ZDouble

Returns: Matrix

Remarks:

The operation does only per-element math.

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

Compute X/Y - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTCplx

Returns: Vector

Overload 13: function DivAndSub(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TCplx): Vector;

Compute (X / Y) * xyScale - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleTCplx
4ZTCplx

Returns: Vector

Remarks:

The operation does only per-element math.

Overload 14: function DivAndSub(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 15: function DivAndSub(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TMtxVec; const zScale: TCplx): Vector;

Compute (X / Y) * xyScale - Z*zScale

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleTCplx
4ZTMtxVec
5zScaleTCplx

Returns: Vector

Remarks:

The operation does only per-element math.

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

Compute X/Y - Z

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTMtxVec

Returns: Vector

Remarks:

Divides X by Y element-wise and then subtracts Z, all without creating temporary objects.

Overload 17: function DivAndSub(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 18: function DivAndSub(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:

Divides X by Y element-wise and then subtracts Z multiplied by zScale, all without creating temporary objects.

Overload 19: function DivAndSub(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;

Compute X/Y - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZDouble

Returns: Vector

Remarks:

Divides X by Y element-wise and then subtracts the scalar zScalar, without creating temporary objects.

Overload 20: function DivAndSub(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:

Divides X by Y element-wise, multiplies the quotient by xyScale, and then subtracts Z, without creating temporary objects.

Overload 21: function DivAndSub(const X: TVec; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec; const zScale: Double): Vector;

Compute (X / Y) * xyScale - Z*zScale

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleDouble
4ZTMtxVec
5zScaleDouble

Returns: Vector

Remarks:

Divides X by Y, scales the quotient by xyScale, then subtracts Z scaled by zScale, all without temporary objects.

Examples
var
    xyScale: Double;
    X, Y, Z, A1, A2, A3: Vector;
begin
xyScale := 1.5, zScale = 2.0;
X := [8, 10, 12, 14];
Y := [2, 2, 2, 2];
Z := [1, 1, 1, 1];
A1 := (X / Y) * xyScale - Z * zScale;
A2 := DivAndSub(X, xyScale, Y, xyScale, Z, zScale);
A3.DivAndSub(X, xyScale, Y, xyScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 22: function DivAndSub(const X: TVec; const Y: TMtxVec; const xyScale: Double; const Z: Double): Vector;

Compute (X / Y) * xyScale - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3xyScaleDouble
4ZDouble

Returns: Vector

Remarks:

Computes the expression (X divided by Y) multiplied by xyScale and then subtracts the scalar zScalar, all without temporary objects.

Examples
var
    xyScale: Double;
    X, Y, A1, A2, A3: Vector;
begin
xyScale := 1.5, zScalar = 2.0;
X := [8, 10, 12, 14];
Y := [2, 2, 2, 2];
A1 := (X / Y) * xyScale - zScalar;
A2 := DivAndSub(X, xyScale, Y, xyScale, zScalar);
A3.DivAndSub(X, xyScale, Y, xyScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;