12 #include "DASSL-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 {
"compute consistent initial condition",
46 {
"compute",
"consistent",
"initial",
"condition",
nullptr, },
47 { 1, 0, 0, 0, 0, }, 1, },
49 {
"enforce nonnegativity constraints",
50 {
"enforce",
"nonnegativity",
"constraints",
nullptr,
nullptr, },
51 { 1, 0, 0, 0, 0, }, 1, },
53 {
"initial step size",
54 {
"initial",
"step",
"size",
nullptr,
nullptr, },
55 { 1, 0, 0, 0, 0, }, 1, },
58 {
"maximum",
"order",
nullptr,
nullptr,
nullptr, },
59 { 1, 1, 0, 0, 0, }, 2, },
61 {
"maximum step size",
62 {
"maximum",
"step",
"size",
nullptr,
nullptr, },
63 { 1, 1, 0, 0, 0, }, 2, },
66 {
"step",
"limit",
nullptr,
nullptr,
nullptr, },
67 { 1, 0, 0, 0, 0, }, 1, },
73 std::ostringstream buf;
76 <<
"Options for DASSL include:\n\n"
78 <<
" ------- -----\n";
91 if (val.
numel () == 1)
113 if (val.
numel () == 1)
115 os << val(0) <<
"\n";
133 int val =
dassl_opts.compute_consistent_initial_condition ();
145 int val =
dassl_opts.enforce_nonnegativity_constraints ();
207 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
214 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
221 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
225 dassl_opts.set_compute_consistent_initial_condition (tmp);
228 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
232 dassl_opts.set_enforce_nonnegativity_constraints (tmp);
235 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
242 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
249 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
256 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
264 warning (
"dassl_options: no match for `%s'", keyword.c_str ());
276 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
280 if (val.
numel () == 1)
290 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
294 if (val.
numel () == 1)
304 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
306 int val =
dassl_opts.compute_consistent_initial_condition ();
308 retval =
static_cast<double> (val);
311 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
313 int val =
dassl_opts.enforce_nonnegativity_constraints ();
315 retval =
static_cast<double> (val);
318 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
325 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
329 retval =
static_cast<double> (val);
332 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
339 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
343 retval =
static_cast<double> (val);
347 warning (
"dassl_options: no match for `%s'", keyword.c_str ());
355 DEFUN (dassl_options, args, ,
426 int nargin = args.
length ();
437 std::string keyword = args(0).xstring_value (
"dassl_options: expecting keyword as first argument");
static DASSL_options_struct DASSL_options_table[]
static octave_value_list show_DASSL_options(const std::string &keyword)
static void set_DASSL_options(const std::string &keyword, const octave_value &val)
static DASSL_options dassl_opts
static void print_DASSL_options(std::ostream &os)
OCTARRAY_OVERRIDABLE_FUNC_API octave_idx_type numel(void) const
Number of elements in the array.
octave_idx_type length(void) const
int int_value(bool req_int=false, bool frc_str_conv=false) const
OCTINTERP_API Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_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,...)
class OCTAVE_API ColumnVector
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)
int keyword_almost_match(const char *const *std, int *min_len, const std::string &s, int min_toks_to_match, int max_toks)