int main() { Points points = gen_points(200); Hash2::Point cnt(1.,1.); double rd = 0.45; Indices dist = dist_nearest(points, cnt, rd); Indices hash = hash_nearest(points, cnt, rd); std::sort(dist.begin(), dist.end()); std::sort(hash.begin(), hash.end()); if (dist.size() != hash.size()) { IMP_THROW("lists are different sizes", ValueException); } if (!std::equal(dist.begin(), dist.end(), hash.begin())) { IMP_THROW("lists have differing elements", ValueException); } return 0; }
int main(int argc, char *argv[]) { IMP::setup_from_argv(argc, argv, "Test geometric hash."); Points points = gen_points(200); Hash2::Point cnt(1., 1.); double rd = 0.45; Indices dist = dist_nearest(points, cnt, rd); Indices hash = hash_nearest(points, cnt, rd); std::sort(dist.begin(), dist.end()); std::sort(hash.begin(), hash.end()); if (dist.size() != hash.size()) { IMP_THROW("lists are different sizes", IMP::ValueException); } if (!std::equal(dist.begin(), dist.end(), hash.begin())) { IMP_THROW("lists have differing elements", IMP::ValueException); } return 0; }