Bayeux  3.4.1
Core Foundation library for SuperNEMO
datapoint.h
Go to the documentation of this file.
1 
3 #ifndef MYGSL_DATAPOINT_H
4 #define MYGSL_DATAPOINT_H 1
5 
6 // Standard library:
7 #include <iostream>
8 #include <limits>
9 
10 // Third party :
11 // - Bayeux/deatatools:
13 
14 // This project:
15 #include <mygsl/ioutils.h>
16 
17 namespace mygsl {
18 
21  {
22 
23  public:
24 
26  datapoint();
27 
29  datapoint(double x_,
30  double y_,
31  double sigma_y_ = std::numeric_limits<double>::quiet_NaN());
32 
34  virtual ~datapoint();
35 
37  const double & x() const;
38 
40  const double & y() const;
41 
43  const double & sigma_y() const;
44 
46  bool has_sigma_y() const;
47 
49  bool is_weighted() const;
50 
51  friend std::ostream & operator<<(std::ostream &, const datapoint &);
52 
53  friend std::istream & operator>>(std::istream &, datapoint &);
54 
56  static bool comp_by_x(const datapoint & p1_,
57  const datapoint & p2_);
58 
59  private:
60 
61  double _x_;
62  double _y_;
63  double _sigma_y_;
64 
66 
67  };
68 
69 }
70 
71 #endif // MYGSL_DATAPOINT_H
72 
73 /* Local Variables: */
74 /* mode: c++ */
75 /* coding: utf-8 */
76 /* End: */
Base abstract class of all serializable (and possibly introspectable) classes.
Definition: i_serializable.h:51
bool is_weighted() const
Check if the datapoints in weighted with the error on the Y coordinate.
friend std::istream & operator>>(std::istream &, datapoint &)
virtual ~datapoint()
Destructor.
#define DATATOOLS_SERIALIZATION_DECLARATION()
Definition: i_serializable.h:266
datapoint()
Default constructor.
const double & x() const
Return the X coordinate.
bool has_sigma_y() const
Check if the error on the Y coordinate is provided.
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
const double & y() const
Return the Y coordinate.
A serializable (x,y,sigma(y)) triplet.
Definition: datapoint.h:20
static bool comp_by_x(const datapoint &p1_, const datapoint &p2_)
Compare two datapoint using their X coordinate.
friend std::ostream & operator<<(std::ostream &, const datapoint &)
const double & sigma_y() const
Return the error on the Y coordinate.