GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
DASRT-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from liboctave/numeric/DASRT-opts.in.
3 
4 #if ! defined (octave_DASRT_options_h)
5 #define octave_DASRT_options_h 1
6 
7 #include <cmath>
8 
9 #include <limits>
10 
11 #include "DAERT.h"
12 
13 
14 class
16 {
17 public:
18 
20  : m_absolute_tolerance (),
21  m_relative_tolerance (),
22  m_initial_step_size (),
23  m_maximum_order (),
24  m_maximum_step_size (),
25  m_step_limit (),
26  m_reset ()
27  {
28  init ();
29  }
30 
32  : m_absolute_tolerance (opt.m_absolute_tolerance),
33  m_relative_tolerance (opt.m_relative_tolerance),
34  m_initial_step_size (opt.m_initial_step_size),
35  m_maximum_order (opt.m_maximum_order),
36  m_maximum_step_size (opt.m_maximum_step_size),
37  m_step_limit (opt.m_step_limit),
38  m_reset (opt.m_reset)
39  { }
40 
41  DASRT_options& operator = (const DASRT_options& opt)
42  {
43  if (this != &opt)
44  {
45  m_absolute_tolerance = opt.m_absolute_tolerance;
46  m_relative_tolerance = opt.m_relative_tolerance;
47  m_initial_step_size = opt.m_initial_step_size;
48  m_maximum_order = opt.m_maximum_order;
49  m_maximum_step_size = opt.m_maximum_step_size;
50  m_step_limit = opt.m_step_limit;
51  m_reset = opt.m_reset;
52  }
53 
54  return *this;
55  }
56 
58 
59  void init ()
60  {
61  m_absolute_tolerance.resize (dim_vector (1, 1));
62  m_absolute_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
63  m_relative_tolerance.resize (dim_vector (1, 1));
64  m_relative_tolerance(0) = ::sqrt (std::numeric_limits<double>::epsilon ());
65  m_initial_step_size = -1.0;
66  m_maximum_order = -1;
67  m_maximum_step_size = -1.0;
68  m_step_limit = -1;
69  m_reset = true;
70  }
71 
72  void set_options (const DASRT_options& opt)
73  {
74  m_absolute_tolerance = opt.m_absolute_tolerance;
75  m_relative_tolerance = opt.m_relative_tolerance;
76  m_initial_step_size = opt.m_initial_step_size;
77  m_maximum_order = opt.m_maximum_order;
78  m_maximum_step_size = opt.m_maximum_step_size;
79  m_step_limit = opt.m_step_limit;
80  m_reset = opt.m_reset;
81  }
82 
83  void set_default_options () { init (); }
84 
85  void set_absolute_tolerance (double val)
86  {
87  m_absolute_tolerance.resize (dim_vector (1, 1));
88  m_absolute_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
89  m_reset = true;
90  }
91 
93  { m_absolute_tolerance = val; m_reset = true; }
94 
95  void set_relative_tolerance (double val)
96  {
97  m_relative_tolerance.resize (dim_vector (1, 1));
98  m_relative_tolerance(0) = (val > 0.0) ? val : ::sqrt (std::numeric_limits<double>::epsilon ());
99  m_reset = true;
100  }
101 
103  { m_relative_tolerance = val; m_reset = true; }
104 
105  void set_initial_step_size (double val)
106  { m_initial_step_size = (val >= 0.0) ? val : -1.0; m_reset = true; }
107 
109  { m_maximum_order = val; m_reset = true; }
110 
111  void set_maximum_step_size (double val)
112  { m_maximum_step_size = (val >= 0.0) ? val : -1.0; m_reset = true; }
113 
115  { m_step_limit = (val >= 0) ? val : -1; m_reset = true; }
117  { return m_absolute_tolerance; }
118 
120  { return m_relative_tolerance; }
121 
122  double initial_step_size () const
123  { return m_initial_step_size; }
124 
126  { return m_maximum_order; }
127 
128  double maximum_step_size () const
129  { return m_maximum_step_size; }
130 
132  { return m_step_limit; }
133 
134 private:
135 
136  Array<double> m_absolute_tolerance;
137  Array<double> m_relative_tolerance;
138  double m_initial_step_size;
139  octave_idx_type m_maximum_order;
140  double m_maximum_step_size;
141  octave_idx_type m_step_limit;
142 
143 protected:
144 
145  bool m_reset;
146 };
147 
148 #endif
void set_maximum_step_size(double val)
Definition: DASRT-opts.h:111
void set_maximum_order(octave_idx_type val)
Definition: DASRT-opts.h:108
void set_default_options()
Definition: DASRT-opts.h:83
void set_relative_tolerance(const Array< double > &val)
Definition: DASRT-opts.h:102
octave_idx_type maximum_order() const
Definition: DASRT-opts.h:125
void set_relative_tolerance(double val)
Definition: DASRT-opts.h:95
octave_idx_type step_limit() const
Definition: DASRT-opts.h:131
void set_step_limit(octave_idx_type val)
Definition: DASRT-opts.h:114
void init()
Definition: DASRT-opts.h:59
void set_options(const DASRT_options &opt)
Definition: DASRT-opts.h:72
void set_absolute_tolerance(const Array< double > &val)
Definition: DASRT-opts.h:92
void set_initial_step_size(double val)
Definition: DASRT-opts.h:105
Array< double > relative_tolerance() const
Definition: DASRT-opts.h:119
DASRT_options(const DASRT_options &opt)
Definition: DASRT-opts.h:31
double initial_step_size() const
Definition: DASRT-opts.h:122
void set_absolute_tolerance(double val)
Definition: DASRT-opts.h:85
Array< double > absolute_tolerance() const
Definition: DASRT-opts.h:116
double maximum_step_size() const
Definition: DASRT-opts.h:128
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:94