MtxExpr.DivAndAdd Method

Overload List

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

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

#NameTypeDescription
1XTMtx
2YTMtxVec
3xyScaleDouble
4ZTMtxVec

Returns: Matrix

Overload 10: function DivAndAdd(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 DivAndAdd(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 DivAndAdd(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;

Compute X/Y + zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3ZTCplx

Returns: Vector

Overload 13: function DivAndAdd(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 DivAndAdd(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 DivAndAdd(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 DivAndAdd(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 adds Z, all without creating temporary objects.

Overload 17: function DivAndAdd(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 DivAndAdd(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, then adds Z multiplied by zScale, all without creating temporary objects.

Overload 19: function DivAndAdd(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 adds the scalar zScalar, all without creating temporary objects.

Overload 20: function DivAndAdd(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 result by xyScale, and then adds 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 := [8,10,12,14];
    Y := [2,2,2,2];
    Z := [1,1,1,1];
    A1 := (X / Y) * xyScale + Z;
    A2 := DivAndAdd(X, Y, xyScale, Z);
    A3.Divide(X, Y, Z); // or via an in-place method: A3.DivAndAdd(X, Y, xyScale, Z);
    if not A2.IsEqual(A1) then ERaise('Problem');
    if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 21: function DivAndAdd(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:

Computes the expression (X divided by Y) multiplied by xyScale plus Z multiplied by zScale, without creating 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 := DivAndAdd(X, xyScale, Y, xyScale, Z, zScale);
A3.DivAndAdd(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 DivAndAdd(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 plus a scalar zScalar, without creating 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 := DivAndAdd(X, xyScale, Y, xyScale, zScalar);
A3.DivAndAdd(X, xyScale, Y, xyScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;