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