IMath.SumX2PY2

Fore Syntax

SumX2PY2(X: Array; Y: Array): Double;

Fore.NET Syntax

SumX2PY2(X: System.Array; System.Y: Array): double;

Parameters

X. Array of real numbers.

Y. Array of real numbers.

Description

The SumX2PY2 method returns the sum of square sums of the corresponding values in two arrays.

Comments

The X and Y arrays must be the same size.

The function works correctly with both one-dimension and two-dimension arrays.

Fore Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r: Double;
    X: Array[7Of Double;
    Y: Array[7Of Double;
Begin
    X[0] := 2; Y[0] := 6;
    X[1] := 3; Y[0] := 5;
    X[2] := 9; Y[0] := 11;
    X[3] := 1; Y[0] := 7;
    X[4] := 8; Y[0] := 6;
    X[5] := 7; Y[0] := 4;
    X[6] := 5; Y[0] := 4;
    r := Math.SumX2PY2(X, Y);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the sum of square sums equal to 249.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: double;
    Math: MathClass = New MathClass();
    X: Array[7Of Double;
    Y: Array[7Of Double;
Begin
    X[0] := 2; Y[0] := 6;
    X[1] := 3; Y[0] := 5;
    X[2] := 9; Y[0] := 11;
    X[3] := 1; Y[0] := 7;
    X[4] := 8; Y[0] := 6;
    X[5] := 7; Y[0] := 4;
    X[6] := 5; Y[0] := 4;
    r := Math.SumX2PY2(X, Y);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath