Mercurial > hg > octave-terminal
changeset 8585:e6497be3f3d6
Skip tests if ARPACK is missing.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Sat, 24 Jan 2009 12:09:25 -0500 |
parents | 848f7d3e589c |
children | 31ab3b83bc8a |
files | scripts/ChangeLog scripts/sparse/svds.m src/ChangeLog src/DLD-FUNCTIONS/eigs.cc |
diffstat | 4 files changed, 35 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-01-24 Ben Abbott <bpabbott@mac.com> + + * sparse/svds.m: svds.m: skip tests if ARPACK is missing. + 2009-01-23 Søren Hauberg <hauberg@gmail.com> * help/type.m: Make 'type X' work, when X is the name of a variable.
--- a/scripts/sparse/svds.m +++ b/scripts/sparse/svds.m @@ -213,17 +213,17 @@ %! u = u(:,idx); %! v = v(:,idx); %! randn('state',42) -%!test +%!testif HAVE_ARPACK %! [u2,s2,v2,flag] = svds(a,k); %! s2 = diag(s2); %! assert(flag,!1); %! assert(s(end:-1:end-k+1), s2, 1e-10); -%!test +%!testif HAVE_ARPACK %! [u2,s2,v2,flag] = svds(a,k,0); %! s2 = diag(s2); %! assert(flag,!1); %! assert(s(k:-1:1), s2, 1e-10); -%!test +%!testif HAVE_ARPACK %! idx = floor(n/2); %! % Don't put sigma right on a singular value or there are convergence %! sigma = 0.99*s(idx) + 0.01*s(idx+1);
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2009-01-24 Ben Abbott <bpabbott@mac.com> + + * DLD-FUNCTIONS/eigs.cc: eigs.cc: skip tests if ARPACK is missing. + 2009-01-23 John W. Eaton <jwe@octave.org> * toplev.cc (octave_call_stack::do_goto_caller_frame):
--- a/src/DLD-FUNCTIONS/eigs.cc +++ b/src/DLD-FUNCTIONS/eigs.cc @@ -761,7 +761,8 @@ %!testif HAVE_ARPACK %! d1 = eigs(A, speye(n), k, 'lm'); %! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); -%!assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); +%!testif HAVE_ARPACK +%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, speye(n), k, 'lm', opts); @@ -782,7 +783,8 @@ %! 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 (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); +%!testif HAVE_ARPACK +%! assert (eigs(A,k,4.1), eigs(A,speye(n),k,4.1), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 1; opts.isreal = 1; @@ -902,8 +904,10 @@ %! 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(eigs(A,k,4.1)), abs(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-12); +%!testif HAVE_ARPACK +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-12); +%!testif HAVE_ARPACK +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; @@ -1031,8 +1035,10 @@ %! 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(eigs(A,k,4.1)), abs(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-12); +%!testif HAVE_ARPACK +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,speye(n),k,4.1)), 1e-12); +%!testif HAVE_ARPACK +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,speye(n),k,4.1))), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0; @@ -1132,7 +1138,8 @@ %!testif HAVE_ARPACK %! d1 = eigs(A, eye(n), k, 'lm'); %! assert (abs(d1), abs(d0(end:-1:(end-k+1))), 1e-12); -%!assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); +%!testif HAVE_ARPACK +%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); %!testif HAVE_ARPACK %! opts.cholB=true; %! d1 = eigs(A, eye(n), k, 'lm', opts); @@ -1153,7 +1160,8 @@ %! 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 (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); +%!testif HAVE_ARPACK +%! assert (eigs(A,k,4.1), eigs(A,eye(n),k,4.1), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 1; opts.isreal = 1; @@ -1273,8 +1281,10 @@ %! 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(eigs(A,k,4.1)), abs(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-12); +%!testif HAVE_ARPACK +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-12); +%!testif HAVE_ARPACK +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 1; @@ -1402,8 +1412,10 @@ %! 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(eigs(A,k,4.1)), abs(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-12); +%!testif HAVE_ARPACK +%! assert (abs(eigs(A,k,4.1)), abs(eigs(A,eye(n),k,4.1)), 1e-12); +%!testif HAVE_ARPACK +%! assert (sort(imag(eigs(A,k,4.1))), sort(imag(eigs(A,eye(n),k,4.1))), 1e-12); %!testif HAVE_ARPACK %! fn = @(x) A * x; %! opts.issym = 0; opts.isreal = 0;