# HG changeset patch # User jwe # Date 1109021008 0 # Node ID 9cb38bfb04eacfb6aa51d5a04b86c9484efb8d2e # Parent ee2af1e830b28e1ccb69bf341032cae95666ffbc [project @ 2005-02-21 21:23:28 by jwe] diff -r ee2af1e830b2 -r 9cb38bfb04ea scripts/ChangeLog --- a/scripts/ChangeLog Mon Feb 21 21:01:42 2005 +0000 +++ b/scripts/ChangeLog Mon Feb 21 21:23:28 2005 +0000 @@ -1,3 +1,10 @@ +2005-02-21 David Bateman + + * statistics/distributions/poisson_rnd.m: fix for lambda of zero. + From Mark van Rossum . + Fix for row vectors with at least one element of lambda not in + (0, Inf). + 2005-02-21 John W. Eaton * statistics/base/qqplot.m: Use feval instead of eval. diff -r ee2af1e830b2 -r 9cb38bfb04ea scripts/statistics/distributions/poisson_rnd.m --- a/scripts/statistics/distributions/poisson_rnd.m Mon Feb 21 21:01:42 2005 +0000 +++ b/scripts/statistics/distributions/poisson_rnd.m Mon Feb 21 21:23:28 2005 +0000 @@ -66,7 +66,7 @@ if (isscalar (l)) - if (!(l > 0) | !(l < Inf)) + if (!(l >= 0) | !(l < Inf)) rnd = NaN * ones (sz); elseif ((l > 0) & (l < Inf)) num = zeros (sz); @@ -87,7 +87,7 @@ else rnd = zeros (sz); - k = find (!(l > 0) | !(l < Inf)); + k = find (!(l >= 0) | !(l < Inf)); if (any (k)) rnd(k) = NaN; endif @@ -101,7 +101,7 @@ ind = find (sum < 1); if (any (ind)) sum(ind) = (sum(ind) - - log (1 - rand (length (ind), 1)) ./ l(ind)); + - log (1 - rand (size (ind))) ./ l(ind)); num(ind) = num(ind) + 1; else break; diff -r ee2af1e830b2 -r 9cb38bfb04ea src/ChangeLog --- a/src/ChangeLog Mon Feb 21 21:01:42 2005 +0000 +++ b/src/ChangeLog Mon Feb 21 21:23:28 2005 +0000 @@ -1,5 +1,10 @@ 2005-02-21 John W. Eaton + * ov-builtin.cc (octave_builtin::subsref): If nargout is 0 and we + have additional indexing to perform, set it to 1 before calling + do_multi_index_op. + * ov-usr-fcn.cc (octave_user_function::subsref): Likewise. + * DLD-FUNCTIONS/gplot.l (send_to_plot_stream): Replot with no previous plot is a no-op. (makeplot): Likewise. diff -r ee2af1e830b2 -r 9cb38bfb04ea src/ov-builtin.cc --- a/src/ov-builtin.cc Mon Feb 21 21:01:42 2005 +0000 +++ b/src/ov-builtin.cc Mon Feb 21 21:23:28 2005 +0000 @@ -61,7 +61,11 @@ switch (type[0]) { case '(': - retval = do_multi_index_op (nargout, idx.front ()); + { + int tmp_nargout = (type.length () > 0 && nargout == 0) ? 1 : nargout; + + retval = do_multi_index_op (tmp_nargout, idx.front ()); + } break; case '{': diff -r ee2af1e830b2 -r 9cb38bfb04ea src/ov-usr-fcn.cc --- a/src/ov-usr-fcn.cc Mon Feb 21 21:01:42 2005 +0000 +++ b/src/ov-usr-fcn.cc Mon Feb 21 21:23:28 2005 +0000 @@ -294,7 +294,11 @@ switch (type[0]) { case '(': - retval = do_multi_index_op (nargout, idx.front ()); + { + int tmp_nargout = (type.length () > 0 && nargout == 0) ? 1 : nargout; + + retval = do_multi_index_op (tmp_nargout, idx.front ()); + } break; case '{':