Mercurial > octave-nkf
comparison libcruft/qrupdate/cch1up.f @ 7789:82be108cc558
First attempt at single precision tyeps
* * *
corrections to qrupdate single precision routines
* * *
prefer demotion to single over promotion to double
* * *
Add single precision support to log2 function
* * *
Trivial PROJECT file update
* * *
Cache optimized hermitian/transpose methods
* * *
Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sun, 27 Apr 2008 22:34:17 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
7788:45f5faba05a2 | 7789:82be108cc558 |
---|---|
1 c Copyright (C) 2008 VZLU Prague, a.s., Czech Republic | |
2 c | |
3 c Author: Jaroslav Hajek <highegg@gmail.com> | |
4 c | |
5 c This source is free software; you can redistribute it and/or modify | |
6 c it under the terms of the GNU General Public License as published by | |
7 c the Free Software Foundation; either version 2 of the License, or | |
8 c (at your option) any later version. | |
9 c | |
10 c This program is distributed in the hope that it will be useful, | |
11 c but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 c GNU General Public License for more details. | |
14 c | |
15 c You should have received a copy of the GNU General Public License | |
16 c along with this software; see the file COPYING. If not, see | |
17 c <http://www.gnu.org/licenses/>. | |
18 c | |
19 subroutine cch1up(n,R,u,w) | |
20 c purpose: given an upper triangular matrix R that is a Cholesky | |
21 c factor of a hermitian positive definite matrix A, i.e. | |
22 c A = R'*R, this subroutine updates R -> R1 so that | |
23 c R1'*R1 = A + u*u' or A - u*u' | |
24 c (complex version) | |
25 c arguments: | |
26 c n (in) the order of matrix R | |
27 c R (io) on entry, the upper triangular matrix R | |
28 c on exit, the updated matrix R1 | |
29 c u (io) the vector determining the rank-1 update | |
30 c on exit, u is destroyed. | |
31 c w (w) a real workspace vector of size n | |
32 c | |
33 c NOTE: the workspace vector is used to store the rotations | |
34 c so that R does not need to be traversed by rows. | |
35 c | |
36 integer n | |
37 complex R(n,n),u(n) | |
38 real w(n) | |
39 external clartg | |
40 complex rr,ui,t | |
41 integer i,j | |
42 | |
43 do i = 1,n | |
44 c apply stored rotations, column-wise | |
45 ui = conjg(u(i)) | |
46 do j = 1,i-1 | |
47 t = w(j)*R(j,i) + u(j)*ui | |
48 ui = w(j)*ui - conjg(u(j))*R(j,i) | |
49 R(j,i) = t | |
50 end do | |
51 c generate next rotation | |
52 call clartg(R(i,i),ui,w(i),u(i),rr) | |
53 R(i,i) = rr | |
54 end do | |
55 end | |
56 |