4 #if !defined (octave_LSODE_options_h)
5 #define octave_LSODE_options_h 1
19 : x_absolute_tolerance (),
20 x_relative_tolerance (),
21 x_integration_method (),
22 x_initial_step_size (),
24 x_maximum_step_size (),
25 x_minimum_step_size (),
33 : x_absolute_tolerance (opt.x_absolute_tolerance),
34 x_relative_tolerance (opt.x_relative_tolerance),
35 x_integration_method (opt.x_integration_method),
36 x_initial_step_size (opt.x_initial_step_size),
37 x_maximum_order (opt.x_maximum_order),
38 x_maximum_step_size (opt.x_maximum_step_size),
39 x_minimum_step_size (opt.x_minimum_step_size),
40 x_step_limit (opt.x_step_limit),
66 x_absolute_tolerance.resize (
dim_vector (1, 1));
67 x_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
68 x_relative_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
69 x_integration_method =
"stiff";
70 x_initial_step_size = -1.0;
72 x_maximum_step_size = -1.0;
73 x_minimum_step_size = 0.0;
74 x_step_limit = 100000;
93 void set_absolute_tolerance (
double val)
95 x_absolute_tolerance.resize (
dim_vector (1, 1));
96 x_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
101 { x_absolute_tolerance = val; reset =
true; }
103 void set_relative_tolerance (
double val)
104 { x_relative_tolerance = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ()); reset =
true; }
106 void set_integration_method (
const std::string& val)
108 if (val ==
"stiff" || val ==
"bdf")
109 x_integration_method =
"stiff";
110 else if (val ==
"non-stiff" || val ==
"adams")
111 x_integration_method =
"non-stiff";
114 (
"lsode_options: method must be \"stiff\", \"bdf\", \"non-stiff\", or \"adams\"");
118 void set_initial_step_size (
double val)
119 { x_initial_step_size = (val >= 0.0) ? val : -1.0; reset =
true; }
122 { x_maximum_order = val; reset =
true; }
124 void set_maximum_step_size (
double val)
125 { x_maximum_step_size = (val >= 0.0) ? val : -1.0; reset =
true; }
127 void set_minimum_step_size (
double val)
128 { x_minimum_step_size = (val >= 0.0) ? val : 0.0; reset =
true; }
131 { x_step_limit = val; reset =
true; }
133 {
return x_absolute_tolerance; }
135 double relative_tolerance (
void)
const
136 {
return x_relative_tolerance; }
138 std::string integration_method (
void)
const
139 {
return x_integration_method; }
141 double initial_step_size (
void)
const
142 {
return x_initial_step_size; }
145 {
return x_maximum_order; }
147 double maximum_step_size (
void)
const
148 {
return x_maximum_step_size; }
150 double minimum_step_size (
void)
const
151 {
return x_minimum_step_size; }
154 {
return x_step_limit; }