Mercurial > octave
diff liboctave/numeric/randpoisson.cc @ 27102:84ff9953faa1
where possible, eliminate octave:: namespace qualifier inside octave namespace
Affected files:
file-editor-tab.cc, file-editor.cc, main-window.cc, octave-cmd.h,
octave-qt-link.cc, settings-dialog.cc, call-stack.cc, environment.cc,
ft-text-renderer.cc, gl2ps-print.cc, help.cc, input.cc,
interpreter-private.cc, interpreter-private.h, interpreter.cc,
load-path.cc, oct-hist.cc, oct-process.cc, oct-stream.cc, pager.cc,
syminfo.cc, symtab.h, sysdep.cc, text-renderer.cc, utils.cc, gzip.cc,
cdef-manager.cc, ov-fcn-handle.cc, ov-java.cc, jit-typeinfo.cc,
oct-parse.yy, pt-eval.cc, pt-tm-const.cc, chol.cc, gsvd.cc,
oct-rand.cc, oct-rand.h, randmtzig.cc, randpoisson.cc, file-ops.cc,
lo-sysdep.cc, file-info.cc, oct-glob.cc, oct-sparse.cc, and
url-transfer.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 May 2019 13:57:30 +0000 |
parents | 00f796120a6d |
children | b442ec6dda5c |
line wrap: on
line diff
--- a/liboctave/numeric/randpoisson.cc Tue May 21 19:50:59 2019 +0000 +++ b/liboctave/numeric/randpoisson.cc Wed May 22 13:57:30 2019 +0000 @@ -178,7 +178,7 @@ { /* generate uniform number U -- U(0, p6) */ /* case distinction corresponding to U */ - if ((U = octave::rand_uniform<double> () * p6) < p2) + if ((U = rand_uniform<double> () * p6) < p2) { /* centre left */ /* immediate acceptance region @@ -190,7 +190,7 @@ /* computation of candidate X < k2, and its counterpart Y > k2 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = std::floor (dl * octave::rand_uniform<double> ()) + 1.0; + Dk = std::floor (dl * rand_uniform<double> ()) + 1.0; if (W <= f2 - Dk * (f2 - f2/r2)) { /* quick accept of */ return (k2 - Dk); /* X = k2 - Dk */ @@ -217,7 +217,7 @@ /* computation of candidate X > k4, and its counterpart Y < k4 */ /* either squeeze-acceptance of X or acceptance-rejection of Y */ - Dk = std::floor (dr * octave::rand_uniform<double> ()) + 1.0; + Dk = std::floor (dr * rand_uniform<double> ()) + 1.0; if (W <= f4 - Dk * (f4 - f4*r4)) { /* quick accept of */ return (k4 + Dk); /* X = k4 + Dk */ @@ -235,7 +235,7 @@ } else { - W = octave::rand_uniform<double> (); + W = rand_uniform<double> (); if (U < p5) { /* expon. tail left */ Dk = std::floor (1.0 - std::log (W)/ll); @@ -299,7 +299,7 @@ while (i-- > 0) { - double u = octave::rand_uniform<double> (); + double u = rand_uniform<double> (); /* If u > 0.458 we know we can jump to floor(lambda) before * comparing (this observation is based on Stadlober's winrand @@ -358,12 +358,12 @@ { do { - y = tan (M_PI*octave::rand_uniform<double> ()); + y = tan (M_PI*rand_uniform<double> ()); em = sq * y + lambda; } while (em < 0.0); em = std::floor (em); t = 0.9*(1.0+y*y)*exp (em*alxm-flogfak (em)-g); - } while (octave::rand_uniform<double> () > t); + } while (rand_uniform<double> () > t); p[i] = em; } }