Overload List
Overload 1: function MulAndAdd(const X: TMtx; const Y: TCplx; const Z: TCplx): Matrix;
Compute (X*yScalar) + zScalar, where X is a Matrix.
Returns: Matrix
Overload 2: function MulAndAdd(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 MulAndAdd(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 4: function MulAndAdd(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 5: function MulAndAdd(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 6: function MulAndAdd(const X: TMtx; const Y: Double; const Z: Double): Matrix;
Compute (X*yScalar) + zScalar, where X is a Matrix.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TMtx | |
| 2 | Y | Double | |
| 3 | Z | Double |
Returns: Matrix
Overload 7: function MulAndAdd(const X: TVec; const Y: TCplx; const Z: TCplx): Vector;
Compute (X*yScalar) + zScalar, where X is a Matrix.
Returns: Vector
Overload 8: function MulAndAdd(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 9: function MulAndAdd(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 10: function MulAndAdd(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 product of X and Y scaled by xyScale, and then adds Z scaled by zScale, without creating temporary objects.
var
xyScale: Double;
X, Y, Z, A1, A2, A3: Vector;
begin
xyScale := 1.5, zScale = 2.0;
X := [2, 4, 6, 8];
Y := [1, 1, 1, 1];
Z := [3, 4, 5, 6];
A1 := (X * Y * xyScale) + (Z * zScale);
A2 := MulAndAdd(X, xyScale, Y, xyScale, Z, zScale);
A3.MulAndAdd(X, xyScale, Y, xyScale, Z, zScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 11: function MulAndAdd(const X: TVec; const Y: TMtxVec; const xyScale: Double; const Z: Double): Vector;
Compute (X*Y)*xyScale + zScalar
Returns: Vector
Computes the product of X and Y scaled by xyScale, then adds a scalar zScalar, without creating temporary objects.
var
xyScale: Double;
X, Y, A1, A2, A3: Vector;
begin
xyScale := 1.5, zScalar = 2.0;
X := [2, 4, 6, 8];
Y := [1, 1, 1, 1];
A1 := (X * Y * xyScale) + zScalar;
A2 := MulAndAdd(X, xyScale, Y, xyScale, zScalar);
A3.MulAndAdd(X, xyScale, Y, xyScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 12: function MulAndAdd(const X: TVec; const Y: Double; const Z: Double): Vector;
Compute (X*yScalar) + zScalar
| # | Name | Type | Description |
|---|---|---|---|
| 1 | X | TVec | |
| 2 | Y | Double | |
| 3 | Z | Double |
Returns: Vector
Computes the result of multiplying X by a scalar yScalar and then adding a scalar zScalar, without creating temporary objects.
var
yScalar: Double;
X, A1, A2, A3: Vector;
begin
yScalar := 2.0, zScalar = 3.0;
X := [2, 4, 6, 8];
A1 := (X * yScalar) + zScalar;
A2 := MulAndAdd(X, yScalar, zScalar);
A3.MulAndAdd(X, yScalar, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;