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
DASRT-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from numeric/DASRT-opts.in.
3 
4 #if !defined (octave_DASRT_options_h)
5 #define octave_DASRT_options_h 1
6 
7 #include <cfloat>
8 #include <cmath>
9 
10 #include <DAERT.h>
11 
12 
13 class
15 {
16 public:
17 
19  : x_absolute_tolerance (),
20  x_relative_tolerance (),
21  x_initial_step_size (),
22  x_maximum_order (),
23  x_maximum_step_size (),
24  x_step_limit (),
25  reset ()
26  {
27  init ();
28  }
29 
31  : x_absolute_tolerance (opt.x_absolute_tolerance),
32  x_relative_tolerance (opt.x_relative_tolerance),
33  x_initial_step_size (opt.x_initial_step_size),
34  x_maximum_order (opt.x_maximum_order),
35  x_maximum_step_size (opt.x_maximum_step_size),
36  x_step_limit (opt.x_step_limit),
37  reset (opt.reset)
38  { }
39 
41  {
42  if (this != &opt)
43  {
44  x_absolute_tolerance = opt.x_absolute_tolerance;
45  x_relative_tolerance = opt.x_relative_tolerance;
46  x_initial_step_size = opt.x_initial_step_size;
47  x_maximum_order = opt.x_maximum_order;
48  x_maximum_step_size = opt.x_maximum_step_size;
49  x_step_limit = opt.x_step_limit;
50  reset = opt.reset;
51  }
52 
53  return *this;
54  }
55 
56  ~DASRT_options (void) { }
57 
58  void init (void)
59  {
60  x_absolute_tolerance.resize (dim_vector (1, 1));
61  x_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
62  x_relative_tolerance.resize (dim_vector (1, 1));
63  x_relative_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
64  x_initial_step_size = -1.0;
65  x_maximum_order = -1;
66  x_maximum_step_size = -1.0;
67  x_step_limit = -1;
68  reset = true;
69  }
70 
71  void set_options (const DASRT_options& opt)
72  {
73  x_absolute_tolerance = opt.x_absolute_tolerance;
74  x_relative_tolerance = opt.x_relative_tolerance;
75  x_initial_step_size = opt.x_initial_step_size;
76  x_maximum_order = opt.x_maximum_order;
77  x_maximum_step_size = opt.x_maximum_step_size;
78  x_step_limit = opt.x_step_limit;
79  reset = opt.reset;
80  }
81 
82  void set_default_options (void) { init (); }
83 
84  void set_absolute_tolerance (double val)
85  {
86  x_absolute_tolerance.resize (dim_vector (1, 1));
87  x_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
88  reset = true;
89  }
90 
91  void set_absolute_tolerance (const Array<double>& val)
92  { x_absolute_tolerance = val; reset = true; }
93 
94  void set_relative_tolerance (double val)
95  {
96  x_relative_tolerance.resize (dim_vector (1, 1));
97  x_relative_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
98  reset = true;
99  }
100 
101  void set_relative_tolerance (const Array<double>& val)
102  { x_relative_tolerance = val; reset = true; }
103 
104  void set_initial_step_size (double val)
105  { x_initial_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
106 
107  void set_maximum_order (octave_idx_type val)
108  { x_maximum_order = val; reset = true; }
109 
110  void set_maximum_step_size (double val)
111  { x_maximum_step_size = (val >= 0.0) ? val : -1.0; reset = true; }
112 
113  void set_step_limit (octave_idx_type val)
114  { x_step_limit = (val >= 0) ? val : -1; reset = true; }
115  Array<double> absolute_tolerance (void) const
116  { return x_absolute_tolerance; }
117 
118  Array<double> relative_tolerance (void) const
119  { return x_relative_tolerance; }
120 
121  double initial_step_size (void) const
122  { return x_initial_step_size; }
123 
124  octave_idx_type maximum_order (void) const
125  { return x_maximum_order; }
126 
127  double maximum_step_size (void) const
128  { return x_maximum_step_size; }
129 
130  octave_idx_type step_limit (void) const
131  { return x_step_limit; }
132 
133 private:
134 
141 
142 protected:
143 
144  bool reset;
145 };
146 
147 #endif