IMath.MInverse

Syntax

MInverse(Data: Array): Array;

Parameters

Data. Array of real numbers.

Description

The MInverse method returns a reverse matrix for the specified array.

Comments

The matrix must be square.

If an input array contains gaps, the function returns error.

Example

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[33];
    matr[
00] := 1; matr[01] := 9; matr[02] := 9;
    matr[
10] := 2; matr[11] := 15; matr[12] := 0;
    matr[
20] := 8; matr[21] := 1; matr[22] := 13;
    MInv := Math.MInverse(matr);
    
If math.Status = 0 Then
        
For i := 0 To MInv.GetUpperBound(1Do
            
For j := 0 To MInv.GetUpperBound(2Do
                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.

See also:

IMath