QR decomposition: Difference between revisions

Content added Content deleted
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
(QR decomposition with Numeric.LinearAlgebra)
Line 1,871: Line 1,871:
x:
x:
[1.0000000000000004,-0.9999999999999999,1.0]
[1.0000000000000004,-0.9999999999999999,1.0]
</pre>

===QR decomposition with Numeric.LinearAlgebra===
<lang haskell>import Numeric.LinearAlgebra

a :: Matrix R
a = (3><3)
[ 12, -51, 4
, 6, 167, -68
, -4, 24, -41]

main = do
print $ qr a
</lang>
{{out}}
<pre>((3><3)
[ -0.8571428571428572, 0.3942857142857143, 0.33142857142857146
, -0.4285714285714286, -0.9028571428571428, -3.428571428571427e-2
, 0.28571428571428575, -0.17142857142857137, 0.9428571428571428 ],(3><3)
[ -14.0, -21.0, 14.000000000000002
, 0.0, -175.00000000000003, 70.00000000000001
, 0.0,
</pre>
</pre>