4 #if ! defined (octave_LSODE_options_h)
5 #define octave_LSODE_options_h 1
20 : m_absolute_tolerance (),
21 m_relative_tolerance (),
22 m_integration_method (),
23 m_initial_step_size (),
25 m_maximum_step_size (),
26 m_minimum_step_size (),
29 m_lower_jacobian_subdiagonals (),
30 m_upper_jacobian_subdiagonals (),
37 : m_absolute_tolerance (opt.m_absolute_tolerance),
38 m_relative_tolerance (opt.m_relative_tolerance),
39 m_integration_method (opt.m_integration_method),
40 m_initial_step_size (opt.m_initial_step_size),
41 m_maximum_order (opt.m_maximum_order),
42 m_maximum_step_size (opt.m_maximum_step_size),
43 m_minimum_step_size (opt.m_minimum_step_size),
44 m_step_limit (opt.m_step_limit),
45 m_jacobian_type (opt.m_jacobian_type),
46 m_lower_jacobian_subdiagonals (opt.m_lower_jacobian_subdiagonals),
47 m_upper_jacobian_subdiagonals (opt.m_upper_jacobian_subdiagonals),
55 m_absolute_tolerance = opt.m_absolute_tolerance;
56 m_relative_tolerance = opt.m_relative_tolerance;
57 m_integration_method = opt.m_integration_method;
58 m_initial_step_size = opt.m_initial_step_size;
59 m_maximum_order = opt.m_maximum_order;
60 m_maximum_step_size = opt.m_maximum_step_size;
61 m_minimum_step_size = opt.m_minimum_step_size;
62 m_step_limit = opt.m_step_limit;
63 m_jacobian_type = opt.m_jacobian_type;
64 m_lower_jacobian_subdiagonals = opt.m_lower_jacobian_subdiagonals;
65 m_upper_jacobian_subdiagonals = opt.m_upper_jacobian_subdiagonals;
76 m_absolute_tolerance.resize (
dim_vector (1, 1));
77 m_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
78 m_relative_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
79 m_integration_method =
"stiff";
80 m_initial_step_size = -1.0;
82 m_maximum_step_size = -1.0;
83 m_minimum_step_size = 0.0;
84 m_step_limit = 100000;
85 m_jacobian_type =
"full";
86 m_lower_jacobian_subdiagonals = 0;
87 m_upper_jacobian_subdiagonals = 0;
93 m_absolute_tolerance = opt.m_absolute_tolerance;
94 m_relative_tolerance = opt.m_relative_tolerance;
95 m_integration_method = opt.m_integration_method;
96 m_initial_step_size = opt.m_initial_step_size;
97 m_maximum_order = opt.m_maximum_order;
98 m_maximum_step_size = opt.m_maximum_step_size;
99 m_minimum_step_size = opt.m_minimum_step_size;
100 m_step_limit = opt.m_step_limit;
101 m_jacobian_type = opt.m_jacobian_type;
102 m_lower_jacobian_subdiagonals = opt.m_lower_jacobian_subdiagonals;
103 m_upper_jacobian_subdiagonals = opt.m_upper_jacobian_subdiagonals;
111 m_absolute_tolerance.resize (
dim_vector (1, 1));
112 m_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
117 { m_absolute_tolerance = val; m_reset =
true; }
120 { m_relative_tolerance = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ()); m_reset =
true; }
124 if (val ==
"stiff" || val ==
"bdf")
125 m_integration_method =
"stiff";
126 else if (val ==
"non-stiff" || val ==
"adams")
127 m_integration_method =
"non-stiff";
130 (
"lsode_options: method must be \"stiff\", \"bdf\", \"non-stiff\", or \"adams\"");
135 { m_initial_step_size = (val >= 0.0) ? val : -1.0; m_reset =
true; }
138 { m_maximum_order = val; m_reset =
true; }
141 { m_maximum_step_size = (val >= 0.0) ? val : -1.0; m_reset =
true; }
144 { m_minimum_step_size = (val >= 0.0) ? val : 0.0; m_reset =
true; }
147 { m_step_limit = val; m_reset =
true; }
151 if (val ==
"full" || val ==
"banded" || val ==
"diagonal")
152 m_jacobian_type = val;
155 (
"lsode_options: jacobian type must be \"full\", \"banded\", or \"diagonal\"");
160 { m_lower_jacobian_subdiagonals = val; m_reset =
true; }
163 { m_upper_jacobian_subdiagonals = val; m_reset =
true; }
165 {
return m_absolute_tolerance; }
168 {
return m_relative_tolerance; }
171 {
return m_integration_method; }
174 {
return m_initial_step_size; }
177 {
return m_maximum_order; }
180 {
return m_maximum_step_size; }
183 {
return m_minimum_step_size; }
186 {
return m_step_limit; }
189 {
return m_jacobian_type; }
192 {
return m_lower_jacobian_subdiagonals; }
195 {
return m_upper_jacobian_subdiagonals; }
200 double m_relative_tolerance;
201 std::string m_integration_method;
202 double m_initial_step_size;
204 double m_maximum_step_size;
205 double m_minimum_step_size;
207 std::string m_jacobian_type;
void set_absolute_tolerance(double val)
std::string jacobian_type() const
void set_integration_method(const std::string &val)
double minimum_step_size() const
octave_idx_type lower_jacobian_subdiagonals() const
void set_absolute_tolerance(const Array< double > &val)
void set_jacobian_type(const std::string &val)
void set_upper_jacobian_subdiagonals(octave_idx_type val)
void set_lower_jacobian_subdiagonals(octave_idx_type val)
void set_default_options()
void set_minimum_step_size(double val)
std::string integration_method() const
void set_initial_step_size(double val)
octave_idx_type step_limit() const
octave_idx_type maximum_order() const
octave_idx_type upper_jacobian_subdiagonals() const
double relative_tolerance() const
LSODE_options(const LSODE_options &opt)
void set_step_limit(octave_idx_type val)
double maximum_step_size() const
double initial_step_size() const
void set_relative_tolerance(double val)
Array< double > absolute_tolerance() const
void set_maximum_order(octave_idx_type val)
void set_options(const LSODE_options &opt)
void set_maximum_step_size(double val)
Vector representing the dimensions (size) of an Array.
OCTAVE_NORETURN liboctave_error_handler current_liboctave_error_handler