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
DASSL-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from numeric/DASSL-opts.in.
3 
4 #if !defined (octave_DASSL_options_h)
5 #define octave_DASSL_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_enforce_nonnegativity_constraints (),
23  x_initial_step_size (),
24  x_maximum_order (),
25  x_maximum_step_size (),
26  x_step_limit (),
27  reset ()
28  {
29  init ();
30  }
31 
33  : x_absolute_tolerance (opt.x_absolute_tolerance),
34  x_relative_tolerance (opt.x_relative_tolerance),
35  x_compute_consistent_initial_condition (opt.x_compute_consistent_initial_condition),
36  x_enforce_nonnegativity_constraints (opt.x_enforce_nonnegativity_constraints),
37  x_initial_step_size (opt.x_initial_step_size),
38  x_maximum_order (opt.x_maximum_order),
39  x_maximum_step_size (opt.x_maximum_step_size),
40  x_step_limit (opt.x_step_limit),
41  reset (opt.reset)
42  { }
43 
45  {
46  if (this != &opt)
47  {
48  x_absolute_tolerance = opt.x_absolute_tolerance;
49  x_relative_tolerance = opt.x_relative_tolerance;
50  x_compute_consistent_initial_condition = opt.x_compute_consistent_initial_condition;
51  x_enforce_nonnegativity_constraints = opt.x_enforce_nonnegativity_constraints;
52  x_initial_step_size = opt.x_initial_step_size;
53  x_maximum_order = opt.x_maximum_order;
54  x_maximum_step_size = opt.x_maximum_step_size;
55  x_step_limit = opt.x_step_limit;
56  reset = opt.reset;
57  }
58 
59  return *this;
60  }
61 
62  ~DASSL_options (void) { }
63 
64  void init (void)
65  {
66  x_absolute_tolerance.resize (dim_vector (1, 1));
67  x_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
68  x_relative_tolerance.resize (dim_vector (1, 1));
69  x_relative_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
70  x_initial_step_size = -1.0;
71  x_maximum_order = -1;
72  x_maximum_step_size = -1.0;
73  x_step_limit = -1;
74  reset = true;
75  }
76 
77  void set_options (const DASSL_options& opt)
78  {
79  x_absolute_tolerance = opt.x_absolute_tolerance;
80  x_relative_tolerance = opt.x_relative_tolerance;
81  x_compute_consistent_initial_condition = opt.x_compute_consistent_initial_condition;
82  x_enforce_nonnegativity_constraints = opt.x_enforce_nonnegativity_constraints;
83  x_initial_step_size = opt.x_initial_step_size;
84  x_maximum_order = opt.x_maximum_order;
85  x_maximum_step_size = opt.x_maximum_step_size;
86  x_step_limit = opt.x_step_limit;
87  reset = opt.reset;
88  }
89 
90  void set_default_options (void) { init (); }
91 
92  void set_absolute_tolerance (double val)
93  {
94  x_absolute_tolerance.resize (dim_vector (1, 1));
95  x_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
96  reset = true;
97  }
98 
99  void set_absolute_tolerance (const Array<double>& val)
100  { x_absolute_tolerance = val; reset = true; }
101 
102  void set_relative_tolerance (double val)
103  {
104  x_relative_tolerance.resize (dim_vector (1, 1));
105  x_relative_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
106  reset = true;
107  }
108 
109  void set_relative_tolerance (const Array<double>& val)
110  { x_relative_tolerance = val; reset = true; }
111 
112  void set_compute_consistent_initial_condition (octave_idx_type val)
113  { x_compute_consistent_initial_condition = val; reset = true; }
114 
115  void set_enforce_nonnegativity_constraints (octave_idx_type val)
116  { x_enforce_nonnegativity_constraints = val; reset = true; }
117 
118  void set_initial_step_size (double val)
119  { x_initial_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
120 
121  void set_maximum_order (octave_idx_type val)
122  { x_maximum_order = val; reset = true; }
123 
124  void set_maximum_step_size (double val)
125  { x_maximum_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
126 
127  void set_step_limit (octave_idx_type val)
128  { x_step_limit = (val >= 0) ? val : -1; reset = true; }
129  Array<double> absolute_tolerance (void) const
130  { return x_absolute_tolerance; }
131 
132  Array<double> relative_tolerance (void) const
133  { return x_relative_tolerance; }
134 
135  octave_idx_type compute_consistent_initial_condition (void) const
136  { return x_compute_consistent_initial_condition; }
137 
138  octave_idx_type enforce_nonnegativity_constraints (void) const
139  { return x_enforce_nonnegativity_constraints; }
140 
141  double initial_step_size (void) const
142  { return x_initial_step_size; }
143 
144  octave_idx_type maximum_order (void) const
145  { return x_maximum_order; }
146 
147  double maximum_step_size (void) const
148  { return x_maximum_step_size; }
149 
150  octave_idx_type step_limit (void) const
151  { return x_step_limit; }
152 
153 private:
154 
163 
164 protected:
165 
166  bool reset;
167 };
168 
169 #endif