473 template <
typename VectorType>
bool compare_vec(std::vector<VectorType> v1, std::vector<VectorType> v2) {
474 if (v1.empty() || v2.empty())
return true;
475 std::sort(v1.begin(), v1.end());
476 std::sort(v2.begin(), v2.end());
477 if (v1.size() == v2.size()) {
478 return std::equal(v1.begin(), v1.end(), v2.begin(), [](
const VectorType& x1,
const VectorType& x2) {
479 return isnan(x1) || isnan(x2) || x1.equals(x2, 1.1e-4);
482 auto v2_last_match_it = v2.begin();
483 for (VectorType point : v1) {
485 if (point.equals(*v2_last_match_it, 1.1e-4))
return true;
486 if (point < *v2_last_match_it)
break;
488 if (v2_last_match_it == v2.end())
return false;
499 template <
typename GeomType>
Set compare_d(
const GeomType* geom1,
const GeomType* geom2) {
500 auto c1 = geom1->getChildUnsafe();
501 auto c2 = geom2->getChildUnsafe();
502 if (!c1 || !c2)
return {};
503 if (geom1->hasInSubtree(*c2) || geom2->hasInSubtree(*c1))
return {};
506 Set og1 = get(geom1);
507 Set og2 = get(geom2);
508 std::set_union(og1.begin(), og1.end(), og2.begin(), og2.end(), std::back_inserter(obj_to_check));
511 for (
auto o : obj_to_check)
512 if (!compare_vec(geom1->getObjectPositions(*o), geom2->getObjectPositions(*o))) {