Mercurial > hg > octave-lyh
comparison scripts/linear-algebra/krylov.m @ 4609:ac4e4807acc5
[project @ 2003-11-14 16:14:31 by jwe]
author | jwe |
---|---|
date | Fri, 14 Nov 2003 16:15:41 +0000 |
parents | 22bd65326ec1 |
children | 4c8a2e4e0717 |
comparison
equal
deleted
inserted
replaced
4608:22ca4cc02525 | 4609:ac4e4807acc5 |
---|---|
41 ## Applications | 41 ## Applications |
42 ## @end deftypefn | 42 ## @end deftypefn |
43 | 43 |
44 ## Author: A. Scottedward Hodel <a.s.hodel@eng.auburn.edu> | 44 ## Author: A. Scottedward Hodel <a.s.hodel@eng.auburn.edu> |
45 | 45 |
46 function [Uret,H,nu] = krylov(A,V,k,eps1,pflg); | 46 function [Uret, H, nu] = krylov (A, V, k, eps1, pflg); |
47 | 47 |
48 defeps = 1e-12; | 48 defeps = 1e-12; |
49 | 49 |
50 if (nargin < 3 || nargin > 5) | 50 if (nargin < 3 || nargin > 5) |
51 usage ("[U, nu] = krylov (A, V, k, eps1, pflg)") | 51 usage ("[U, nu] = krylov (A, V, k, eps1, pflg)") |
79 Vnrm = norm (V, Inf); | 79 Vnrm = norm (V, Inf); |
80 | 80 |
81 ## check for trivial solution | 81 ## check for trivial solution |
82 if (Vnrm == 0) | 82 if (Vnrm == 0) |
83 Uret = []; | 83 Uret = []; |
84 H = []; | |
84 nu = 0; | 85 nu = 0; |
85 return; | 86 return; |
86 endif | 87 endif |
87 | 88 |
88 # identify trivial null space | 89 # identify trivial null space |