12 #include "Quad-opts.h"
37 {
"absolute tolerance",
38 {
"absolute",
"tolerance",
nullptr,
nullptr,
nullptr, },
39 { 1, 0, 0, 0, 0, }, 1, },
41 {
"relative tolerance",
42 {
"relative",
"tolerance",
nullptr,
nullptr,
nullptr, },
43 { 1, 0, 0, 0, 0, }, 1, },
45 {
"single precision absolute tolerance",
46 {
"single",
"precision",
"absolute",
"tolerance",
nullptr, },
47 { 1, 1, 1, 0, 0, }, 3, },
49 {
"single precision relative tolerance",
50 {
"single",
"precision",
"relative",
"tolerance",
nullptr, },
51 { 1, 1, 1, 0, 0, }, 3, },
57 std::ostringstream buf;
60 <<
"Options for Quad include:\n\n"
62 <<
" ------- -----\n";
73 double val =
quad_opts.absolute_tolerance ();
85 double val =
quad_opts.relative_tolerance ();
97 float val =
quad_opts.single_precision_absolute_tolerance ();
109 float val =
quad_opts.single_precision_relative_tolerance ();
123 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
130 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
137 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
141 quad_opts.set_single_precision_absolute_tolerance (tmp);
144 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
148 quad_opts.set_single_precision_relative_tolerance (tmp);
152 warning (
"quad_options: no match for `%s'", keyword.c_str ());
164 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
166 double val =
quad_opts.absolute_tolerance ();
171 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
173 double val =
quad_opts.relative_tolerance ();
178 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
180 float val =
quad_opts.single_precision_absolute_tolerance ();
185 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
187 float val =
quad_opts.single_precision_relative_tolerance ();
193 warning (
"quad_options: no match for `%s'", keyword.c_str ());
201 DEFUN (quad_options, args, ,
240 int nargin = args.
length ();
251 std::string keyword = args(0).xstring_value (
"quad_options: expecting keyword as first argument");
static octave_value_list show_Quad_options(const std::string &keyword)
static void print_Quad_options(std::ostream &os)
static Quad_options_struct Quad_options_table[]
static Quad_options quad_opts
static void set_Quad_options(const std::string &keyword, const octave_value &val)
octave_idx_type length(void) const
float float_value(bool frc_str_conv=false) const
double double_value(bool frc_str_conv=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void warning(const char *fmt,...)
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)