1 #ifndef MEDUSA_BITS_APPROXIMATIONS_RBFINTERPOLANT_HPP_
2 #define MEDUSA_BITS_APPROXIMATIONS_RBFINTERPOLANT_HPP_
15 template <
typename RBFType,
typename vec_t>
18 const std::vector<vector_t>& support,
scalar_t scale,
19 const Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>& coefficients) :
20 rbf_(rbf), mon_(mon), point_(point), support_(support), scale_(scale),
21 coefficients_(coefficients) {
23 for (
int i = 0; i < n; ++i) {
29 template <
typename RBFType,
typename vec_t>
31 int n1 = support_.size();
33 vector_t local_point = (point - point_) / scale_;
34 Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> b(n1 + n2);
35 for (
int i = 0; i < n1; ++i) {
36 b(i) = rbf_((local_point - support_[i]).squaredNorm());
38 for (
int i = 0; i < n2; ++i) {
39 b(n1+i) = mon_.eval(i, local_point);
41 return b.dot(coefficients_);
45 template <
typename RBFType,
typename vec_t>
46 template <
typename operator_t>
49 int n1 = support_.size();
51 vector_t local_point = (point - point_) / scale_;
53 Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> b(n1 + n2);
54 for (
int i = 0; i < n1; ++i) {
55 b(i) = rbf_basis.evalOp(i, local_point, op, support_);
57 for (
int i = 0; i < n2; ++i) {
58 b(n1+i) = mon_.evalOp(i, local_point, op);
60 return b.dot(coefficients_);
66 #endif // MEDUSA_BITS_APPROXIMATIONS_RBFINTERPOLANT_HPP_