25 struct Quad_options_struct
30 int min_toks_to_match;
35 static Quad_options_struct Quad_options_table [] =
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, },
55 print_Quad_options (std::ostream& os)
57 std::ostringstream buf;
60 <<
"Options for Quad include:\n\n"
62 <<
" ------- -----\n";
64 Quad_options_struct *list = Quad_options_table;
68 << std::setiosflags (std::ios::left) << std::setw (50)
70 << std::resetiosflags (std::ios::left)
80 << std::setiosflags (std::ios::left) << std::setw (50)
82 << std::resetiosflags (std::ios::left)
92 << std::setiosflags (std::ios::left) << std::setw (50)
94 << std::resetiosflags (std::ios::left)
104 << std::setiosflags (std::ios::left) << std::setw (50)
106 << std::resetiosflags (std::ios::left)
118 set_Quad_options (
const std::string& keyword,
const octave_value& val)
120 Quad_options_struct *list = Quad_options_table;
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))
144 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
152 warning (
"quad_options: no match for `%s'", keyword.c_str ());
157 show_Quad_options (
const std::string& keyword)
161 Quad_options_struct *list = Quad_options_table;
164 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
171 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
178 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
185 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
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");
254 retval = show_Quad_options (keyword);
256 set_Quad_options (keyword, args(1));
262 OCTAVE_END_NAMESPACE(
octave)
void set_single_precision_relative_tolerance(float val)
float single_precision_relative_tolerance() const
void set_single_precision_absolute_tolerance(float val)
double absolute_tolerance() const
void set_absolute_tolerance(double val)
float single_precision_absolute_tolerance() const
double relative_tolerance() const
void set_relative_tolerance(double val)
float float_value(bool frc_str_conv=false) const
octave_idx_type length() const
double double_value(bool frc_str_conv=false) const
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
#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)