Defines | Functions | Variables

quad.cc File Reference

#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"
Include dependency graph for quad.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_functionquad_fcn
static bool warned_imaginary = false

Define Documentation

#define QUAD_ABORT (  ) 
Value:
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  ) 
Value:
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 
)
Value:
do \
    { \
      ::error ("quad: " fmt, arg); \
      QUAD_ABORT (); \
    } \
  while (0)

Definition at line 167 of file quad.cc.


Function Documentation

DEFUN_DLD ( quad  ,
args  ,
nargout   
)
float quad_float_user_function ( float  x  ) 
double quad_user_function ( double  x  ) 

Variable Documentation

int call_depth = 0 [static]

Definition at line 58 of file quad.cc.

Definition at line 52 of file quad.cc.

bool warned_imaginary = false [static]

Definition at line 55 of file quad.cc.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines