12 #include "LSODE-opts.h"
33 #define NUM_OPTIONS 11
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, },
70 {
"jacobian",
"type",
nullptr,
nullptr, },
71 { 1, 0, 0, 0, }, 1, },
73 {
"lower jacobian subdiagonals",
74 {
"lower",
"jacobian",
"subdiagonals",
nullptr, },
75 { 1, 0, 0, 0, }, 1, },
77 {
"upper jacobian subdiagonals",
78 {
"upper",
"jacobian",
"subdiagonals",
nullptr, },
79 { 1, 0, 0, 0, }, 1, },
85 std::ostringstream buf;
88 <<
"Options for LSODE include:\n\n"
90 <<
" ------- -----\n";
103 if (val.
numel () == 1)
105 os << val(0) <<
"\n";
123 double val =
lsode_opts.relative_tolerance ();
135 os <<
lsode_opts.integration_method () <<
"\n";
215 int val =
lsode_opts.lower_jacobian_subdiagonals ();
227 int val =
lsode_opts.upper_jacobian_subdiagonals ();
241 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
248 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
255 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
262 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
269 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
276 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
283 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
290 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
297 keyword, list[8].min_toks_to_match,
MAX_TOKENS))
304 keyword, list[9].min_toks_to_match,
MAX_TOKENS))
308 lsode_opts.set_lower_jacobian_subdiagonals (tmp);
311 keyword, list[10].min_toks_to_match,
MAX_TOKENS))
315 lsode_opts.set_upper_jacobian_subdiagonals (tmp);
319 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
331 keyword, list[0].min_toks_to_match,
MAX_TOKENS))
335 if (val.
numel () == 1)
345 keyword, list[1].min_toks_to_match,
MAX_TOKENS))
347 double val =
lsode_opts.relative_tolerance ();
352 keyword, list[2].min_toks_to_match,
MAX_TOKENS))
357 keyword, list[3].min_toks_to_match,
MAX_TOKENS))
364 keyword, list[4].min_toks_to_match,
MAX_TOKENS))
368 retval =
static_cast<double> (val);
371 keyword, list[5].min_toks_to_match,
MAX_TOKENS))
378 keyword, list[6].min_toks_to_match,
MAX_TOKENS))
385 keyword, list[7].min_toks_to_match,
MAX_TOKENS))
389 retval =
static_cast<double> (val);
392 keyword, list[8].min_toks_to_match,
MAX_TOKENS))
397 keyword, list[9].min_toks_to_match,
MAX_TOKENS))
399 int val =
lsode_opts.lower_jacobian_subdiagonals ();
401 retval =
static_cast<double> (val);
404 keyword, list[10].min_toks_to_match,
MAX_TOKENS))
406 int val =
lsode_opts.upper_jacobian_subdiagonals ();
408 retval =
static_cast<double> (val);
412 warning (
"lsode_options: no match for `%s'", keyword.c_str ());
420 DEFUN (lsode_options, args, ,
528 int nargin = args.
length ();
539 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)
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
std::string string_value(bool force=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)