#include <string>
#include <iomanip>
#include <iostream>
#include "Quad.h"
#include "lo-mappers.h"
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "pager.h"
#include "oct-obj.h"
#include "ov-fcn.h"
#include "unwind-prot.h"
#include "utils.h"
#include "variables.h"
#include "Quad-opts.cc"
Go to the source code of this file.
Defines | |
#define | QUAD_ABORT() |
#define | QUAD_ABORT1(msg) |
#define | QUAD_ABORT2(fmt, arg) |
Functions | |
DEFUN_DLD (quad, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Loadable Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b})\n\ @deftypefnx {Loadable Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol})\n\ @deftypefnx {Loadable Function} {@var{q} =} quad (@var{f}, @var{a}, @var{b}, @var{tol}, @var{sing})\n\ @deftypefnx {Loadable Function} {[@var{q}, @var{ier}, @var{nfun}, @var{err}] =} quad (@dots{})\n\ Numerically evaluate the integral of @var{f} from @var{a} to @var{b} using\n\ Fortran routines from @w{@sc{quadpack}}. @var{f} is a function handle,\n\ inline function, or a string containing the name of the function to\n\ evaluate. The function must have the form @code{y = f (x)} where @var{y} and\n\ @var{x} are scalars.\n\ \n\ @var{a} and @var{b} are the lower and upper limits of integration. Either\n\ or both may be infinite.\n\ \n\ The optional argument @var{tol} is a vector that specifies the desired\n\ accuracy of the result. The first element of the vector is the desired\n\ absolute tolerance, and the second element is the desired relative\n\ tolerance. To choose a relative test only, set the absolute\n\ tolerance to zero. To choose an absolute test only, set the relative\n\ tolerance to zero. Both tolerances default to @code{sqrt(eps)} or\n\ approximately @math{1.5e^{-8}}.\n\ \n\ The optional argument @var{sing} is a vector of values at which the\n\ integrand is known to be singular.\n\ \n\ The result of the integration is returned in @var{q}. @var{ier}\n\ contains an integer error code (0 indicates a successful integration).\n\ @var{nfun} indicates the number of function evaluations that were\n\ made, and @var{err} contains an estimate of the error in the\n\ solution.\n\ \n\ The function @code{quad_options} can set other optional\n\ parameters for @code{quad}.\n\ \n\ Note: because @code{quad} is written in Fortran it cannot be called\n\ recursively. This prevents its use in integrating over more than one\n\ variable by routines @code{dblquad} and @code{triplequad}.\n\ @seealso{quad_options, quadv, quadl, quadgk, quadcc, trapz, dblquad, triplequad}\n\ @end deftypefn") | |
float | quad_float_user_function (float x) |
double | quad_user_function (double x) |
Variables | |
static int | call_depth = 0 |
static octave_function * | quad_fcn |
static bool | warned_imaginary = false |
#define QUAD_ABORT | ( | ) |
do \ { \ if (fcn_name.length()) \ clear_function (fcn_name); \ return retval; \ } \ while (0)
Definition at line 150 of file quad.cc.
Referenced by DEFUN_DLD().
#define QUAD_ABORT1 | ( | msg | ) |
do \ { \ ::error ("quad: " msg); \ QUAD_ABORT (); \ } \ while (0)
Definition at line 159 of file quad.cc.
Referenced by DEFUN_DLD().
#define QUAD_ABORT2 | ( | fmt, | ||
arg | ||||
) |
do \ { \ ::error ("quad: " fmt, arg); \ QUAD_ABORT (); \ } \ while (0)
DEFUN_DLD | ( | quad | , | |
args | , | |||
nargout | ||||
) |
Definition at line 175 of file quad.cc.
References Array< T >::capacity(), clear_function(), error_state, extract_function(), Quad::float_integrate(), octave_base_value::function_value(), Quad::integrate(), panic_impossible, print_usage(), unwind_protect::protect_var(), QUAD_ABORT, QUAD_ABORT1, quad_float_user_function(), quad_user_function(), unique_symbol_name(), and xisinf().
Definition at line 106 of file quad.cc.
References octave_base_value::do_multi_index_op(), error_state, gripe_user_supplied_eval(), octave_value_list::length(), quad_integration_error, and warning().
Referenced by DEFUN_DLD().
Definition at line 61 of file quad.cc.
References octave_base_value::do_multi_index_op(), error_state, gripe_user_supplied_eval(), octave_value_list::length(), quad_integration_error, and warning().
Referenced by DEFUN_DLD().
int call_depth = 0 [static] |
octave_function* quad_fcn [static] |
bool warned_imaginary = false [static] |