| 1 |
function R = chol2(A) |
| 2 |
% R = chol2(A) |
| 3 |
% |
| 4 |
% Returns an upper triangular R such that % R * R' is a factorization of |
| 5 |
% a symmetric, positive definite A |
| 6 |
% |
| 7 |
% Written by Tao Zha, July 1996 |
| 8 |
% |
| 9 |
% Copyright (C) 1996-2012 Tao Zha |
| 10 |
% |
| 11 |
% This free software: you can redistribute it and/or modify |
| 12 |
% it under the terms of the GNU General Public License as published by |
| 13 |
% the Free Software Foundation, either version 3 of the License, or |
| 14 |
% (at your option) any later version. |
| 15 |
% |
| 16 |
% It is distributed in the hope that it will be useful, |
| 17 |
% but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 |
% GNU General Public License for more details. |
| 20 |
% |
| 21 |
% If you did not received a copy of the GNU General Public License |
| 22 |
% with this software, see <http://www.gnu.org/licenses/>. |
| 23 |
% |
| 24 |
|
| 25 |
%* The following two lines give another expression of the same result |
| 26 |
%%function [R,p] = chol2(A) |
| 27 |
%%[R,p] = chol(fliplr(flipud(A))); |
| 28 |
|
| 29 |
R = chol(fliplr(flipud(A))); |
| 30 |
R = fliplr(flipud(R))'; |