23 #if defined (HAVE_CONFIG_H)
76 catch (octave::execution_exception&
e)
81 if (! tmp.
length () || !
tmp(0).is_defined ())
84 if (! warned_imaginary &&
tmp(0).is_complex_type ())
86 warning (
"quad: ignoring imaginary part returned from user-supplied function");
87 warned_imaginary =
true;
90 retval =
tmp(0).xdouble_value (
"quad: expecting user supplied function to return numeric value");
112 catch (octave::execution_exception&
e)
117 if (! tmp.
length () || !
tmp(0).is_defined ())
120 if (! warned_imaginary &&
tmp(0).is_complex_type ())
122 warning (
"quad: ignoring imaginary part returned from user-supplied function");
123 warned_imaginary =
true;
126 retval =
tmp(0).xfloat_value (
"quad: expecting user supplied function to return numeric value");
180 if (nargin < 3 || nargin > 5)
183 warned_imaginary =
false;
191 error (
"quad: invalid recursive call");
195 if (
args(0).is_function_handle () ||
args(0).is_inline_function ())
196 quad_fcn =
args(0).function_value ();
201 fname.append (fcn_name);
202 fname.append (
"(x) y = ");
209 error (
"quad: FCN argument is not a valid function name or handle");
213 if (
args(1).is_single_type () ||
args(2).is_single_type ())
215 float a =
args(1).xfloat_value (
"quad: lower limit of integration A must be a scalar");
216 float b =
args(2).xfloat_value (
"quad: upper limit of integration B must be a scalar");
244 bool have_sing =
false;
252 error (
"quad: singularities not allowed on infinite intervals");
256 sing =
args(4).xfloat_vector_value (
"quad: fifth argument SING must be a vector of singularities");
259 tol =
args(3).xfloat_vector_value (
"quad: TOL must be a 1 or 2-element vector");
261 switch (tol.
numel ())
271 error (
"quad: TOL must be a 1 or 2-element vector");
304 retval =
ovl (val, ier, nfun, abserr);
309 double a =
args(1).xdouble_value (
"quad: lower limit of integration A must be a scalar");
310 double b =
args(2).xdouble_value (
"quad: upper limit of integration B must be a scalar");
337 bool have_sing =
false;
345 error (
"quad: singularities not allowed on infinite intervals");
349 sing =
args(4).vector_value (
"quad: fifth argument SING must be a vector of singularities");
352 tol =
args(3).xvector_value (
"quad: TOL must be a 1 or 2-element vector");
354 switch (tol.
numel ())
364 error (
"quad: TOL must be a 1 or 2-element vector");
396 retval =
ovl (val, ier, nfun, abserr);
399 if (fcn_name.length ())
void set_single_precision_relative_tolerance(float val)
virtual double integrate(void)
virtual octave_value_list do_multi_index_op(int nargout, const octave_value_list &idx)
virtual float float_integrate(void)
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
void set_relative_tolerance(double val)
identity matrix If supplied two scalar respectively For allows like xample val
octave_idx_type length(void) const
double quad_user_function(double x)
void error(const char *fmt,...)
static Quad_options quad_opts
std::string unique_symbol_name(const std::string &basename)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
void clear_function(const std::string &nm)
void add_fcn(void(*fcn)(void))
void set_single_precision_absolute_tolerance(float val)
float quad_float_user_function(float x)
#define panic_impossible()
static bool warned_imaginary
void set_options(const Quad_options &opt)
static octave_function * quad_fcn
void warning(const char *fmt,...)
octave::unwind_protect frame
void err_user_supplied_eval(const char *name)
void set_absolute_tolerance(double val)
octave_function * extract_function(const octave_value &arg, const std::string &warn_for, const std::string &fname, const std::string &header, const std::string &trailer)
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x