Mercurial > octave-nkf
comparison src/DLD-FUNCTIONS/chol.cc @ 7924:4976f66d469b
miscellaneous cleanup
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 11 Jul 2008 17:59:28 -0400 |
parents | 87865ed7405f |
children | 366821c0c01c |
comparison
equal
deleted
inserted
replaced
7923:c3d21b9b94b6 | 7924:4976f66d469b |
---|---|
179 if (! error_state) | 179 if (! error_state) |
180 { | 180 { |
181 octave_idx_type info; | 181 octave_idx_type info; |
182 SparseCHOL fact (m, info, natural); | 182 SparseCHOL fact (m, info, natural); |
183 if (nargout == 3) | 183 if (nargout == 3) |
184 if (vecout) | 184 { |
185 retval(2) = fact.perm (); | 185 if (vecout) |
186 else | 186 retval(2) = fact.perm (); |
187 retval(2) = fact.Q(); | 187 else |
188 retval(2) = fact.Q(); | |
189 } | |
188 | 190 |
189 if (nargout > 1 || info == 0) | 191 if (nargout > 1 || info == 0) |
190 { | 192 { |
191 retval(1) = fact.P(); | 193 retval(1) = fact.P(); |
192 if (LLt) | 194 if (LLt) |
206 { | 208 { |
207 octave_idx_type info; | 209 octave_idx_type info; |
208 SparseComplexCHOL fact (m, info, natural); | 210 SparseComplexCHOL fact (m, info, natural); |
209 | 211 |
210 if (nargout == 3) | 212 if (nargout == 3) |
211 if (vecout) | 213 { |
212 retval(2) = fact.perm (); | 214 if (vecout) |
213 else | 215 retval(2) = fact.perm (); |
214 retval(2) = fact.Q(); | 216 else |
217 retval(2) = fact.Q(); | |
218 } | |
215 | 219 |
216 if (nargout > 1 || info == 0) | 220 if (nargout > 1 || info == 0) |
217 { | 221 { |
218 retval(1) = fact.P(); | 222 retval(1) = fact.P(); |
219 if (LLt) | 223 if (LLt) |
982 %! assert(norm(triu(R1)-R1,Inf) == 0) | 986 %! assert(norm(triu(R1)-R1,Inf) == 0) |
983 %! assert(norm(A1(p,p) - single(Ac),Inf) < 1e1*eps('single')) | 987 %! assert(norm(A1(p,p) - single(Ac),Inf) < 1e1*eps('single')) |
984 %! | 988 %! |
985 */ | 989 */ |
986 | 990 |
987 DEFUN_DLD (choldelete, args, nargout, | 991 DEFUN_DLD (choldelete, args, , |
988 "-*- texinfo -*-\n\ | 992 "-*- texinfo -*-\n\ |
989 @deftypefn {Loadable Function} {@var{R1} =} choldelete (@var{R}, @var{j})\n\ | 993 @deftypefn {Loadable Function} {@var{R1} =} choldelete (@var{R}, @var{j})\n\ |
990 Given a Cholesky@tie{}factorization of a real symmetric or complex hermitian\n\ | 994 Given a Cholesky@tie{}factorization of a real symmetric or complex hermitian\n\ |
991 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper triangular,\n\ | 995 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper triangular,\n\ |
992 return the QR@tie{}factorization of @w{A(p,p)}, where @w{p = [1:j-1,j+1:n+1]}.\n\ | 996 return the QR@tie{}factorization of @w{A(p,p)}, where @w{p = [1:j-1,j+1:n+1]}.\n\ |
1114 %! | 1118 %! |
1115 %! assert(norm(triu(R1)-R1,Inf) == 0) | 1119 %! assert(norm(triu(R1)-R1,Inf) == 0) |
1116 %! assert(norm(R1'*R1 - single(Ac(p,p)),Inf) < 1e1*eps('single')) | 1120 %! assert(norm(R1'*R1 - single(Ac(p,p)),Inf) < 1e1*eps('single')) |
1117 */ | 1121 */ |
1118 | 1122 |
1119 DEFUN_DLD (cholshift, args, nargout, | 1123 DEFUN_DLD (cholshift, args, , |
1120 "-*- texinfo -*-\n\ | 1124 "-*- texinfo -*-\n\ |
1121 @deftypefn {Loadable Function} {@var{R1} =} cholshift (@var{R}, @var{i}, @var{j})\n\ | 1125 @deftypefn {Loadable Function} {@var{R1} =} cholshift (@var{R}, @var{i}, @var{j})\n\ |
1122 Given a Cholesky@tie{}factorization of a real symmetric or complex hermitian\n\ | 1126 Given a Cholesky@tie{}factorization of a real symmetric or complex hermitian\n\ |
1123 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper triangular,\n\ | 1127 positive definite matrix @w{@var{A} = @var{R}'*@var{R}}, @var{R}@tie{}upper triangular,\n\ |
1124 return the QR@tie{}factorization of\n\ | 1128 return the QR@tie{}factorization of\n\ |