Yip, provided the data is 1d, else we need to let the user specify the distance function