Overload List
Overload 1: function DivAndAdd(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix;
Compute X/Y + zScalar, where X is a Matrix
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
Returns: Matrix
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
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.
Returns: Matrix
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
Returns: Matrix
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
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
Returns: Matrix
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
Returns: Matrix
The operation does only per-element math.
Overload 9: function DivAndAdd(const X: TMtx; const Y: TMtxVec; const xyScale: Double; const Z: TMtxVec): 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.
Returns: Matrix
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
Returns: Matrix
The operation does only per-element math.
Overload 12: function DivAndAdd(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;
Overload 13: function DivAndAdd(const X: TVec; const Y: TMtxVec; const xyScale: TCplx; const Z: TCplx): Vector;
Compute (X / Y)*xyScale + zScalar
Returns: Vector
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
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.
Returns: Vector
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
Returns: Vector
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;
Overload 18: function DivAndAdd(const X: TVec; const Y: TMtxVec; const Z: TMtxVec; const zScale: Double): Vector;
Compute X/Y + Z*zScale
Returns: Vector
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
Returns: Vector
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
Returns: Vector
Divides X by Y element-wise, multiplies the result by xyScale, and then adds Z, without creating temporary objects.
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
Returns: Vector
Computes the expression (X divided by Y) multiplied by xyScale plus Z multiplied by zScale, without creating temporary objects.
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
Returns: Vector
Computes the expression (X divided by Y) multiplied by xyScale plus a scalar zScalar, without creating temporary objects.
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;