14.3 Matrix Expressions

These follow the normal rules of matrix algebra as defined by the following syntax:

matrix expression
MATmatrix descriptionmatrix variable
scalar expression*matrix expression
matrix expression*matrix expression
matrix expression+matrix expression
matrix expression^integer
matrix expression/matrix expression

Sums and products of matrix expressions must be of compatible size; otherwise an error will result during their evaluation. Similarly, only square matrices may be raised to a power. A negative power is computed as the inverse of the matrix raised to the corresponding positive power. a/b is interpreted as a*b^(-1).


Assuming X and Y have been declared as matrices, the following are matrix expressions

        y + mat((1,a),(b,c))/2

The computation of the quotient of two matrices normally uses a two-step elimination method due to Bareiss. An alternative method using Cramer’s method is also available. This is usually less efficient than the Bareiss method unless the matrices are large and dense, although we have no solid statistics on this as yet. To use Cramer’s method instead, the switch CRAMER should be turned on.