MInverse(Data: Array): Array;
MInverse(Data: System.Array): System.Array;
Data. Array of real numbers.
The MInverse method returns a reverse matrix for the specified array.
The matrix must be square.
If an input array contains gaps, the function returns error.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
MInv, matr: Array Of Double;
i, j: Integer;
Begin
matr := New Double[3, 3];
matr[0, 0] := 1; matr[0, 1] := 9; matr[0, 2] := 9;
matr[1, 0] := 2; matr[1, 1] := 15; matr[1, 2] := 0;
matr[2, 0] := 8; matr[2, 1] := 1; matr[2, 2] := 13;
MInv := Math.MInverse(matr);
If math.Status = 0 Then
For i := 0 To MInv.GetUpperBound(1) Do
For j := 0 To MInv.GetUpperBound(2) Do
Debug.Write(MInv[i, j].ToString + " ");
End For;
Debug.WriteLine("");
End For;
Else
Debug.WriteLine("Error " + Math.Status.ToString + ": " + Math.ErrorMsg);
End If;
End Sub UserProc;
After executing the example the console window displays the reverse matrix.
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
MInv, matr: System.Array;
i, j: Integer;
Math: MathClass = New MathClass();
Begin
matr := New Double[3, 3];
matr[0, 0] := 1; matr[0, 1] := 9; matr[0, 2] := 9;
matr[1, 0] := 2; matr[1, 1] := 15; matr[1, 2] := 0;
matr[2, 0] := 8; matr[2, 1] := 1; matr[2, 2] := 13;
MInv := Math.MInverse(matr);
If Math.Status = 0 Then
For i := 0 To MInv.GetUpperBound(0) Do
For j := 0 To MInv.GetUpperBound(1) Do
System.Diagnostics.Debug.Write(MInv[i, j].ToString() + " ");
End For;
System.Diagnostics.Debug.WriteLine("");
End For;
Else
System.Diagnostics.Debug.WriteLine("Error " + Math.Status.ToString() + ": " + Math.ErrorMsg);
End If;
End Sub;
See also: