Mercurial > octave-nkf
diff src/DLD-FUNCTIONS/svd.cc @ 14501:60e5cf354d80
Update %!tests in DLD-FUNCTIONS/ directory with Octave coding conventions.
* __contourc__.cc, __delaunayn__.cc, __dispatch__.cc, __dsearchn__.cc,
__fltk_uigetfile__.cc, __glpk__.cc, __lin_interpn__.cc, __magick_read__.cc,
__pchip_deriv__.cc, __qp__.cc, __voronoi__.cc, besselj.cc, betainc.cc,
bsxfun.cc, cellfun.cc, chol.cc, conv2.cc, convhulln.cc, dassl.cc, det.cc,
dlmread.cc, dmperm.cc, dot.cc, eig.cc, eigs.cc, fft.cc, fft2.cc, filter.cc,
find.cc, gammainc.cc, gcd.cc, givens.cc, hess.cc, hex2num.cc, inv.cc, kron.cc,
lookup.cc, lsode.cc, lu.cc, luinc.cc, matrix_type.cc, max.cc, mgorth.cc,
nproc.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc,
schur.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, sub2ind.cc, svd.cc,
syl.cc, time.cc, tril.cc, tsearch.cc: Update %!tests in DLD-FUNCTIONS/
directory with Octave coding conventions.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Tue, 27 Mar 2012 22:46:45 -0700 |
parents | 72c96de7a403 |
children |
line wrap: on
line diff
--- a/src/DLD-FUNCTIONS/svd.cc Mon Mar 26 17:37:56 2012 -0400 +++ b/src/DLD-FUNCTIONS/svd.cc Tue Mar 27 22:46:45 2012 -0700 @@ -325,8 +325,7 @@ } /* - -%!assert(svd ([1, 2; 2, 1]), [3; 1], sqrt (eps)); +%!assert (svd ([1, 2; 2, 1]), [3; 1], sqrt (eps)) %!test %! [u, s, v] = svd ([1, 2; 2, 1]); @@ -355,34 +354,34 @@ %! [u, s, v] = svd (a, 1); %! assert (u * s * v', a, sqrt (eps)); -%!assert(svd (single([1, 2; 2, 1])), single([3; 1]), sqrt (eps('single'))); +%!assert (svd (single ([1, 2; 2, 1])), single ([3; 1]), sqrt (eps ("single"))) %!test -%! [u, s, v] = svd (single([1, 2; 2, 1])); +%! [u, s, v] = svd (single ([1, 2; 2, 1])); %! x = single (1 / sqrt (2)); -%! assert (u, [-x, -x; -x, x], sqrt (eps('single'))); -%! assert (s, single([3, 0; 0, 1]), sqrt (eps('single'))); -%! assert (v, [-x, x; -x, -x], sqrt (eps('single'))); +%! assert (u, [-x, -x; -x, x], sqrt (eps ("single"))); +%! assert (s, single ([3, 0; 0, 1]), sqrt (eps ("single"))); +%! assert (v, [-x, x; -x, -x], sqrt (eps ("single"))); %!test -%! a = single([1, 2, 3; 4, 5, 6]); +%! a = single ([1, 2, 3; 4, 5, 6]); %! [u, s, v] = svd (a); -%! assert (u * s * v', a, sqrt (eps('single'))); +%! assert (u * s * v', a, sqrt (eps ("single"))); %!test -%! a = single([1, 2; 3, 4; 5, 6]); +%! a = single ([1, 2; 3, 4; 5, 6]); %! [u, s, v] = svd (a); -%! assert (u * s * v', a, sqrt (eps('single'))); +%! assert (u * s * v', a, sqrt (eps ("single"))); %!test -%! a = single([1, 2, 3; 4, 5, 6]); +%! a = single ([1, 2, 3; 4, 5, 6]); %! [u, s, v] = svd (a, 1); -%! assert (u * s * v', a, sqrt (eps('single'))); +%! assert (u * s * v', a, sqrt (eps ("single"))); %!test -%! a = single([1, 2; 3, 4; 5, 6]); +%! a = single ([1, 2; 3, 4; 5, 6]); %! [u, s, v] = svd (a, 1); -%! assert (u * s * v', a, sqrt (eps('single'))); +%! assert (u * s * v', a, sqrt (eps ("single"))); %!test %! a = zeros (0, 5); @@ -398,10 +397,9 @@ %! assert (size (s), [0, 0]); %! assert (size (v), [0, 0]); -%!error <Invalid call to svd> svd (); -%!error <Invalid call to svd> svd ([1, 2; 4, 5], 2, 3); -%!error <Invalid call to svd> [u, v] = svd ([1, 2; 3, 4]); - +%!error svd () +%!error svd ([1, 2; 4, 5], 2, 3) +%!error [u, v] = svd ([1, 2; 3, 4]) */ DEFUN_DLD (svd_driver, args, nargout,