MCPcopy Create free account
hub / github.com/bgrimstad/splinter / DataPoint

Class DataPoint

include/datapoint.h:23–44  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

21 * Note that x is a vector and y is a scalar.
22 */
23class DataPoint
24{
25public:
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
36private:
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
47double dist(const std::vector<double> x, const std::vector<double> y);

Callers 1

addSampleMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected