REDUCE

14.3 Matrix Expressions

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

\(\langle \)matrix expression\(\rangle \) \(\longrightarrow \) mat\(\langle \)matrix description\(\rangle \)\(\ \mid \ \)\(\langle \)matrix variable\(\rangle \)\(\ \mid \ \)
\(\langle \)scalar expression\(\rangle \)*\(\langle \)matrix expression\(\rangle \)\(\ \mid \ \)
\(\langle \)matrix expression\(\rangle \)*\(\langle \)matrix expression\(\rangle \)\(\ \mid \ \)
\(\langle \)matrix expression\(\rangle \)+\(\langle \)matrix expression\(\rangle \)\(\ \mid \ \)
\(\langle \)matrix expression\(\rangle \)^\(\langle \)integer\(\rangle \)\(\ \mid \ \)
\(\langle \)matrix expression\(\rangle \)/\(\langle \)matrix expression\(\rangle \)

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).

Examples:

Assuming x and y have been declared as matrices, the following are matrix expressions

        y
        y^2*x-3*y^(-2)*x
        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.


Hosted by Download REDUCE Powered by MathJax