CRAMER _ _ _ _ _ _ _ _ _ _ _ _ switch
When the cramer switch is on, matrix inversion and linear equation solving (operator solve) is done by Cramer's rule, through exterior multiplication. Default is off.
on time; Time: 80 ms off output; Time: 100 ms mm := mat((a,b,c,d,f),(a,a,c,f,b),(b,c,a,c,d), (c,c,a,b,f), (d,a,d,e,f)); Time: 300 ms inverse := 1/mm; Time: 18460 ms on cramer; Time: 80 ms cramersinv := 1/mm; Time: 9260 ms
Your time readings will vary depending on the REDUCE version you u se. After you invert the matrix, turn on output and ask for one of the elements of the inverse matrix, such as cramersinv(3,2), so that you can see the size of the expressions produced.
Inversion of matrices and the solution of linear equations with dense symbolic entries in many variables is generally considerably faster with cramer on. However, inversion of numeric-valued matrices is slower. Consider the matrices you're inverting before deciding whether to turn cramer on or off. A substantial portion of the time in matrix inversion is given to formatting the results for printing. To save this time, turn output off, as shown in this example or terminate the expression with a dollar sign instead of a semicolon. The results are still available to you in the workspace associated with your prompt number, or you can assign them to an identifier for further use.