/* Points.hpp - Defining a data structure that holds a collection of n-dimensional points, and implements a function that is the closest distance to any of the points. James S. Plank CS494/594 Lecture notes. Fri May 15 15:28:39 EDT 2020 */ #pragma once #include #include /* This is a data structure to help demonstrate Bayesian Optimization. See the accompanying lecture notes. */ class Points { public: /* The only piece of data is a vector of points. Each element of the vector is a vector of n points, and each point will be a double between 0 and 10. I'm making it public, because I'm not in the mood to get all object oriented about this. */ std::vector < std::vector > p; /* You'll note -- no constructors, destructors or assignment overloads. Since the only piece of data is that vector of vectors, all the defaults will work. */ /* Reads from a stream and double-checks that everything is correct. If it encounters an error, it will throw an exception of type std::runtim_error. */ void Read(std::istream &in); /* Here is a function that we want to maximize. Given a point in this n-dimensional space, what is the smallest distance to a point in p? If x's size is not equal to the number of dimensions of p, it will throw an exception of type std::runtim_error. */ double Min_Distance(const std::vector &x) const; };