Medusa  1.1
Coordinate Free Mehless Method implementation
WLSApproximant_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_FWD_HPP_
2 #define MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
12 #include <Eigen/Core>
13 
14 namespace mm {
15 
26 template <typename basis_t>
28  public:
29  typedef typename basis_t::scalar_t scalar_t;
30  typedef typename basis_t::vector_t vector_t;
31 
32  private:
33  basis_t basis_;
35  std::vector<vector_t> support_;
37  Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> coefficients_;
39 
40  public:
53  WLSApproximant(const basis_t& basis, const vector_t& point,
54  const std::vector<vector_t>& support, scalar_t scale,
55  const Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>& coefficients,
57 
59  scalar_t operator()(const vector_t& point) const;
60 
62  template <typename operator_t>
63  scalar_t operator()(const vector_t& point, const operator_t& op) const;
64 
66  const basis_t& basis() const { return basis_; }
68  const vector_t& point() const { return point_; }
70  scalar_t scale() const { return scale_; }
72  const Eigen::Matrix<scalar_t, Eigen::Dynamic, 1>& coefficients() const { return coefficients_; }
74  scalar_t residual() const { return residual_; }
75 };
76 
77 } // namespace mm
78 
79 #endif // MEDUSA_BITS_APPROXIMATIONS_WLSAPPROXIMANT_FWD_HPP_
mm
Root namespace for the whole library.
Definition: Gaussian.hpp:14
scalar_t
Scalar scalar_t
Type of the elements, alias of Scalar.
Definition: MatrixBaseAddons.hpp:16
mm::WLSApproximant::scalar_t
basis_t::scalar_t scalar_t
Scalar type.
Definition: WLSApproximant_fwd.hpp:29
mm::WLSApproximant::scale
scalar_t scale() const
Get the scale.
Definition: WLSApproximant_fwd.hpp:70
mm::NaN
static const double NaN
Not-a-number floating point value.
Definition: Config.hpp:46
mm::WLSApproximant::point_
vector_t point_
Center point.
Definition: WLSApproximant_fwd.hpp:34
mm::WLSApproximant::residual_
scalar_t residual_
Store residual of the approximation.
Definition: WLSApproximant_fwd.hpp:38
mm::WLSApproximant::scale_
scalar_t scale_
Scale.
Definition: WLSApproximant_fwd.hpp:36
mm::WLSApproximant::coefficients
const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > & coefficients() const
Get the coefficient vector.
Definition: WLSApproximant_fwd.hpp:72
Config.hpp
mm::WLSApproximant::WLSApproximant
WLSApproximant(const basis_t &basis, const vector_t &point, const std::vector< vector_t > &support, scalar_t scale, const Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > &coefficients, scalar_t residual=NaN)
Construct a WLS approximant with known coefficients.
Definition: WLSApproximant.hpp:15
mm::WLSApproximant::point
const vector_t & point() const
Get the center point.
Definition: WLSApproximant_fwd.hpp:68
mm::WLSApproximant::vector_t
basis_t::vector_t vector_t
Vector type.
Definition: WLSApproximant_fwd.hpp:30
mm::WLSApproximant::residual
scalar_t residual() const
Get the residual.
Definition: WLSApproximant_fwd.hpp:74
mm::WLSApproximant::operator()
scalar_t operator()(const vector_t &point) const
Evaluate the approximant at given point.
Definition: WLSApproximant.hpp:30
mm::WLSApproximant
Class representing the function that is a WLS approximant using some basis function over some points.
Definition: WLSApproximant_fwd.hpp:27
mm::WLSApproximant::basis_
basis_t basis_
Basis.
Definition: WLSApproximant_fwd.hpp:33
mm::WLSApproximant::coefficients_
Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > coefficients_
Coefficients (for scaled fn.)
Definition: WLSApproximant_fwd.hpp:37
mm::WLSApproximant::basis
const basis_t & basis() const
Get the basis functions.
Definition: WLSApproximant_fwd.hpp:66
mm::WLSApproximant::support_
std::vector< vector_t > support_
Local scaled stencil points.
Definition: WLSApproximant_fwd.hpp:35