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