Go to the previous, next chapter.

Integer Matrix Operations --- IntegerMatrix.h

This file defines all operations concerning integer matrices and introduces the new data type INTEGER_MATRIX.

Data Type: INTEGER_MATRIX Variable [(Rows,Columns)]
Declares Variable as integer matrix. The optional parameters Rows and Columns denote the initial dimensions of the matrix. If the initial dimensions are missing, no memory is allocated for the matrix elements (this will be done after the matrix is resized or after the first assignment to the matrix).

The basic operations +, -, *, and /, the unary operators + and - as well as +=, -=, *=, and /= are defined for integer matrices.

If i and j are INT expressions and M an integer matrix, v(i,j) denotes the element in the i-th row and j-th column of the matrix M.

Additionally, the following functions are provided:

Function: INT RowDimension (INTEGER_MATRIX M)
Returns the current row dimension of M.

Function: INT ColDimension (INTEGER_MATRIX M)
Returns the current column dimension of M.

Function: void Resize (INTEGER_MATRIX M, INT i, INT j)
Discards the old elements of M and resizes M to contain i rows and j columns.

Function: void MakeTemporary (INTEGER_MATRIX M)
Changes the temporary variable M into a permanent one.

See section Configuration, for details.

Function: void MakePermanent (INTEGER_MATRIX M)
Changes the temporary variable M into a permanent one.

See section Configuration, for details.

Function: void Clear (INTEGER_MATRIX M)
Initializes all elements of M with 0.

Function: void Initialize (INTEGER_MATRIX M, INT a)
Initializes all elements of M with a.