* DataPoint is a class representing a data point (x, y), * where y is the value obtained by sampling at a point x. * Note that x is a vector and y is a scalar. */
| 21 | * Note that x is a vector and y is a scalar. |
| 22 | */ |
| 23 | class DataPoint |
| 24 | { |
| 25 | public: |
| 26 | DataPoint(double x, double y); |
| 27 | DataPoint(std::vector<double> x, double y); |
| 28 | DataPoint(DenseVector x, double y); |
| 29 | |
| 30 | bool operator<(const DataPoint &rhs) const; // Returns false if the two are equal |
| 31 | |
| 32 | std::vector<double> getX() const { return x; } |
| 33 | double getY() const { return y; } |
| 34 | unsigned int getDimX() const { return x.size(); } |
| 35 | |
| 36 | private: |
| 37 | DataPoint(); |
| 38 | |
| 39 | std::vector<double> x; |
| 40 | double y; |
| 41 | void setData(const std::vector<double> &x, double y); |
| 42 | |
| 43 | friend class Serializer; |
| 44 | }; |
| 45 | |
| 46 | // Measure distance between two points |
| 47 | double dist(const std::vector<double> x, const std::vector<double> y); |