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
Quad-opts.h
Go to the documentation of this file.
1 // DO NOT EDIT!
2 // Generated automatically from numeric/Quad-opts.in.
3 
4 #if !defined (octave_Quad_options_h)
5 #define octave_Quad_options_h 1
6 
7 #include <cfloat>
8 #include <cmath>
9 
10 
11 
12 class
14 {
15 public:
16 
17  Quad_options (void)
18  : x_absolute_tolerance (),
19  x_relative_tolerance (),
20  x_single_precision_absolute_tolerance (),
21  x_single_precision_relative_tolerance (),
22  reset ()
23  {
24  init ();
25  }
26 
28  : x_absolute_tolerance (opt.x_absolute_tolerance),
29  x_relative_tolerance (opt.x_relative_tolerance),
30  x_single_precision_absolute_tolerance (opt.x_single_precision_absolute_tolerance),
31  x_single_precision_relative_tolerance (opt.x_single_precision_relative_tolerance),
32  reset (opt.reset)
33  { }
34 
35  Quad_options& operator = (const Quad_options& opt)
36  {
37  if (this != &opt)
38  {
39  x_absolute_tolerance = opt.x_absolute_tolerance;
40  x_relative_tolerance = opt.x_relative_tolerance;
41  x_single_precision_absolute_tolerance = opt.x_single_precision_absolute_tolerance;
42  x_single_precision_relative_tolerance = opt.x_single_precision_relative_tolerance;
43  reset = opt.reset;
44  }
45 
46  return *this;
47  }
48 
49  ~Quad_options (void) { }
50 
51  void init (void)
52  {
53  x_absolute_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
54  x_relative_tolerance = ::sqrt (std::numeric_limits<double>::epsilon ());
55  x_single_precision_absolute_tolerance = ::sqrt (std::numeric_limits<float>::epsilon ());
56  x_single_precision_relative_tolerance = ::sqrt (std::numeric_limits<float>::epsilon ());
57  reset = true;
58  }
59 
60  void set_options (const Quad_options& opt)
61  {
62  x_absolute_tolerance = opt.x_absolute_tolerance;
63  x_relative_tolerance = opt.x_relative_tolerance;
64  x_single_precision_absolute_tolerance = opt.x_single_precision_absolute_tolerance;
65  x_single_precision_relative_tolerance = opt.x_single_precision_relative_tolerance;
66  reset = opt.reset;
67  }
68 
69  void set_default_options (void) { init (); }
70 
71  void set_absolute_tolerance (double val)
72  { x_absolute_tolerance = val; reset = true; }
73 
74  void set_relative_tolerance (double val)
75  { x_relative_tolerance = val; reset = true; }
76 
77  void set_single_precision_absolute_tolerance (float val)
78  { x_single_precision_absolute_tolerance = val; reset = true; }
79 
80  void set_single_precision_relative_tolerance (float val)
81  { x_single_precision_relative_tolerance = val; reset = true; }
82  double absolute_tolerance (void) const
83  { return x_absolute_tolerance; }
84 
85  double relative_tolerance (void) const
86  { return x_relative_tolerance; }
87 
88  float single_precision_absolute_tolerance (void) const
89  { return x_single_precision_absolute_tolerance; }
90 
91  float single_precision_relative_tolerance (void) const
92  { return x_single_precision_relative_tolerance; }
93 
94 private:
95 
100 
101 protected:
102 
103  bool reset;
104 };
105 
106 #endif