48 #ifndef MUI_SAMPLER_SHEPARD_QUINTIC_H_
49 #define MUI_SAMPLER_SHEPARD_QUINTIC_H_
51 #include "../../general/util.h"
52 #include "../../config.h"
53 #include "../sampler.h"
58 template<
typename CONFIG=default_config,
typename O_TP=
typename CONFIG::REAL,
typename I_TP=O_TP>
64 using REAL =
typename CONFIG::REAL;
65 using INT =
typename CONFIG::INT;
67 const static int D = CONFIG::D;
71 static_assert(
D == 1 ||
D == 2 ||
D == 3,
"Quintic kernel for dimension other than 1,2,3 not defined." );
78 sigma = 7.0 / 478.0 / PI;
81 sigma = 1.0 / 120.0 / PI;
87 template<
template<
typename,
typename>
class CONTAINER>
92 for(
size_t i = 0 ; i < data_points.size() ; i++ ) {
93 auto dist2 =
normsq( focus - data_points[i].first );
96 vsum += data_points[i].second * w;
100 if( wsum )
return vsum / wsum;
116 REAL s1_5, s2_5, s3_5;
121 s1_5 = 15.0 * powr<5>( s1 );
122 s2_5 = -6.0 * powr<5>( s2 );
123 s3_5 = powr<5>( s3 );
125 w = s3_5 + s2_5 + s1_5;
126 }
else if( s < 2.0 ) {
128 }
else if( s < 3.0 ) {
Definition: geometry.h:92
Definition: geometry.h:158
Definition: sampler_shepard_quintic.h:60
OTYPE filter(point_type focus, const CONTAINER< ITYPE, CONFIG > &data_points) const
Definition: sampler_shepard_quintic.h:88
O_TP OTYPE
Definition: sampler_shepard_quintic.h:62
REAL hinv
Definition: sampler_shepard_quintic.h:110
I_TP ITYPE
Definition: sampler_shepard_quintic.h:63
static const int D
Definition: sampler_shepard_quintic.h:67
REAL quintic_polynomial(const REAL dist) const
Definition: sampler_shepard_quintic.h:112
geometry::any_shape< CONFIG > support(point_type focus, REAL domain_mag) const
Definition: sampler_shepard_quintic.h:104
typename CONFIG::INT INT
Definition: sampler_shepard_quintic.h:65
REAL r
Definition: sampler_shepard_quintic.h:110
sampler_shepard_quintic(REAL r_)
Definition: sampler_shepard_quintic.h:69
typename CONFIG::point_type point_type
Definition: sampler_shepard_quintic.h:66
typename CONFIG::REAL REAL
Definition: sampler_shepard_quintic.h:64
REAL norm_factor
Definition: sampler_shepard_quintic.h:110
SCALAR normsq(vexpr< E, SCALAR, D > const &u)
Definition: point.h:380