RosettaCodeData/Task/QR-decomposition/Maxima/qr-decomposition-1.maxima
2020-02-17 23:21:07 -08:00

12 lines
343 B
Text

load(lapack)$ /* This may hang up in wxMaxima, if this happens, use xMaxima or plain Maxima in a terminal */
a: matrix([12, -51, 4],
[ 6, 167, -68],
[-4, 24, -41])$
[q, r]: dgeqrf(a)$
mat_norm(q . r - a, 1);
4.2632564145606011E-14
/* Note: the lapack package is a lisp translation of the fortran lapack library */