IMatrixModelFixInfo.Item

Syntax

Item(DimIndex: Integer): Integer;

Parameters

DimIndex. Number of the dimension that should be fixed.

Description

The Item property determines index of the element, by which the dimension with DimIndex number must be fixed.

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 3x3x3 matrix of random numbers 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:

IMatrixModelFixInfo