Mercurial > octave
diff libinterp/corefcn/quadcc.cc @ 29961:7d6709900da7
eliminate octave:: namespace tags in DEFUN and DEFMETHOD and more
Files affected: __betainc__.cc, __contourc__.cc, __eigs__.cc,
__expint__.cc, __ftp__.cc, __gammainc__.cc, __ichol__.cc, __ilu__.cc,
__magick_read__.cc, __pchip_deriv__.cc, __qp__.cc, amd.cc, balance.cc,
besselj.cc, bsxfun.cc, call-stack.cc, ccolamd.cc, cellfun.cc, chol.cc,
colamd.cc, colloc.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc,
defaults.cc, dirfns.cc, display.cc, dlmread.cc, dmperm.cc, dot.cc,
eig.cc, ellipj.cc, environment.cc, error.cc, event-manager.cc, fft.cc,
fft2.cc, fftn.cc, file-io.cc, find.cc, gcd.cc, getgrent.cc,
getpwent.cc, getrusage.cc, gsvd.cc, hash.cc, help.cc, hess.cc,
hex2num.cc, input.cc, inv.cc, jsondecode.cc, jsonencode.cc,
load-path.cc, load-save.cc, lookup.cc, lsode.cc, lu.cc, max.cc,
mgorth.cc, oct-hist.cc, ordqz.cc, ordschur.cc, pager.cc, pr-output.cc,
psi.cc, qr.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, regexp.cc,
schur.cc, settings.cc, sighandlers.cc, sparse.cc, spparms.cc,
sqrtm.cc, stream-euler.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc,
symbfact.cc, symtab.cc, syscalls.cc, sysdep.cc, time.cc, toplev.cc,
tril.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc,
__delaunayn__.cc, __fltk_uigetfile__.cc, __glpk__.cc,
__init_gnuplot__.cc, __ode15__.cc, __voronoi__.cc, audiodevinfo.cc,
audioread.cc, convhulln.cc, fftw.cc, gzip.cc, ov-cell.cc, ov-class.cc,
ov-classdef.cc, ov-fcn-handle.cc, ov-struct.cc, ov-typeinfo.cc,
ov-usr-fcn.cc, octave.cc, lex.ll, oct-parse.yy, profiler.cc,
andpt-eval.cc.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 14 Aug 2021 22:48:52 -0400 |
parents | 32c3a5805893 |
children | 80373844f8b2 |
line wrap: on
line diff
--- a/libinterp/corefcn/quadcc.cc Sat Aug 14 21:50:26 2021 -0400 +++ b/libinterp/corefcn/quadcc.cc Sat Aug 14 22:48:52 2021 -0400 @@ -45,6 +45,8 @@ // Extended debugging. #define DEBUG_QUADCC 0 +OCTAVE_NAMESPACE_BEGIN + // Define the minimum size of the interval heap. static const int MIN_CQUAD_HEAPSIZE = 200; @@ -1484,8 +1486,6 @@ } } -OCTAVE_NAMESPACE_BEGIN - // The actual integration routine. DEFMETHOD (quadcc, interp, args, , @@ -1596,7 +1596,7 @@ if (nargin < 3) print_usage (); - fcn = octave::get_function_handle (interp, args(0), "x"); + fcn = get_function_handle (interp, args(0), "x"); if (! args(1).is_real_scalar ()) error ("quadcc: lower limit of integration (A) must be a real scalar"); @@ -1675,11 +1675,11 @@ } // If a or b are +/-Inf, transform the integral. - if (octave::math::isinf (a) || octave::math::isinf (b)) + if (math::isinf (a) || math::isinf (b)) { wrap = true; for (i = 0; i < nivals + 1; i++) - if (octave::math::isinf (iivals[i])) + if (math::isinf (iivals[i])) iivals[i] = std::copysign (1.0, iivals[i]); else iivals[i] = 2.0 * atan (iivals[i]) / M_PI; @@ -1711,7 +1711,7 @@ ex(i) = m + xi[i]*h; } fargs(0) = ex; - fvals = octave::feval (fcn, fargs, 1); + fvals = feval (fcn, fargs, 1); if (fvals.length () != 1 || ! fvals(0).is_real_matrix ()) error ("quadcc: integrand F must return a single, real-valued vector"); @@ -1728,7 +1728,7 @@ iv->fx[i] *= (1.0 + xw*xw) * M_PI/2; } neval++; - if (! octave::math::isfinite (iv->fx[i])) + if (! math::isfinite (iv->fx[i])) { nans[nnans++] = i; iv->fx[i] = 0.0; @@ -1738,7 +1738,7 @@ Vinvfx (iv->fx, &(iv->c[idx[2]]), 2); Vinvfx (iv->fx, &(iv->c[0]), 0); for (i = 0; i < nnans; i++) - iv->fx[nans[i]] = octave::numeric_limits<double>::NaN (); + iv->fx[nans[i]] = numeric_limits<double>::NaN (); iv->a = iivals[j]; iv->b = iivals[j + 1]; iv->depth = 3; @@ -1821,7 +1821,7 @@ ex(i) = m + xi[(2*i + 1) * skip[d]] * h; } fargs(0) = ex; - fvals = octave::feval (fcn, fargs, 1); + fvals = feval (fcn, fargs, 1); if (fvals.length () != 1 || ! fvals(0).is_real_matrix ()) error ("quadcc: integrand F must return a single, real-valued vector"); @@ -1844,7 +1844,7 @@ nnans = 0; for (i = 0; i <= 32; i += skip[d]) { - if (! octave::math::isfinite (iv->fx[i])) + if (! math::isfinite (iv->fx[i])) { nans[nnans++] = i; iv->fx[i] = 0.0; @@ -1858,7 +1858,7 @@ { downdate (&(iv->c[idx[d]]), n[d], d, nans, nnans); for (i = 0; i < nnans; i++) - iv->fx[nans[i]] = octave::numeric_limits<double>::NaN (); + iv->fx[nans[i]] = numeric_limits<double>::NaN (); } // Compute the error estimate. @@ -1954,7 +1954,7 @@ ex(i) = ml + xi[(i + 1) * skip[0]] * hl; } fargs(0) = ex; - fvals = octave::feval (fcn, fargs, 1); + fvals = feval (fcn, fargs, 1); if (fvals.length () != 1 || ! fvals(0).is_real_matrix ()) error ("quadcc: integrand F must return a single, real-valued vector"); @@ -1977,7 +1977,7 @@ nnans = 0; for (i = 0; i <= 32; i += skip[0]) { - if (! octave::math::isfinite (ivl->fx[i])) + if (! math::isfinite (ivl->fx[i])) { nans[nnans++] = i; ivl->fx[i] = 0.0; @@ -1988,7 +1988,7 @@ { downdate (ivl->c, n[0], 0, nans, nnans); for (i = 0; i < nnans; i++) - ivl->fx[nans[i]] = octave::numeric_limits<double>::NaN (); + ivl->fx[nans[i]] = numeric_limits<double>::NaN (); } for (i = 0; i <= n[d]; i++) { @@ -2014,7 +2014,7 @@ && ivl->c[0] / iv->c[0] > 2); if (ivl->ndiv > ndiv_max && 2*ivl->ndiv > ivl->rdepth) { - igral = std::copysign (octave::numeric_limits<double>::Inf (), igral); + igral = std::copysign (numeric_limits<double>::Inf (), igral); warning ("quadcc: divergent integral detected"); break; } @@ -2045,7 +2045,7 @@ ex(i) = mr + xi[(i + 1) * skip[0]] * hr; } fargs(0) = ex; - fvals = octave::feval (fcn, fargs, 1); + fvals = feval (fcn, fargs, 1); if (fvals.length () != 1 || ! fvals(0).is_real_matrix ()) error ("quadcc: integrand F must return a single, real-valued vector"); @@ -2068,7 +2068,7 @@ nnans = 0; for (i = 0; i <= 32; i += skip[0]) { - if (! octave::math::isfinite (ivr->fx[i])) + if (! math::isfinite (ivr->fx[i])) { nans[nnans++] = i; ivr->fx[i] = 0.0; @@ -2079,7 +2079,7 @@ { downdate (ivr->c, n[0], 0, nans, nnans); for (i = 0; i < nnans; i++) - ivr->fx[nans[i]] = octave::numeric_limits<double>::NaN (); + ivr->fx[nans[i]] = numeric_limits<double>::NaN (); } for (i = 0; i <= n[d]; i++) { @@ -2105,7 +2105,7 @@ && ivr->c[0] / iv->c[0] > 2); if (ivr->ndiv > ndiv_max && 2*ivr->ndiv > ivr->rdepth) { - igral = std::copysign (octave::numeric_limits<double>::Inf (), igral); + igral = std::copysign (numeric_limits<double>::Inf (), igral); warning ("quadcc: divergent integral detected"); break; }