LU decomposition: Difference between revisions

Content added Content deleted
(→‎{{header|zkl}}: added GSL solution)
m (→‎{{header|zkl}}: change formating)
Line 3,226: Line 3,226:
2.0, 5.0, 7.0, 1.0);
2.0, 5.0, 7.0, 1.0);
L,U:=luTask(A);
L,U:=luTask(A);
println("L:\n",L.format(),"\nU:\n",U.format());</lang>
println("L:\n",L.format(8,4),"\nU:\n",U.format(8,4));</lang>
{{out}}
{{out}}
<pre>
<pre>
Line 3,238: Line 3,238:
0.00, 0.00, -2.00
0.00, 0.00, -2.00
L:
L:
1.00, 0.00, 0.00, 0.00
1.0000, 0.0000, 0.0000, 0.0000
0.27, 1.00, 0.00, 0.00
0.2727, 1.0000, 0.0000, 0.0000
0.09, 0.29, 1.00, 0.00
0.0909, 0.2875, 1.0000, 0.0000
0.18, 0.23, 0.00, 1.00
0.1818, 0.2312, 0.0036, 1.0000
U:
U:
11.00, 9.00, 24.00, 2.00
11.0000, 9.0000, 24.0000, 2.0000
0.00, 14.55, 11.45, 0.45
0.0000, 14.5455, 11.4545, 0.4545
0.00, 0.00, -3.47, 5.69
0.0000, 0.0000, -3.4750, 5.6875
0.00, 0.00, 0.00, 0.51
0.0000, 0.0000, 0.0000, 0.5108
</pre>
</pre>
Or, using lists:
Or, using lists: