Cholesky decomposition: Difference between revisions

+scilab
(+scilab)
Line 2,920:
assert(math.round( result * 100000 ) * 0.00001 == math.round( test * 100000 ) * 0.00001)
}</lang>
 
=={{header|Scilab}}==
 
The Cholesky decomposition is builtin, and an upper triangular matrix is returned, such that <math>L^TL=A</math>.
 
<lang scilab>a = [25 15 -5; 15 18 0; -5 0 11];
chol(a)
ans =
 
5. 3. -1.
0. 3. 1.
0. 0. 3.
 
 
a = [18 22 54 42; 22 70 86 62;
54 86 174 134; 42 62 134 106];
 
chol(a)
ans =
 
4.2426407 5.1854497 12.727922 9.8994949
0. 6.5659052 3.0460385 1.6245539
0. 0. 1.6497422 1.849711
0. 0. 0. 1.3926212</lang>
 
=={{header|Seed7}}==
1,336

edits