QR decomposition: Difference between revisions

Content added Content deleted
(→‎Library QR, gonum/matrix: more library changes)
(→‎{{header|Tcl}}: added zkl)
Line 1,741: Line 1,741:
0.0 -175.0 70.0
0.0 -175.0 70.0
0.0 0.0 -35.0
0.0 0.0 -35.0
</pre>

=={{header|zkl}}==
<lang zkl>var [const] GSL=Import("zklGSL"); // libGSL (GNU Scientific Library)
A:=GSL.Matrix(3,3).set(12.0, -51.0, 4.0,
6.0, 167.0, -68.0,
4.0, 24.0, -41.0);
Q,R:=A.QRDecomp();
println("Q:\n",Q.format());
println("R:\n",R.format());
println("Q*R:\n",(Q*R).format());</lang>
{{out}}
<pre>
Q:
-0.86, 0.47, -0.22
-0.43, -0.88, -0.20
-0.29, -0.08, 0.95
R:
-14.00, -34.71, 37.43
0.00, -172.80, 65.07
0.00, 0.00, -26.19
Q*R:
12.00, -51.00, 4.00
6.00, 167.00, -68.00
4.00, 24.00, -41.00
</pre>
</pre>