Mercurial > hg > octave-avbm
changeset 8702:3c4628550318
eigs.cc: increase tolerance
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 09 Feb 2009 12:29:30 -0500 |
parents | 1652e39b934e |
children | c953a6977be6 |
files | src/ChangeLog src/DLD-FUNCTIONS/eigs.cc |
diffstat | 2 files changed, 158 insertions(+), 156 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2009-02-09 John W. Eaton <jwe@octave.org> + * DLD-FUNCTIONS/eigs.cc: Increase tolerance to 1e-11 on all tests. + * lex.l (lexical_feedback::looking_at_decl_list): New data member. * lex.l (lexical_feedback::init): Initialize it. (handle_identifier): Also force local variable if looking_at_decl_list.
--- a/src/DLD-FUNCTIONS/eigs.cc +++ b/src/DLD-FUNCTIONS/eigs.cc @@ -763,104 +763,104 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (d1, d0(end:-1:(end-k)),1e-12); +%! assert (d1, d0(end:-1:(end-k)),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (d1, d0(k:-1:1), 1e-12); +%! assert (d1, d0(k:-1:1), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'la'); -%! assert (d1, d2(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d2(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sa'); -%! assert (d1, d2(1:k), 1e-12); +%! assert (d1, d2(1:k), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'be'); -%! assert (d1, d2([1:floor(k/2), (end - ceil(k/2) + 1):end]), 1e-12); +%! assert (d1, d2([1:floor(k/2), (end - ceil(k/2) + 1):end]), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k+1, 'be'); -%! assert (d1, d2([1:floor((k+1)/2), (end - ceil((k+1)/2) + 1):end]), 1e-12); +%! assert (d1, d2([1:floor((k+1)/2), (end - ceil((k+1)/2) + 1):end]), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (d1(idx1), d0(idx0(1:k)), 1e-12); +%! assert (d1(idx1), d0(idx0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, speye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK -%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); +%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK -%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); +%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (d1, d0(k:-1:1), 1e-12); +%! assert (d1, d0(k:-1:1), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (d1, eigs(A,k,4.1), 1e-12); +%! assert (d1, eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'la'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sa'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'be'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor */ @@ -877,119 +877,119 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (abs(d1), abs(d0(1:k)), 1e-12); +%! assert (abs(d1), abs(d0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lr'); %! [dum, idx] = sort (real(d0)); %! d2 = d0(idx); -%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-12); +%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(1:k)), 1e-12); +%! assert (real(d1), real(d2(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'li'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'si'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-12); -%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-12); +%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-11); +%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, speye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK -%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-12); +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-12); +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (abs(d1), d0(1:k), 1e-12); +%! assert (abs(d1), d0(1:k), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'li'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'si'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor */ @@ -1006,121 +1006,121 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (abs(d1), abs(d0(1:k)), 1e-12); +%! assert (abs(d1), abs(d0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-12); +%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(1:k)), 1e-12); +%! assert (real(d1), real(d2(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'li'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'si'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-12); -%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-12); +%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-11); +%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, speye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 4.1, opts); -%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-12); -%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-12); +%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-11); +%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, speye(n)(q,q), k, 4.1, opts); -%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-12); -%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-12); +%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-11); +%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-11); %!testif HAVE_ARPACK -%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-12); +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-12); +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (abs(d1), d0(1:k), 1e-12); +%! assert (abs(d1), d0(1:k), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'li'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'si'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*speye(n))*v1(:,i))),0.,1e-11) %! endfor */ @@ -1140,104 +1140,104 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (d1, d0(end:-1:(end-k)),1e-12); +%! assert (d1, d0(end:-1:(end-k)),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (d1, d0(k:-1:1), 1e-12); +%! assert (d1, d0(k:-1:1), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'la'); -%! assert (d1, d2(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d2(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sa'); -%! assert (d1, d2(1:k), 1e-12); +%! assert (d1, d2(1:k), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'be'); -%! assert (d1, d2([1:floor(k/2), (end - ceil(k/2) + 1):end]), 1e-12); +%! assert (d1, d2([1:floor(k/2), (end - ceil(k/2) + 1):end]), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k+1, 'be'); -%! assert (d1, d2([1:floor((k+1)/2), (end - ceil((k+1)/2) + 1):end]), 1e-12); +%! assert (d1, d2([1:floor((k+1)/2), (end - ceil((k+1)/2) + 1):end]), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (d1(idx1), d0(idx0(1:k)), 1e-12); +%! assert (d1(idx1), d0(idx0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, eye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK -%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); +%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK -%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); +%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (d1, d0(end:-1:(end-k+1)), 1e-12); +%! assert (d1, d0(end:-1:(end-k+1)), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (d1, d0(k:-1:1), 1e-12); +%! assert (d1, d0(k:-1:1), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 1; opts.isreal = 1; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (d1, eigs(A,k,4.1), 1e-12); +%! assert (d1, eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'la'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sa'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'be'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor */ @@ -1254,119 +1254,119 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (abs(d1), abs(d0(1:k)), 1e-12); +%! assert (abs(d1), abs(d0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lr'); %! [dum, idx] = sort (real(d0)); %! d2 = d0(idx); -%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-12); +%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(1:k)), 1e-12); +%! assert (real(d1), real(d2(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'li'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'si'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-12); -%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-12); +%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-11); +%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, eye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK -%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-12); +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-12); +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (abs(d1), d0(1:k), 1e-12); +%! assert (abs(d1), d0(1:k), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 0; opts.isreal = 1; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'li'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'si'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor */ @@ -1383,121 +1383,121 @@ %! d0 = d0(idx); %!testif HAVE_ARPACK %! d1 = eigs (A, k); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A,k+1); -%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k))),1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sm'); -%! assert (abs(d1), abs(d0(1:k)), 1e-12); +%! assert (abs(d1), abs(d0(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'lr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-12); +%! assert (real(d1), real(d2(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'sr'); %! [dum, idx] = sort (real(abs(d0))); %! d2 = d0(idx); -%! assert (real(d1), real(d2(1:k)), 1e-12); +%! assert (real(d1), real(d2(1:k)), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'li'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(end:-1:(end-k+1)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 'si'); %! [dum, idx] = sort (imag(abs(d0))); %! d2 = d0(idx); -%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-12); +%! assert (sort(imag(d1)), sort(imag(d2(1:k))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs (A, k, 4.1); %! [dum,idx0] = sort (abs(d0 - 4.1)); %! [dum,idx1] = sort (abs(d1 - 4.1)); -%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-12); -%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-12); +%! assert (abs(d1(idx1)), abs(d0(idx0(1:k))), 1e-11); +%! assert (sort(imag(d1(idx1))), sort(imag(d0(idx0(1:k)))), 1e-11); %!testif HAVE_ARPACK %! d1 = eigs(A, eye(n), k, 'lm'); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 4.1, opts); -%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-12); -%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-12); +%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-11); +%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-11); %!testif HAVE_ARPACK %! opts.cholB=true; %! q = [2:n,1]; %! opts.permB=q; %! d1 = eigs(A, eye(n)(q,q), k, 4.1, opts); -%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-12); -%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-12); +%! assert (abs(abs(d1)), abs(eigs(A,k,4.1)), 1e-11); +%! assert (sort(imag(abs(d1))), sort(imag(eigs(A,k,4.1))), 1e-11); %!testif HAVE_ARPACK -%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-12); +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-11); %!testif HAVE_ARPACK -%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-12); +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 'lm', opts); -%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); +%! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) A \ x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 'sm', opts); -%! assert (abs(d1), d0(1:k), 1e-12); +%! assert (abs(d1), d0(1:k), 1e-11); %!testif HAVE_ARPACK %! fn = @(x) (A - 4.1 * eye(n)) \ x; %! opts.issym = 0; opts.isreal = 0; %! d1 = eigs (fn, n, k, 4.1, opts); -%! assert (abs(d1), eigs(A,k,4.1), 1e-12); +%! assert (abs(d1), eigs(A,k,4.1), 1e-11); %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sm'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'lr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'sr'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'li'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor %!testif HAVE_ARPACK %! [v1,d1] = eigs(A, k, 'si'); %! d1 = diag(d1); %! for i=1:k -%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-12) +%! assert(max(abs((A - d1(i)*eye(n))*v1(:,i))),0.,1e-11) %! endfor */