26 : n_points_(points.rows()), n_poly_basis_(
model.poly_basis_size()) {
27 auto bbox = geometry::bbox3d::from_points(points);
28 a_ = std::make_unique<fmm::fmm_symmetric_evaluator<Order>>(
29 model, fmm::fmm_tree_height(n_points_), bbox);
30 a_->set_points(points);
32 if (n_poly_basis_ > 0) {
33 p_ = std::make_unique<PolynomialEvaluator>(
model.poly_dimension(),
model.poly_degree());
34 p_->set_field_points(points);
38 [[nodiscard]] valuesd evaluate()
const {
39 auto y = a_->evaluate();
41 if (n_poly_basis_ > 0) {
49 template <
class Derived>
50 void set_weights(
const Eigen::MatrixBase<Derived>& weights) {
51 RSMESH_ASSERT(weights.rows() == n_points_ + n_poly_basis_);
53 a_->set_weights(weights.head(n_points_));
55 if (n_poly_basis_ > 0) {
56 p_->set_weights(weights.tail(n_poly_basis_));
61 const index_t n_points_;
62 const index_t n_poly_basis_;
64 std::unique_ptr<fmm::fmm_symmetric_evaluator<Order>> a_;
65 std::unique_ptr<PolynomialEvaluator> p_;