bool compareBSplines(BSpline &bs, const BSpline &bs_orig) { auto lb = bs.getDomainLowerBound(); auto ub = bs.getDomainUpperBound(); auto x0_vec = linspace(lb.at(0), ub.at(0), 10); auto x1_vec = linspace(lb.at(1), ub.at(1), 10); DenseVector x(2); for (auto x0 : x0_vec) { for (auto x1 : x1_vec) { x(0) = x0; x(1) = x1; double yb = bs.eval(x); double yb_orig = bs_orig.eval(x); if (std::abs(yb-yb_orig) > 1e-8) { cout << yb << endl; cout << yb_orig << endl; return false; } } } return true; }