12 #include "LSODE-opts.h"
37 {
"absolute tolerance",
38 {
"absolute",
"tolerance",
nullptr,
nullptr, },
39 { 1, 0, 0, 0, }, 1, },
41 {
"relative tolerance",
42 {
"relative",
"tolerance",
nullptr,
nullptr, },
43 { 1, 0, 0, 0, }, 1, },
45 {
"integration method",
46 {
"integration",
"method",
nullptr,
nullptr, },
47 { 3, 0, 0, 0, }, 1, },
49 {
"initial step size",
50 {
"initial",
"step",
"size",
nullptr, },
51 { 3, 0, 0, 0, }, 1, },
54 {
"maximum",
"order",
nullptr,
nullptr, },
55 { 2, 1, 0, 0, }, 2, },
57 {
"maximum step size",
58 {
"maximum",
"step",
"size",
nullptr, },
59 { 2, 1, 0, 0, }, 2, },
61 {
"minimum step size",
62 {
"minimum",
"step",
"size",
nullptr, },
63 { 2, 0, 0, 0, }, 1, },
66 {
"step",
"limit",
nullptr,
nullptr, },
67 { 1, 0, 0, 0, }, 1, },
73 std::ostringstream buf;
76 <<
"Options for LSODE include:\n\n"
78 <<
" ------- -----\n";
91 if (val.
numel () == 1)
111 double val =
lsode_opts.relative_tolerance ();
123 os <<
lsode_opts.integration_method () <<
"\n";
195 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
202 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
209 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
216 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
223 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
230 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
237 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
244 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
252 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
264 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
268 if (val.
numel () == 1)
278 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
280 double val =
lsode_opts.relative_tolerance ();
285 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
290 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
297 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
301 retval =
static_cast<double> (val);
304 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
311 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
318 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
322 retval =
static_cast<double> (val);
326 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
332 DEFUN (lsode_options, args, ,
406 int nargin = args.length ();
417 std::string keyword = args(0).xstring_value (
"lsode_options: expecting keyword as first argument");
static LSODE_options lsode_opts
static LSODE_options_struct LSODE_options_table[]
static octave_value_list show_LSODE_options(const std::string &keyword)
static void print_LSODE_options(std::ostream &os)
static void set_LSODE_options(const std::string &keyword, const octave_value &val)
octave_idx_type numel(void) const
Number of elements in the array.
int int_value(bool req_int=false, bool frc_str_conv=false) const
std::string string_value(bool force=false) const
Array< double > vector_value(bool frc_str_conv=false, bool frc_vec_conv=false) const
double double_value(bool frc_str_conv=false) const
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)
octave_value::octave_value(const Array< char > &chm, char type) return retval
void octave_print_internal(std::ostream &os, const float_display_format &fmt, bool d, bool pr_as_read_syntax)