Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function Sub(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix; | Result = X - Y - zScalar, where X is a Matrix |
| 2 | function Sub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix; | Result = X - Y - Z, where X is a Matrix |
| 3 | function Sub(const X: TMtx; const Y: TMtxVec; const Z: Double): Matrix; | Result = X - Y - zScalar, where X is a Matrix |
| 4 | function Sub(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector; | Result = X - Y - zScalar |
| 5 | function Sub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector; | Result = X - Y - Z |
| 6 | function Sub(const X: TVec; const Y: TMtxVec; const Z: Double): Vector; | Result = X - Y - zScalar |
Overload 1: function Sub(const X: TMtx; const Y: TMtxVec; const Z: TCplx): Matrix;
Compute X - Y - zScalar, where X is a Matrix.
Returns: Matrix
Overload 2: function Sub(const X: TMtx; const Y: TMtxVec; const Z: TMtxVec): Matrix;
Compute X - Y - Z, where X is a Matrix
Returns: Matrix
Overload 3: function Sub(const X: TMtx; const Y: TMtxVec; const Z: Double): Matrix;
Compute X - Y - zScalar, where X is a Matrix.
Returns: Matrix
Overload 4: function Sub(const X: TVec; const Y: TMtxVec; const Z: TCplx): Vector;
Overload 5: function Sub(const X: TVec; const Y: TMtxVec; const Z: TMtxVec): Vector;
Compute X - Y - Z
Returns: Vector
Remarks:
Computes the difference of three vector-based operands (X, Y, and Z) without creating temporary objects.
Examples
var
X, Y, Z, A1, A2, A3: Vector;
begin
X := [5, 6, 7, 8];
Y := [1, 2, 3, 4];
Z := [1, 1, 1, 1];
A1 := X - Y - Z;
A2 := Sub(X, Y, Z);
A3.Sub(X, Y, Z);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 6: function Sub(const X: TVec; const Y: TMtxVec; const Z: Double): Vector;
Compute X - Y - zScalar
Returns: Vector
Remarks:
Computes the difference between X and Y and then subtracts a scalar zScalar, without creating temporary objects.
Examples
var
zScalar: Double;
X, Y, A1, A2, A3: Vector;
begin
zScalar := 3.0;
X := [5, 6, 7, 8];
Y := [1, 2, 3, 4];
A1 := X - Y - zScalar;
A2 := Sub(X, Y, zScalar);
A3.Sub(X, Y, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;