Mercurial > hg > octave-lyh
comparison scripts/linear-algebra/krylov.m @ 5775:ace8d8d26933
[project @ 2006-04-24 19:13:06 by jwe]
author | jwe |
---|---|
date | Mon, 24 Apr 2006 19:13:11 +0000 |
parents | dbdba35033a6 |
children | b3478d7a0486 |
comparison
equal
deleted
inserted
replaced
5774:e7af222e98b0 | 5775:ace8d8d26933 |
---|---|
120 if (norm (short_q) < eps1) | 120 if (norm (short_q) < eps1) |
121 ## insignificant column; delete | 121 ## insignificant column; delete |
122 nv = columns (V); | 122 nv = columns (V); |
123 if (jj != nv) | 123 if (jj != nv) |
124 [V(:,jj), V(:,nv)] = swap (V(:,jj), V(:,nv)); | 124 [V(:,jj), V(:,nv)] = swap (V(:,jj), V(:,nv)); |
125 ## XXX FIXME XXX -- H columns should be swapped too. Not done | 125 ## FIXME -- H columns should be swapped too. Not done |
126 ## since Block Hessenberg structure is lost anyway. | 126 ## since Block Hessenberg structure is lost anyway. |
127 endif | 127 endif |
128 V = V(:,1:(nv-1)); | 128 V = V(:,1:(nv-1)); |
129 ## one less reflection | 129 ## one less reflection |
130 nu--; | 130 nu--; |
154 U(idx,nu) = hv; | 154 U(idx,nu) = hv; |
155 | 155 |
156 # reduce V per the reflection | 156 # reduce V per the reflection |
157 V(idx,:) = V(idx,:) - av*hv*(hv' * V(idx,:)); | 157 V(idx,:) = V(idx,:) - av*hv*(hv' * V(idx,:)); |
158 if(iter > 1) | 158 if(iter > 1) |
159 ## XXX FIXME XXX -- not done correctly for block case | 159 ## FIXME -- not done correctly for block case |
160 H(nu,nu-1) = V(pivot_vec(nu),jj); | 160 H(nu,nu-1) = V(pivot_vec(nu),jj); |
161 endif | 161 endif |
162 | 162 |
163 ## advance to next column of V | 163 ## advance to next column of V |
164 jj++; | 164 jj++; |