RosettaCodeData/Task/Cholesky-decomposition/Maple/cholesky-decomposition.maple
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

52 lines
2.5 KiB
Text

> A := << 25, 15, -5; 15, 18, 0; -5, 0, 11 >>;
[25 15 -5]
[ ]
A := [15 18 0]
[ ]
[-5 0 11]
> B := << 18, 22, 54, 42; 22, 70, 86, 62; 54, 86, 174, 134; 42, 62, 134, 106>>;
[18 22 54 42]
[ ]
[22 70 86 62]
B := [ ]
[54 86 174 134]
[ ]
[42 62 134 106]
> use LinearAlgebra in
> LUDecomposition( A, method = Cholesky );
> LUDecomposition( B, method = Cholesky );
> evalf( % );
> end use;
[ 5 0 0]
[ ]
[ 3 3 0]
[ ]
[-1 1 3]
[ 1/2 ]
[3 2 0 0 0 ]
[ ]
[ 1/2 1/2 ]
[11 2 2 97 ]
[------- ------- 0 0 ]
[ 3 3 ]
[ ]
[ 1/2 1/2 ]
[ 1/2 30 97 2 6402 ]
[9 2 -------- --------- 0 ]
[ 97 97 ]
[ ]
[ 1/2 1/2 1/2]
[ 1/2 16 97 74 6402 8 33 ]
[7 2 -------- ---------- -------]
[ 97 3201 33 ]
[4.242640686 0. 0. 0. ]
[ ]
[5.185449728 6.565905202 0. 0. ]
[ ]
[12.72792206 3.046038495 1.649742248 0. ]
[ ]
[9.899494934 1.624553864 1.849711006 1.392621248]