IMatrixModel.CreateFixInfo

Syntax

CreateFixInfo: IMatrixModelFixInfo;

Description

The CreateFixInfo method creates an object that is necessary for fixing matrix dimensions.

Example

Add a link to the MathFin system assembly.

Sub UserProc;
Var
    M: Matrix[3];
    M1, M2: Matrix[2];
    Mm: IMatrixModel;
    x, y, z: Integer;
    Fix: IMatrixModelFixInfo;
Begin
    Debug.WriteLine("Source matrix");
    For x := 0 To 2 Do
        For y := 0 To 2 Do
            For z := 0 To 2 Do
                M[x, y, z] := Math.RandBetweenI(09);
                Debug.Write(M[x, y, z] + " ");
            End For;
            Debug.WriteLine("");
        End For;
        Debug.WriteLine("");
    End For;
    Mm := M As IMatrixModel;
    Fix := Mm.CreateFixInfo;
    Fix.Item(0) := 0;
    M1 := Mm.Dereference(Fix);
    Fix.Clear;
    Fix.Item(0) := 1;
    M2 := Mm.Dereference(Fix);
    Debug.WriteLine("----------------");
    For y := 0 To 2 Do
        For z := 0 To 2 Do
            Debug.Write(M1[y, z] + " ");
        End For;
        Debug.WriteLine("");
    End For;
    Debug.WriteLine("");
    For y := 0 To 2 Do
        For z := 0 To 2 Do
            Debug.Write(M2[y, z] + " ");
        End For;
        Debug.WriteLine("");
    End For;
End Sub UserProc;

After executing the example, a matrix of random numbers with size 3x3x3 is generated. Two more matrices will be obtained on the basis of this matrix by fixing the source one by the X dimension. The M1 matrix is obtained by fixing the source matrix by the first element of the X dimension, M2 is by fixing by the second element of the X dimension. All the dimensions of the source matrix and M1 and M2 matrices are displayed in the console.

See also:

IMatrixModel