GNU Octave  9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Quad-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from liboctave/numeric/Quad-opts.in.
3 
4 #if ! defined (octave_Quad_options_h)
5 #define octave_Quad_options_h 1
6 
7 #include <cmath>
8 
9 #include <limits>
10 
11 
12 
13 class
15 {
16 public:
17 
19  : m_absolute_tolerance (),
20  m_relative_tolerance (),
21  m_single_precision_absolute_tolerance (),
22  m_single_precision_relative_tolerance (),
23  m_reset ()
24  {
25  init ();
26  }
27 
29  : m_absolute_tolerance (opt.m_absolute_tolerance),
30  m_relative_tolerance (opt.m_relative_tolerance),
31  m_single_precision_absolute_tolerance (opt.m_single_precision_absolute_tolerance),
32  m_single_precision_relative_tolerance (opt.m_single_precision_relative_tolerance),
33  m_reset (opt.m_reset)
34  { }
35 
36  Quad_options& operator = (const Quad_options& opt)
37  {
38  if (this != &opt)
39  {
40  m_absolute_tolerance = opt.m_absolute_tolerance;
41  m_relative_tolerance = opt.m_relative_tolerance;
42  m_single_precision_absolute_tolerance = opt.m_single_precision_absolute_tolerance;
43  m_single_precision_relative_tolerance = opt.m_single_precision_relative_tolerance;
44  m_reset = opt.m_reset;
45  }
46 
47  return *this;
48  }
49 
51 
52  void init ()
53  {
54  m_absolute_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
55  m_relative_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
56  m_single_precision_absolute_tolerance = ::sqrt (std::numeric_limits<float>::epsilon ());
57  m_single_precision_relative_tolerance = ::sqrt (std::numeric_limits<float>::epsilon ());
58  m_reset = true;
59  }
60 
61  void set_options (const Quad_options& opt)
62  {
63  m_absolute_tolerance = opt.m_absolute_tolerance;
64  m_relative_tolerance = opt.m_relative_tolerance;
65  m_single_precision_absolute_tolerance = opt.m_single_precision_absolute_tolerance;
66  m_single_precision_relative_tolerance = opt.m_single_precision_relative_tolerance;
67  m_reset = opt.m_reset;
68  }
69 
70  void set_default_options () { init (); }
71 
72  void set_absolute_tolerance (double val)
73  { m_absolute_tolerance = val; m_reset = true; }
74 
75  void set_relative_tolerance (double val)
76  { m_relative_tolerance = val; m_reset = true; }
77 
79  { m_single_precision_absolute_tolerance = val; m_reset = true; }
80 
82  { m_single_precision_relative_tolerance = val; m_reset = true; }
83  double absolute_tolerance () const
84  { return m_absolute_tolerance; }
85 
86  double relative_tolerance () const
87  { return m_relative_tolerance; }
88 
90  { return m_single_precision_absolute_tolerance; }
91 
93  { return m_single_precision_relative_tolerance; }
94 
95 private:
96 
97  double m_absolute_tolerance;
98  double m_relative_tolerance;
99  float m_single_precision_absolute_tolerance;
100  float m_single_precision_relative_tolerance;
101 
102 protected:
103 
104  bool m_reset;
105 };
106 
107 #endif
void set_single_precision_relative_tolerance(float val)
Definition: Quad-opts.h:81
float single_precision_relative_tolerance() const
Definition: Quad-opts.h:92
void set_default_options()
Definition: Quad-opts.h:70
void init()
Definition: Quad-opts.h:52
void set_options(const Quad_options &opt)
Definition: Quad-opts.h:61
void set_single_precision_absolute_tolerance(float val)
Definition: Quad-opts.h:78
Quad_options(const Quad_options &opt)
Definition: Quad-opts.h:28
double absolute_tolerance() const
Definition: Quad-opts.h:83
bool m_reset
Definition: Quad-opts.h:104
void set_absolute_tolerance(double val)
Definition: Quad-opts.h:72
float single_precision_absolute_tolerance() const
Definition: Quad-opts.h:89
double relative_tolerance() const
Definition: Quad-opts.h:86
void set_relative_tolerance(double val)
Definition: Quad-opts.h:75