MtxExpr.SubScaledC Method

Overload List

#SignatureDescription
1function SubScaledC(const X: TMtx; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Matrix;Result = X*xScale - Y*yScale - zScalar, where X is a Matrix
2function SubScaledC(const X: TMtx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Matrix;Result = X - Y*yScale - zScalar, where X is a Matrix
3function SubScaledC(const X: TMtx; const Y: TMtxVec; const yScale: Double; const Z: Double): Matrix;Result = X - Y*yScale - zScalar, where X is a Matrix
4function SubScaledC(const X: TMtx; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): Matrix;Result = X*xScale - Y*yScale - zScalar, when X is a Matrix
5function SubScaledC(const X: TVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;Result = X*xScale - Y*yScale - zScalar
6function SubScaledC(const X: TVec; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;Result = X - Y*yScale - zScalar
7function SubScaledC(const X: TVec; const Y: TMtxVec; const yScale: Double; const Z: Double): Vector;Result = X - Y*yScale - zScalar
8function SubScaledC(const X: TVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): Vector;Result = X*xScale - Y*yScale - zScalar

Overload 1: function SubScaledC(const X: TMtx; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Matrix;

Compute X*xScale - Y*yScale - zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2xScaleTCplx
3YTMtxVec
4yScaleTCplx
5ZTCplx

Returns: Matrix

Overload 2: function SubScaledC(const X: TMtx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Matrix;

Compute X - Y*yScale - zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3yScaleTCplx
4ZTCplx

Returns: Matrix

Overload 3: function SubScaledC(const X: TMtx; const Y: TMtxVec; const yScale: Double; const Z: Double): Matrix;

Compute X - Y*yScale - zScalar, where X is a Matrix

#NameTypeDescription
1XTMtx
2YTMtxVec
3yScaleDouble
4ZDouble

Returns: Matrix

Overload 4: function SubScaledC(const X: TMtx; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): Matrix;

Compute X*xScale - Y*yScale - zScalar, when X is a Matrix

#NameTypeDescription
1XTMtx
2xScaleDouble
3YTMtxVec
4yScaleDouble
5ZDouble

Returns: Matrix

Overload 5: function SubScaledC(const X: TVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;

Compute X*xScale - Y*yScale - zScalar

#NameTypeDescription
1XTVec
2xScaleTCplx
3YTMtxVec
4yScaleTCplx
5ZTCplx

Returns: Vector

Overload 6: function SubScaledC(const X: TVec; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;

Compute X - Y*yScale - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3yScaleTCplx
4ZTCplx

Returns: Vector

Overload 7: function SubScaledC(const X: TVec; const Y: TMtxVec; const yScale: Double; const Z: Double): Vector;

Compute X - Y*yScale - zScalar

#NameTypeDescription
1XTVec
2YTMtxVec
3yScaleDouble
4ZDouble

Returns: Vector

Remarks:

Computes the result of subtracting Y scaled by yScale and a scalar zScalar from X, without creating temporary objects.

Examples
var
    yScale: Double;
    X, Y, A1, A3: Vector;
begin
yScale := 1.5, zScalar = 3.0;
X := [5, 6, 7, 8];
Y := [1, 2, 3, 4];
A1 := X - Y * yScale - zScalar;
Vector A2 = SubScaledC(X, yScale, Y, zScalar); // Adjust parameter order if needed.
A3.SubScaledC(X, yScale, Y, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 8: function SubScaledC(const X: TVec; const xScale: Double; const Y: TMtxVec; const yScale: Double; const Z: Double): Vector;

Compute X*xScale - Y*yScale - zScalar

#NameTypeDescription
1XTVec
2xScaleDouble
3YTMtxVec
4yScaleDouble
5ZDouble

Returns: Vector

Remarks:

Computes the expression X*xScale - Y*yScale - zScalar without temporary objects.

Examples
var
    xScale: Double;
    X, Y, A1, A2, A3: Vector;
begin
xScale := 1.0, yScale = 2.0, zScalar = 3.0;
X := [5, 6, 7, 8];
Y := [1, 2, 3, 4];
A1 := X * xScale - Y * yScale - zScalar;
A2 := SubScaledC(X, xScale, Y, yScale, zScalar);
A3.SubScaledC(X, xScale, Y, yScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;