Mercurial > hg > octave-lyh
changeset 11562:1811f4f8b3b5
Rename cquad to quadcc and add to documentation.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Mon, 17 Jan 2011 20:18:07 -0800 |
parents | 1140bd9f9b21 |
children | 3c6e8aaa9555 |
files | ChangeLog NEWS doc/ChangeLog doc/interpreter/quad.txi scripts/ChangeLog scripts/general/dblquad.m scripts/general/quadgk.m scripts/general/quadl.m scripts/general/quadv.m scripts/general/triplequad.m src/ChangeLog src/DLD-FUNCTIONS/cquad.cc src/DLD-FUNCTIONS/module-files src/DLD-FUNCTIONS/quad.cc src/DLD-FUNCTIONS/quadcc.cc |
diffstat | 14 files changed, 74 insertions(+), 50 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-17 Rik <octave@nomad.inbox5.com> + + * NEWS: Add quadcc to list of new functions added. + 2011-01-17 John W. Eaton <jwe@octave.org> * mkoctfile.cc.in (main): Add + missing from previous change.
--- a/NEWS +++ b/NEWS @@ -62,7 +62,7 @@ `issymmetric' has been changed for better consistency. * The `ismatrix' function now returns true for all numeric, - logical and character 2d or Nd matrices. Previously, `ismatrix' + logical and character 2-D or N-D matrices. Previously, `ismatrix' returned false if the first or second dimension was zero. Hence, `ismatrix ([])' was false, while `ismatrix (zeros (1,2,0))' was true. @@ -76,7 +76,7 @@ now yields true. * The `issymmetric' function now checks for symmetry instead of - hermitianness. For the latter, ishermitian was created. Also, + Hermitianness. For the latter, ishermitian was created. Also, logical scalar is returned rather than the dimension, so `issymmetric ([])' is now true. @@ -313,15 +313,15 @@ ** The following functions are new in Octave 3.4: - accumdim erfcx nfields pqpnonneg uigetfile - bitpack fileread nth_element randi uiputfile - bitunpack fminbnd onCleanup repelems uimenu - blkmm fskipl pbaspect reset whitebg - cbrt ifelse pie3 rsf2csf - curl ishermitian powerset saveas - chop isindex ppder strread - daspect luupdate ppint textread - divergence merge ppjumps uigetdir + accumdim erfcx nfields pqpnonneg uigetdir + bitpack fileread nth_element quadcc uigetfile + bitunpack fminbnd onCleanup randi uiputfile + blkmm fskipl pbaspect repelems uimenu + cbrt ifelse pie3 reset whitebg + curl ishermitian powerset rsf2csf + chop isindex ppder saveas + daspect luupdate ppint strread + divergence merge ppjumps textread ** Using the image function to view images with external programs such as display, xv, and xloadimage is no longer supported. The
--- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2011-01-17 Rik <octave@nomad.inbox5.com> + + * interpreter/quad.txi: Add quadcc to documentation. + 2011-01-15 Rik <octave@nomad.inbox5.com> * interpreter/expr.txi: Add merge/ifelse function to documentation.
--- a/doc/interpreter/quad.txi +++ b/doc/interpreter/quad.txi @@ -54,6 +54,9 @@ @item quadv Numerical integration using an adaptive vectorized Simpson's rule. +@item quadcc +Numerical integration using adaptive Clenshaw-Curtis rules. + @item trapz Numerical integration using the trapezoidal method. @end table @@ -124,6 +127,8 @@ @DOCSTRING(quadv) +@DOCSTRING(quadcc) + @DOCSTRING(trapz) @DOCSTRING(cumtrapz)
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2011-01-17 Rik <octave@nomad.inbox5.com> + + * general/dblquad.m, general/quadgk.m, general/quadl.m, + general/quadv.m, general/triplequad.m: Improve docstring with seealso + links to quadcc. + 2011-01-17 John W. Eaton <jwe@octave.org> * miscellaneous/isdeployed.m: New function.
--- a/scripts/general/dblquad.m +++ b/scripts/general/dblquad.m @@ -29,7 +29,7 @@ ## ## Additional arguments, are passed directly to @var{f}. To use the default ## value for @var{tol} one may pass an empty matrix. -## @seealso{triplequad, quad, quadv, quadl, quadgk, trapz} +## @seealso{triplequad,quad,quadv,quadl,quadgk,quadcc,trapz} ## @end deftypefn function q = dblquad(f, xa, xb, ya, yb, tol, quadf, varargin)
--- a/scripts/general/quadgk.m +++ b/scripts/general/quadgk.m @@ -112,7 +112,7 @@ ## approximate bounds on the error in the integral @code{abs (@var{q} - ## @var{i})}, where @var{i} is the exact value of the integral. ## -## @seealso{triplequad, dblquad, quad, quadl, quadv, trapz} +## @seealso{quad,quadv,quadl,quadcc,trapz,dblquad,triplequad} ## @end deftypefn function [q, err] = quadgk (f, a, b, varargin)
--- a/scripts/general/quadl.m +++ b/scripts/general/quadl.m @@ -41,7 +41,7 @@ ## Reference: W. Gander and W. Gautschi, @cite{Adaptive Quadrature - ## Revisited}, BIT Vol. 40, No. 1, March 2000, pp. 84--101. ## @url{http://www.inf.ethz.ch/personal/gander/} -## +## @seealso{quad,quadv,quadgk,quadcc,trapz,dblquad,triplequad} ## @end deftypefn ## Author: Walter Gautschi
--- a/scripts/general/quadv.m +++ b/scripts/general/quadv.m @@ -42,7 +42,7 @@ ## To use default values for @var{tol} and @var{trace}, one may pass ## empty matrices. ## -## @seealso{triplequad, dblquad, quad, quadl, quadgk, trapz} +##@seealso{quad,quadl,quadgk,quadcc,trapz,dblquad,triplequad} ## @end deftypefn function [q, fcnt] = quadv (f, a, b, tol, trace, varargin)
--- a/scripts/general/triplequad.m +++ b/scripts/general/triplequad.m @@ -30,7 +30,7 @@ ## ## Additional arguments, are passed directly to @var{f}. To use the default ## value for @var{tol} one may pass an empty matrix. -## @seealso{dblquad, quad, quadv, quadl, quadgk, trapz} +## @seealso{dblquad,quad,quadv,quadl,quadgk,quadcc,trapz} ## @end deftypefn function Q = triplequad(f, xa, xb, ya, yb, za, zb, tol, quadf, varargin)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-17 Rik <octave@nomad.inbox5.com> + + * DLD-FUNCTIONS/module-files: Add quadcc.cc to list of files. + * DLD-FUNCTIONS/quad.cc: Add Seealso links to quadcc. + 2011-01-17 Jaroslav Hajek <highegg@gmail.com> * DLD-FUNCTION/lookup.cc (Flookup): Validate option string.
--- a/src/DLD-FUNCTIONS/module-files +++ b/src/DLD-FUNCTIONS/module-files @@ -20,7 +20,6 @@ colloc.cc conv2.cc convhulln.cc -cquad.cc daspk.cc dasrt.cc dassl.cc @@ -58,6 +57,7 @@ pinv.cc qr.cc quad.cc +quadcc.cc qz.cc rand.cc rcond.cc
--- a/src/DLD-FUNCTIONS/quad.cc +++ b/src/DLD-FUNCTIONS/quad.cc @@ -214,7 +214,7 @@ \n\ Note: because @code{quad} is written in Fortran it\n\ cannot be called recursively.\n\ -@seealso{quad_options,quadv,quadl,quadgk,trapz}\n\ +@seealso{quad_options,quadv,quadl,quadgk,quadcc,trapz,dblquad,triplequad}\n\ @end deftypefn") { octave_value_list retval;
rename from src/DLD-FUNCTIONS/cquad.cc rename to src/DLD-FUNCTIONS/quadcc.cc --- a/src/DLD-FUNCTIONS/cquad.cc +++ b/src/DLD-FUNCTIONS/quadcc.cc @@ -1477,13 +1477,13 @@ /* The actual integration routine. */ -DEFUN_DLD (cquad, args, nargout, +DEFUN_DLD (quadcc, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} cquad (@var{f}, @var{a}, @var{b}, @var{tol})\n\ -@deftypefnx {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} cquad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ +@deftypefn {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol})\n\ +@deftypefnx {Function File} {[@var{int}, @var{err}, @var{nr_points}] =} quadcc (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ Numerically evaluates an integral using the doubly-adaptive\n\ quadrature described by P. Gonnet in @cite{Increasing the\n\ -Reliability of Adaptive Quadrature Using Explicit Interpolants,\n\ +Reliability of Adaptive Quadrature Using Explicit Interpolants},\n\ ACM Transactions on Mathematical Software, in Press, 2010.\n\ The algorithm uses Clenshaw-Curtis quadrature rules of increasing\n\ degree in each interval and bisects the interval if either the\n\ @@ -1495,7 +1495,7 @@ For example,\n\ \n\ @example\n\ - int = cquad (f, a, b, 1.0e-6);\n\ + int = quadcc (f, a, b, 1.0e-6);\n\ @end example\n\ \n\ @noindent\n\ @@ -1516,7 +1516,7 @@ the additional argument @var{sing} as follows\n\ \n\ @example\n\ - int = cquad (f, a, b, 1.0e-6, [ 1 ]);\n\ + int = quadcc (f, a, b, 1.0e-6, [ 1 ]);\n\ @end example\n\ \n\ The two additional output variables @var{err} and @var{nr_points}\n\ @@ -1528,22 +1528,22 @@ therefore recommended to verify this value for difficult\n\ integrands.\n\ \n\ -If either @var{a} or @var{b} are @code{+/-Inf}, @code{cquad}\n\ +If either @var{a} or @var{b} are @code{+/-Inf}, @code{quadcc}\n\ integrates @var{f} by substituting the variable of integration\n\ with @code{x=tan(pi/2*u)}.\n\ \n\ -@code{cquad} is capable of dealing with non-numeric\n\ +@code{quadcc} is capable of dealing with non-numeric\n\ values of the integrand such as @code{NaN}, @code{Inf}\n\ or @code{-Inf}, as in the above example at x=0.\n\ -If the integral diverges and @code{cquad} detects this, \n\ +If the integral diverges and @code{quadcc} detects this, \n\ a warning is issued and @code{Inf} or @code{-Inf} is returned.\n\ \n\ -Note that @code{cquad} is a general purpose quadrature algorithm\n\ +Note that @code{quadcc} is a general purpose quadrature algorithm\n\ and as such may be less efficient for smooth or otherwise\n\ well-behaved integrand than other methods such as\n\ @code{quadgk} or @code{trapz}.\n\ \n\ -@seealso{quad,quadv,quadl,quadgk,trapz}\n\ +@seealso{quad,quadv,quadl,quadgk,trapz,dblquad,triplequad}\n\ @end deftypefn") { @@ -1584,7 +1584,7 @@ if (nargin < 1) { error - ("cquad: first argument (integrand) of type function handle required."); + ("quadcc: first argument (integrand) of type function handle required."); return octave_value_list (); } else @@ -1593,7 +1593,7 @@ fcn = args (0).function_value (); else { error - ("cquad: first argument (integrand) must be a function handle or an inline function."); + ("quadcc: first argument (integrand) must be a function handle or an inline function."); return octave_value_list(); } } @@ -1601,7 +1601,7 @@ if (nargin < 2 || !args (1).is_real_scalar ()) { error - ("cquad: second argument (left interval edge) must be a single real scalar."); + ("quadcc: second argument (left interval edge) must be a single real scalar."); return octave_value_list (); } else @@ -1610,7 +1610,7 @@ if (nargin < 3 || !args (2).is_real_scalar ()) { error - ("cquad: third argument (right interval edge) must be a single real scalar."); + ("quadcc: third argument (right interval edge) must be a single real scalar."); return octave_value_list (); } else @@ -1621,7 +1621,7 @@ else if (!args (3).is_real_scalar ()) { error - ("cquad: fourth argument (tolerance) must be a single real scalar."); + ("quadcc: fourth argument (tolerance) must be a single real scalar."); return octave_value_list (); } else @@ -1636,14 +1636,14 @@ else if (!(args (4).is_real_scalar () || args (4).is_real_matrix ())) { error - ("cquad: fifth argument (singularities) must be a vector of real values."); + ("quadcc: fifth argument (singularities) must be a vector of real values."); return octave_value_list (); } else { nivals = 1 + args (4).length (); if ( nivals > cquad_heapsize ) { - error("cquad: maximum number of singular points is limited to %i.",cquad_heapsize-1); + error("quadcc: maximum number of singular points is limited to %i.",cquad_heapsize-1); return octave_value_list(); } sing = args (4).array_value ().fortran_vec (); @@ -1697,14 +1697,14 @@ if (retval.length () != 1 || !retval (0).is_real_matrix ()) { error - ("cquad: integrand must return a single, real-valued vector."); + ("quadcc: integrand must return a single, real-valued vector."); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { error - ("cquad: integrand must return a single, real-valued vector of the same size as the input"); + ("quadcc: integrand must return a single, real-valued vector of the same size as the input"); return octave_value_list (); } for (i = 0; i <= n[3]; i++) @@ -1790,7 +1790,7 @@ h = (iv->b - iv->a) / 2; /* printf - ("cquad: processing ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + ("quadcc: processing ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); */ /* Should we try to increase the degree? */ @@ -1819,14 +1819,14 @@ if (retval.length () != 1 || !retval (0).is_real_matrix ()) { error - ("cquad: integrand must return a single, real-valued vector."); + ("quadcc: integrand must return a single, real-valued vector."); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { error - ("cquad: integrand must return a single, real-valued vector of the same size as the input."); + ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); return octave_value_list (); } neval += effex.length (); @@ -1898,7 +1898,7 @@ { /* printf - ("cquad: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); */ @@ -1969,14 +1969,14 @@ if (retval.length () != 1 || !retval (0).is_real_matrix ()) { error - ("cquad: integrand must return a single, real-valued vector."); + ("quadcc: integrand must return a single, real-valued vector."); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { error - ("cquad: integrand must return a single, real-valued vector of the same size as the input."); + ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); return octave_value_list (); } neval += effex.length (); @@ -2032,7 +2032,7 @@ if (ivl->ndiv > ndiv_max && 2 * ivl->ndiv > ivl->rdepth) { igral = copysign (octave_Inf, igral); - warning ("cquad: divergent integral detected."); + warning ("quadcc: divergent integral detected."); break; } @@ -2067,14 +2067,14 @@ if (retval.length () != 1 || !retval (0).is_real_matrix ()) { error - ("cquad: integrand must return a single, real-valued vector."); + ("quadcc: integrand must return a single, real-valued vector."); return octave_value_list (); } Matrix effex = retval (0).matrix_value (); if (effex.length () != ex.length ()) { error - ("cquad: integrand must return a single, real-valued vector of the same size as the input."); + ("quadcc: integrand must return a single, real-valued vector of the same size as the input."); return octave_value_list (); } neval += effex.length (); @@ -2130,7 +2130,7 @@ if (ivr->ndiv > ndiv_max && 2 * ivr->ndiv > ivr->rdepth) { igral = copysign (octave_Inf, igral); - warning ("cquad: divergent integral detected."); + warning ("quadcc: divergent integral detected."); break; } @@ -2214,7 +2214,7 @@ { iv = &(ivals[heap[nivals - 1]]); /* printf - ("cquad: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", + ("quadcc: dropping ival %i (of %i) with [%e,%e] int=%e, err=%e, depth=%i\n", heap[0], nivals, iv->a, iv->b, iv->igral, iv->err, iv->depth); */ @@ -2239,7 +2239,7 @@ { iv = &(ivals[heap[i]]); printf - ("cquad: ival %i (%i) with [%e,%e], int=%e, err=%e, depth=%i, rdepth=%i, ndiv=%i\n", + ("quadcc: ival %i (%i) with [%e,%e], int=%e, err=%e, depth=%i, rdepth=%i, ndiv=%i\n", i, heap[i], iv->a, iv->b, iv->igral, iv->err, iv->depth, iv->rdepth, iv->ndiv); }