1 #ifndef MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_HPP_
2 #define MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_HPP_
14 template <
typename basis_t>
16 const std::vector<vector_t>& support,
scalar_t scale,
17 const Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>& coefficients,
19 basis_(basis), point_(point), support_(support), scale_(scale),
20 coefficients_(coefficients), residual_(residual) {
22 for (
int i = 0; i < n; ++i) {
28 template <
typename basis_t>
31 int m = basis_.size();
32 vector_t local_point = (point - point_) / scale_;
33 Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> b(m);
34 for (
int i = 0; i < m; ++i) {
35 b(i) = basis_.eval(i, local_point, support_);
37 return b.dot(coefficients_);
40 template <
typename basis_t>
41 template <
typename operator_t>
44 int m = basis_.size();
45 vector_t local_point = (point - point_) / scale_;
46 Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> b(m);
47 for (
int i = 0; i < m; ++i) {
48 b(i) = basis_.evalOp(i, local_point, op, support_, scale_);
50 return b.dot(coefficients_);
56 #endif // MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_HPP_