1 (checkcholesky(m,r) := (
3 l : m - l . ctranspose(l),
4 if blockmatrixp(l) then l : mat_fullunblocker(l),
5 every(lambda([x], is(cabs(x) < 1.0e-10)),l)),0);
15 (for r in [floatfield, complexfield, generalring, rationalfield, crering, noncommutingring] do (
16 ok : ok and checkcholesky(m,r)),ok);
28 (for r in [floatfield, complexfield, generalring, rationalfield, crering, noncommutingring] do (
29 ok : ok and checkcholesky(m,r)),ok);
34 (m : matrix([1,0],[7,-8]),0);
37 (m : m . ctranspose(m),0);
43 (for r in [floatfield, complexfield, generalring, crering, noncommutingring] do (
44 ok : ok and checkcholesky(m,r)),ok);
48 (m : matrix([1,0],[7,-%i]),0);
51 (m : m . ctranspose(m),0);
57 (for r in [complexfield, generalring] do (
58 ok : ok and checkcholesky(m,r)),ok);
63 (m : matrix([1,0],[%i,5]),0);
66 (m : m . ctranspose(m),0);
72 (for r in [complexfield, generalring, noncommutingring] do (
73 ok : ok and checkcholesky(m,r)),ok);
78 (m : matrix([7-%i,0],[1-%i,5 + %i]),0);
81 (m : expand(m . ctranspose(m)),0);
87 (for r in [complexfield, noncommutingring] do (
88 ok : ok and checkcholesky(m,r)),ok);
93 (m : matrix([matrix([1,0],[%i,10]), matrix([0,0],[0,0])], [matrix([1,2],[5,%i]),matrix([1,0],[2,8])]),0);
96 (matrix_element_transpose : 'transpose, matrix_element_mult : ".", 0);
99 (m : m . ctranspose(m),0);
102 checkcholesky(m, noncommutingring);
105 (matrix_element_transpose : false, matrix_element_mult : "*", 0);
109 (ma[i,j] := kron_delta(i,j) + kron_delta(i,j+1)/2 + kron_delta(i,j-1)/2,0);
112 (m : genmatrix(ma,71,71),0);
115 checkcholesky(m,floatfield);
118 (m : matrix([matrix([matrix([8,4],[4,13]),matrix([2,4],[7,9])],[matrix([2,7],[4,9]),matrix([10,6],[6,15])]),matrix([matrix([4,4],[12,5]),matrix([0,6],[6,8])],[matrix([8,3],[13,3]),matrix([6,5],[5,6])])],[matrix([matrix([4,12],[4,5]),matrix([8,13],[3,3])],[matrix([0,6],[6,8]),matrix([6,5],[5,6])]),matrix([matrix([18,5],[5,4]),matrix([5,9],[2,6])],[matrix([5,2],[9,6]),matrix([6,3],[3,11])])]),0);
121 (matrix_element_transpose : 'transpose,0);
124 (matrix_element_mult : ".",0);
127 (m1 : cholesky(m.transpose(m), 'noncommutingring),0);
130 zeromatrixp(factor(m1.transpose(m1) - m.transpose(m)));
135 (remfunction(checkcholesky),0);
138 (matrix_element_transpose : false,0);
141 (matrix_element_mult : "*",0);
144 (remvalue(m,m1,ok),0);