Overload List
Overload 1: function SqrAddScaled(const X: TMtx; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx): Matrix;
Compute sqr(X)*xScale + sqr(Y)*yScale, where X is a Matrix
Returns: Matrix
Overload 2: function SqrAddScaled(const X: TMtx; const Y: TMtxVec; const yScale: TCplx): Matrix;
Compute sqr(X) + sqr(Y)*yScale, where X is a Matrix
Returns: Matrix
Overload 3: function SqrAddScaled(const X: TMtx; const Y: TMtxVec; const yScale: Double): Matrix;
Compute sqr(X) + sqr(Y)*yScale, when X is a Matrix.
Returns: Matrix
Remarks:
The operation does only per-element math.
Overload 4: function SqrAddScaled(const X: TMtx; const xScale: Double; const Y: TMtxVec; const yScale: Double): Matrix;
Compute sqr(X)*xScale + sqr(Y)*yScale, when X is a matrix
Returns: Matrix
Remarks:
The operation does only per-element math.
Overload 5: function SqrAddScaled(const X: TVec; const xScale: TCplx; const Y: TMtxVec; const yScale: TCplx): Vector;
Compute sqr(X)*xScale + sqr(Y)*yScale
Returns: Vector
Overload 6: function SqrAddScaled(const X: TVec; const Y: TMtxVec; const yScale: TCplx): Vector;
Overload 7: function SqrAddScaled(const X: TVec; const Y: TMtxVec; const yScale: Double): Vector;
Compute sqr(X) + sqr(Y)*yScale
Returns: Vector
Remarks:
Computes the sum of the square of X and the scaled square of Y without temporary objects.
Examples
var
yScale: Double;
X, Y, A1, A2, A3: Vector;
begin
yScale := 2.0;
X := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
A1 := MtxExpr.Sqr(X) + MtxExpr.Sqr(Y) * yScale;
A2 := SqrAddScaled(X, Y, yScale);
A3.SqrAddScaled(X, Y, yScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;
Overload 8: function SqrAddScaled(const X: TVec; const xScale: Double; const Y: TMtxVec; const yScale: Double): Vector;
Compute sqr(X)*xScale + sqr(Y)*yScale
Returns: Vector
Remarks:
Computes the weighted sum of the squares of X and Y without temporary objects.
Examples
var
xScale: Double;
X, Y, A1, A2, A3: Vector;
begin
xScale := 2.0, yScale = 3.0;
X := [1, 2, 3, 4];
Y := [2, 3, 4, 5];
A1 := MtxExpr.Sqr(X) * xScale + MtxExpr.Sqr(Y) * yScale;
A2 := SqrAddScaled(X, xScale, Y, yScale);
A3.SqrAddScaled(X, xScale, Y, yScale);
if not A2.IsEqual(A1) then ERaise('Problem');
if not A3.IsEqual(A1) then ERaise('Problem');
end;