GNU Octave  4.0.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 
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 
110  { x_relative_tolerance = val; reset = true; }
111 
113  { x_compute_consistent_initial_condition = val; reset = true; }
114 
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 
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 
128  { x_step_limit = (val >= 0) ? val : -1; reset = true; }
130  { return x_absolute_tolerance; }
131 
133  { return x_relative_tolerance; }
134 
136  { return x_compute_consistent_initial_condition; }
137 
139  { return x_enforce_nonnegativity_constraints; }
140 
141  double initial_step_size (void) const
142  { return x_initial_step_size; }
143 
145  { return x_maximum_order; }
146 
147  double maximum_step_size (void) const
148  { return x_maximum_step_size; }
149 
151  { return x_step_limit; }
152 
153 private:
154 
163 
164 protected:
165 
166  bool reset;
167 };
168 
169 #endif
octave_idx_type x_compute_consistent_initial_condition
Definition: DASSL-opts.h:157
octave_idx_type maximum_order(void) const
Definition: DASSL-opts.h:144
void set_maximum_order(octave_idx_type val)
Definition: DASSL-opts.h:121
Array< double > absolute_tolerance(void) const
Definition: DASSL-opts.h:129
void set_step_limit(octave_idx_type val)
Definition: DASSL-opts.h:127
void set_relative_tolerance(const Array< double > &val)
Definition: DASSL-opts.h:109
void set_relative_tolerance(double val)
Definition: DASSL-opts.h:102
~DASSL_options(void)
Definition: DASSL-opts.h:62
octave_idx_type x_maximum_order
Definition: DASSL-opts.h:160
Array< double > relative_tolerance(void) const
Definition: DASSL-opts.h:132
octave_idx_type x_enforce_nonnegativity_constraints
Definition: DASSL-opts.h:158
void set_enforce_nonnegativity_constraints(octave_idx_type val)
Definition: DASSL-opts.h:115
void set_default_options(void)
Definition: DASSL-opts.h:90
octave_idx_type x_step_limit
Definition: DASSL-opts.h:162
void init(void)
Definition: DASSL-opts.h:64
octave_idx_type compute_consistent_initial_condition(void) const
Definition: DASSL-opts.h:135
void set_options(const DASSL_options &opt)
Definition: DASSL-opts.h:77
ColumnVector & operator=(const ColumnVector &a)
Definition: dColVector.h:53
DASSL_options(void)
Definition: DASSL-opts.h:18
double x_maximum_step_size
Definition: DASSL-opts.h:161
Array< double > x_absolute_tolerance
Definition: DASSL-opts.h:155
void set_absolute_tolerance(const Array< double > &val)
Definition: DASSL-opts.h:99
DASSL_options(const DASSL_options &opt)
Definition: DASSL-opts.h:32
octave_idx_type enforce_nonnegativity_constraints(void) const
Definition: DASSL-opts.h:138
void set_absolute_tolerance(double val)
Definition: DASSL-opts.h:92
octave_idx_type step_limit(void) const
Definition: DASSL-opts.h:150
double x_initial_step_size
Definition: DASSL-opts.h:159
void set_maximum_step_size(double val)
Definition: DASSL-opts.h:124
double initial_step_size(void) const
Definition: DASSL-opts.h:141
double maximum_step_size(void) const
Definition: DASSL-opts.h:147
void set_initial_step_size(double val)
Definition: DASSL-opts.h:118
void set_compute_consistent_initial_condition(octave_idx_type val)
Definition: DASSL-opts.h:112
Array< double > x_relative_tolerance
Definition: DASSL-opts.h:156