Mercurial > hg > octave-lyh
diff src/data.cc @ 14520:c4ed0fdf2b62
Fix initialization in Higham's method for norm estimate (bug #36031).
* oct-norm.cc (higham): Initialize mu to 1.
author | Marco Caliari <marco.caliari@univr.it> |
---|---|
date | Tue, 03 Apr 2012 20:38:05 -0700 |
parents | 5bd9e47e9277 |
children | 3b19a952ab54 |
line wrap: on
line diff
--- a/src/data.cc +++ b/src/data.cc @@ -5233,6 +5233,12 @@ %! fhi = single (1e+300); %!assert (norm (flo*m2,"fro"), single (sqrt (30)*flo), -eps ("single")) %!assert (norm (fhi*m2,"fro"), single (sqrt (30)*fhi), -eps ("single")) + +%!test +%! ## Test for norm returning NaN on sparse matrix (bug #30631) +%! A = sparse (2,2); +%! A(2,1) = 1; +%! assert (norm (A), 1); */ static octave_value