MtxExpr.AddScaledC Method

Overload List

#SignatureDescription
1function AddScaledC(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 AddScaledC(const X: TMtx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Matrix;Result = X + Y*yScale + zScalar, where X is a Matrix
3function AddScaledC(const X: TMtx; const Y: TMtxVec; const yScale: Double; const Z: Double): Matrix;Result = X + Y*yScale + zScalar, where X is a Matrix
4function AddScaledC(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 AddScaledC(const X: TVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;Result = X*xScale + Y*yScale + zScalar
6function AddScaledC(const X: TVec; const Y: TMtxVec; const yScale: TCplx; const Z: TCplx): Vector;Result = X + Y*yScale + zScalar
7function AddScaledC(const X: TVec; const Y: TMtxVec; const yScale: Double; const Z: Double): Vector;Result = X + Y*yScale + zScalar
8function AddScaledC(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 AddScaledC(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 AddScaledC(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 AddScaledC(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 AddScaledC(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 AddScaledC(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 AddScaledC(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 AddScaledC(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 sum of X and Y scaled by yScale, with an added scalar zScalar, without creating temporary objects.

Examples
var
    yScale: Double;
    X, Y, A1, A2, A3: Vector;
begin
yScale := 1.5, zScalar = 3.0;
X := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
A1 := X + Y * yScale + zScalar;
A2 := AddScaledC(X, Y, yScale, zScalar);
A3.AddScaledC(X, Y, yScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;

Overload 8: function AddScaledC(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 X*xScale + Y*yScale plus a scalar 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 := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
A1 := X * xScale + Y * yScale + zScalar;
A2 := AddScaledC(X, xScale, Y, yScale, zScalar);
A3.AddScaledC(X, xScale, Y, yScale, zScalar);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;