21 #ifndef mia_core_boundary_conditions_hh 22 #define mia_core_boundary_conditions_hh 69 typedef std::unique_ptr<CSplineBoundaryCondition>
Pointer;
101 void set_width(
int width);
118 template <
typename T>
119 void filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
128 void filter_line(std::vector<double>& coeff,
const std::vector<double>& poles)
const;
137 template <
typename T>
138 void template_filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
148 virtual void test_supported(
int npoles)
const = 0;
150 virtual void do_set_width(
int width);
153 virtual double initial_coeff(
const std::vector<double>& coeff,
double pole)
const = 0;
154 virtual double initial_anti_coeff(
const std::vector<double>& coeff,
double pole)
const = 0;
220 __attribute__((deprecated));
240 template <
typename T,
int size>
241 struct __dispatch_filter_line {
245 template <
typename T,
int size>
247 const std::vector<double>& poles)
249 std::vector<double> temp(coeff.size());
250 for (
int i = 0; i < size; ++i) {
251 std::transform(coeff.begin(), coeff.end(), temp.begin(),
252 [i](
const T& x) {
return x[i]; });
254 for (
size_t j = 0; j < coeff.size(); ++j)
255 coeff[j][i] = temp[j];
264 template <
typename T>
265 struct __dispatch_filter_line<T,1> {
273 template <
typename T>
276 typedef atomic_data<T> atom;
277 __dispatch_filter_line<T, atom::size>::apply(*
this, coeff, poles);
281 template <
typename T>
284 std::vector<double> temp(coeff.begin(), coeff.end());
285 filter_line(temp, poles);
286 std::transform(temp.begin(), temp.end(), coeff.begin(), [](
double x) {
return static_cast<T
>(x);});
PSplineBoundaryCondition produce_spline_boundary_condition(const std::string &descr)
the singleton that a plug-in handler really is
CSplineBoundaryCondition plugin_data
helper typedef for plug-in handling
static const char *const type_descr
type portion of the plugin search path
void template_filter_line(std::vector< T > &coeff, const std::vector< double > &poles) const
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
std::vector< double > VWeight
type for the weight vector
Base plugin for spline boundary conditions.
static const char *const data_descr
data portion of the plugin search path
FACTORY_TRAIT(CSplineBoundaryConditionPluginHandler)
make spline boundary conditions parsable by the command line
std::unique_ptr< CSplineBoundaryCondition > Pointer
pointer type to this boundary condition
std::vector< int > VIndex
type for the index vector
Abstract base class for B-spline interpolation boundary conditions.
void filter_line(std::vector< T > &coeff, const std::vector< double > &poles) const
CSplineBoundaryCondition plugin_type
helper typedef for plug-in handling
THandlerSingleton< TFactoryPluginHandler< CSplineBoundaryConditionPlugin > > CSplineBoundaryConditionPluginHandler
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
The base class for all plug-in created object.
static const T & instance()
CSplineBoundaryCondition::Pointer PSplineBoundaryCondition
#define NS_MIA_END
conveniance define to end the mia namespace