IMatrixModelFixInfo.Item

Syntax

Item(DimIndex: Integer): Integer;

Parameters

DimIndex - number of the dimension, by which fixing must be set.

Description

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

Example

Sub Main;

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(0, 9);

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 Main;

After executing the example a 3x3x3 matrix of random numbers will be 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 will be displayed.

See also:

IMatrixModelFixInfo