GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DASPK-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from numeric/DASPK-opts.in.
3 
4 #if !defined (octave_DASPK_options_h)
5 #define octave_DASPK_options_h 1
6 
7 #include <cfloat>
8 #include <cmath>
9 
10 #include <DAE.h>
11 
12 
13 class
15 {
16 public:
17 
19  : x_absolute_tolerance (),
20  x_relative_tolerance (),
21  x_compute_consistent_initial_condition (),
22  x_use_initial_condition_heuristics (),
23  x_initial_condition_heuristics (),
24  x_print_initial_condition_info (),
25  x_exclude_algebraic_variables_from_error_test (),
26  x_algebraic_variables (),
27  x_enforce_inequality_constraints (),
28  x_inequality_constraint_types (),
29  x_initial_step_size (),
30  x_maximum_order (),
31  x_maximum_step_size (),
32  reset ()
33  {
34  init ();
35  }
36 
38  : x_absolute_tolerance (opt.x_absolute_tolerance),
39  x_relative_tolerance (opt.x_relative_tolerance),
40  x_compute_consistent_initial_condition (opt.x_compute_consistent_initial_condition),
41  x_use_initial_condition_heuristics (opt.x_use_initial_condition_heuristics),
42  x_initial_condition_heuristics (opt.x_initial_condition_heuristics),
43  x_print_initial_condition_info (opt.x_print_initial_condition_info),
44  x_exclude_algebraic_variables_from_error_test (opt.x_exclude_algebraic_variables_from_error_test),
45  x_algebraic_variables (opt.x_algebraic_variables),
46  x_enforce_inequality_constraints (opt.x_enforce_inequality_constraints),
47  x_inequality_constraint_types (opt.x_inequality_constraint_types),
48  x_initial_step_size (opt.x_initial_step_size),
49  x_maximum_order (opt.x_maximum_order),
50  x_maximum_step_size (opt.x_maximum_step_size),
51  reset (opt.reset)
52  { }
53 
55  {
56  if (this != &opt)
57  {
58  x_absolute_tolerance = opt.x_absolute_tolerance;
59  x_relative_tolerance = opt.x_relative_tolerance;
60  x_compute_consistent_initial_condition = opt.x_compute_consistent_initial_condition;
61  x_use_initial_condition_heuristics = opt.x_use_initial_condition_heuristics;
62  x_initial_condition_heuristics = opt.x_initial_condition_heuristics;
63  x_print_initial_condition_info = opt.x_print_initial_condition_info;
64  x_exclude_algebraic_variables_from_error_test = opt.x_exclude_algebraic_variables_from_error_test;
65  x_algebraic_variables = opt.x_algebraic_variables;
66  x_enforce_inequality_constraints = opt.x_enforce_inequality_constraints;
67  x_inequality_constraint_types = opt.x_inequality_constraint_types;
68  x_initial_step_size = opt.x_initial_step_size;
69  x_maximum_order = opt.x_maximum_order;
70  x_maximum_step_size = opt.x_maximum_step_size;
71  reset = opt.reset;
72  }
73 
74  return *this;
75  }
76 
77  ~DASPK_options (void) { }
78 
79  void init (void)
80  {
81  x_absolute_tolerance.resize (dim_vector (1, 1));
82  x_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
83  x_relative_tolerance.resize (dim_vector (1, 1));
84  x_relative_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
85  x_initial_condition_heuristics.resize (dim_vector (6, 1));
86  x_initial_condition_heuristics(0) = 5.0;
87  x_initial_condition_heuristics(1) = 6.0;
88  x_initial_condition_heuristics(2) = 5.0;
89  x_initial_condition_heuristics(3) = 0.0;
90  x_initial_condition_heuristics(4) = ::pow (std::numeric_limits<double>::epsilon (), 2.0/3.0);
91  x_initial_condition_heuristics(5) = 0.01;
92  x_algebraic_variables.resize (dim_vector (1, 1));
93  x_algebraic_variables(0) = 0;
94  x_inequality_constraint_types.resize (dim_vector (1, 1));
95  x_inequality_constraint_types(0) = 0;
96  x_initial_step_size = -1.0;
97  x_maximum_order = 5;
98  x_maximum_step_size = -1.0;
99  reset = true;
100  }
101 
102  void set_options (const DASPK_options& opt)
103  {
104  x_absolute_tolerance = opt.x_absolute_tolerance;
105  x_relative_tolerance = opt.x_relative_tolerance;
106  x_compute_consistent_initial_condition = opt.x_compute_consistent_initial_condition;
107  x_use_initial_condition_heuristics = opt.x_use_initial_condition_heuristics;
108  x_initial_condition_heuristics = opt.x_initial_condition_heuristics;
109  x_print_initial_condition_info = opt.x_print_initial_condition_info;
110  x_exclude_algebraic_variables_from_error_test = opt.x_exclude_algebraic_variables_from_error_test;
111  x_algebraic_variables = opt.x_algebraic_variables;
112  x_enforce_inequality_constraints = opt.x_enforce_inequality_constraints;
113  x_inequality_constraint_types = opt.x_inequality_constraint_types;
114  x_initial_step_size = opt.x_initial_step_size;
115  x_maximum_order = opt.x_maximum_order;
116  x_maximum_step_size = opt.x_maximum_step_size;
117  reset = opt.reset;
118  }
119 
120  void set_default_options (void) { init (); }
121 
122  void set_absolute_tolerance (double val)
123  {
124  x_absolute_tolerance.resize (dim_vector (1, 1));
125  x_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
126  reset = true;
127  }
128 
129  void set_absolute_tolerance (const Array<double>& val)
130  { x_absolute_tolerance = val; reset = true; }
131 
132  void set_relative_tolerance (double val)
133  {
134  x_relative_tolerance.resize (dim_vector (1, 1));
135  x_relative_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
136  reset = true;
137  }
138 
139  void set_relative_tolerance (const Array<double>& val)
140  { x_relative_tolerance = val; reset = true; }
141 
142  void set_compute_consistent_initial_condition (octave_idx_type val)
143  { x_compute_consistent_initial_condition = val; reset = true; }
144 
145  void set_use_initial_condition_heuristics (octave_idx_type val)
146  { x_use_initial_condition_heuristics = val; reset = true; }
147 
148  void set_initial_condition_heuristics (const Array<double>& val)
149  { x_initial_condition_heuristics = val; reset = true; }
150 
151  void set_print_initial_condition_info (octave_idx_type val)
152  { x_print_initial_condition_info = val; reset = true; }
153 
154  void set_exclude_algebraic_variables_from_error_test (octave_idx_type val)
155  { x_exclude_algebraic_variables_from_error_test = val; reset = true; }
156 
157  void set_algebraic_variables (int val)
158  {
159  x_algebraic_variables.resize (dim_vector (1, 1));
160  x_algebraic_variables(0) = val;
161  reset = true;
162  }
163 
164  void set_algebraic_variables (const Array<octave_idx_type>& val)
165  { x_algebraic_variables = val; reset = true; }
166 
167  void set_enforce_inequality_constraints (octave_idx_type val)
168  { x_enforce_inequality_constraints = val; reset = true; }
169 
170  void set_inequality_constraint_types (octave_idx_type val)
171  {
172  x_inequality_constraint_types.resize (dim_vector (1, 1));
173  x_inequality_constraint_types(0) = val;
174  reset = true;
175  }
176 
177  void set_inequality_constraint_types (const Array<octave_idx_type>& val)
178  { x_inequality_constraint_types = val; reset = true; }
179 
180  void set_initial_step_size (double val)
181  { x_initial_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
182 
183  void set_maximum_order (octave_idx_type val)
184  { x_maximum_order = val; reset = true; }
185 
186  void set_maximum_step_size (double val)
187  { x_maximum_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
188  Array<double> absolute_tolerance (void) const
189  { return x_absolute_tolerance; }
190 
191  Array<double> relative_tolerance (void) const
192  { return x_relative_tolerance; }
193 
194  octave_idx_type compute_consistent_initial_condition (void) const
195  { return x_compute_consistent_initial_condition; }
196 
197  octave_idx_type use_initial_condition_heuristics (void) const
198  { return x_use_initial_condition_heuristics; }
199 
200  Array<double> initial_condition_heuristics (void) const
201  { return x_initial_condition_heuristics; }
202 
203  octave_idx_type print_initial_condition_info (void) const
204  { return x_print_initial_condition_info; }
205 
206  octave_idx_type exclude_algebraic_variables_from_error_test (void) const
207  { return x_exclude_algebraic_variables_from_error_test; }
208 
209  Array<octave_idx_type> algebraic_variables (void) const
210  { return x_algebraic_variables; }
211 
212  octave_idx_type enforce_inequality_constraints (void) const
213  { return x_enforce_inequality_constraints; }
214 
215  Array<octave_idx_type> inequality_constraint_types (void) const
216  { return x_inequality_constraint_types; }
217 
218  double initial_step_size (void) const
219  { return x_initial_step_size; }
220 
221  octave_idx_type maximum_order (void) const
222  { return x_maximum_order; }
223 
224  double maximum_step_size (void) const
225  { return x_maximum_step_size; }
226 
227 private:
228 
242 
243 protected:
244 
245  bool reset;
246 };
247 
248 #endif