comparison scripts/sparse/svds.m @ 10549:95c3e38098bf

Untabify .m scripts
author Rik <code@nomad.inbox5.com>
date Fri, 23 Apr 2010 11:28:50 -0700
parents 923c7cb7f13f
children 4cdc43c095c5
comparison
equal deleted inserted replaced
10548:479536c5bb10 10549:95c3e38098bf
140 ## are only interested in the positive eigenvalues, we have to 140 ## are only interested in the positive eigenvalues, we have to
141 ## double k. If sigma is smaller than the smallest singular value 141 ## double k. If sigma is smaller than the smallest singular value
142 ## this can also be an issue. However, we'd like to avoid double 142 ## this can also be an issue. However, we'd like to avoid double
143 ## k for all scalar value of sigma... 143 ## k for all scalar value of sigma...
144 [V, s, flag] = eigs ([sparse(m,m), b; b', sparse(n,n)], 144 [V, s, flag] = eigs ([sparse(m,m), b; b', sparse(n,n)],
145 2 * k, b_sigma, b_opts); 145 2 * k, b_sigma, b_opts);
146 else 146 else
147 [V, s, flag] = eigs ([sparse(m,m), b; b', sparse(n,n)], 147 [V, s, flag] = eigs ([sparse(m,m), b; b', sparse(n,n)],
148 k, b_sigma, b_opts); 148 k, b_sigma, b_opts);
149 endif 149 endif
150 s = diag (s); 150 s = diag (s);
151 151
152 if (ischar (sigma)) 152 if (ischar (sigma))
153 norma = max (s); 153 norma = max (s);
182 v = v(:,ind); 182 v = v(:,ind);
183 183
184 if (length (s) < k) 184 if (length (s) < k)
185 warning ("returning fewer singular values than requested"); 185 warning ("returning fewer singular values than requested");
186 if (!ischar (sigma)) 186 if (!ischar (sigma))
187 warning ("try increasing the value of sigma"); 187 warning ("try increasing the value of sigma");
188 endif 188 endif
189 endif 189 endif
190 190
191 s = s * max_a; 191 s = s * max_a;
192 endif 192 endif