Medusa  1.1
Coordinate Free Mehless Method implementation
Polyharmonic_fwd.hpp
Go to the documentation of this file.
1 #ifndef MEDUSA_BITS_APPROXIMATIONS_POLYHARMONIC_FWD_HPP_
2 #define MEDUSA_BITS_APPROXIMATIONS_POLYHARMONIC_FWD_HPP_
3 
11 #include <medusa/Config.hpp>
13 #include <cmath>
14 #include "Operators_fwd.hpp"
15 
16 namespace mm {
17 
31 template <typename scal_t, int k = -1>
32 class Polyharmonic {
33  public:
34  static_assert((k > 0 && k % 2 == 1) || k == -1, "k must be odd or -1 (Dynamic)");
35  typedef scal_t scalar_t;
36 
37  private:
38  const int order_;
39 
40  public:
42  Polyharmonic();
44  Polyharmonic(int order);
45 
47  int order() const { return order_; }
48 
56  inline scalar_t operator()(scalar_t r2, int derivative) const;
57 
63  template <int dimension>
64  inline scalar_t operator()(scalar_t r2, Lap<dimension> lap) const;
65 
67  inline scalar_t operator()(scalar_t r2) const { return ipow(std::sqrt(r2), order_); }
68 
70  template <typename S, int K>
71  friend std::ostream& operator<<(std::ostream& os, const Polyharmonic<S, K>& m);
72 };
73 
74 } // namespace mm
75 
76 #endif // MEDUSA_BITS_APPROXIMATIONS_POLYHARMONIC_FWD_HPP_
mm::Polyharmonic::order_
const int order_
Exponent of the RBF.
Definition: Polyharmonic_fwd.hpp:38
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::sh::lap
static const shape_flags lap
Indicates to calculate laplace shapes.
Definition: shape_flags.hpp:24
mm::Polyharmonic::Polyharmonic
Polyharmonic()
Default constructor. Only applicable when order given as template argument.
Definition: Polyharmonic.hpp:15
mm::ipow
double ipow(double base)
Compile time integer power, returns base raised to power exponent.
Definition: numutils.hpp:40
numutils.hpp
mm::Polyharmonic::order
int order() const
Get order of the RBF.
Definition: Polyharmonic_fwd.hpp:47
mm::Polyharmonic::operator<<
friend std::ostream & operator<<(std::ostream &os, const Polyharmonic< S, K > &m)
Output basic information about given Gaussian RBF.
Definition: Polyharmonic.hpp:47
Config.hpp
Operators_fwd.hpp
mm::Polyharmonic
Polyharmonic Radial Basis Function of odd order.
Definition: Polyharmonic_fwd.hpp:32
mm::Lap
Represents the Laplacian operator.
Definition: Monomials_fwd.hpp:20
mm::Polyharmonic::operator()
scalar_t operator()(scalar_t r2, int derivative) const
Evaluate derivative of this RBF wrt.
Definition: Polyharmonic.hpp:25
mm::Polyharmonic::operator()
scalar_t operator()(scalar_t r2) const
Evaluate this RBF given squared radial distance.
Definition: Polyharmonic_fwd.hpp:67
mm::Polyharmonic::scalar_t
scal_t scalar_t
Scalar type used for computations.
Definition: Polyharmonic_fwd.hpp:34