21#ifndef mia_core_boundary_conditions_hh
22#define mia_core_boundary_conditions_hh
70 typedef std::unique_ptr<CSplineBoundaryCondition>
Pointer;
120 template <
typename T>
121 void filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
130 void filter_line(std::vector<double>& coeff,
const std::vector<double>& poles)
const;
139 template <
typename T>
140 void template_filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
150 virtual
void test_supported(
int npoles) const = 0;
152 virtual
void do_set_width(
int width);
155 virtual
double initial_coeff(const
std::vector<
double>& coeff,
double pole) const = 0;
156 virtual
double initial_anti_coeff(const
std::vector<
double>& coeff,
double pole)const = 0;
226__attribute__((deprecated));
246template <
typename T,
int size>
247struct __dispatch_filter_line {
251template <
typename T,
int size>
253 const std::vector<double>& poles)
255 std::vector<double> temp(coeff.size());
257 for (
int i = 0; i < size; ++i) {
258 std::transform(coeff.begin(), coeff.end(), temp.begin(),
264 for (
size_t j = 0; j < coeff.size(); ++j)
265 coeff[j][i] = temp[j];
275struct __dispatch_filter_line<T, 1> {
287 typedef atomic_data<T> atom;
288 __dispatch_filter_line<T, atom::size>::apply(*
this, coeff, poles);
295 std::vector<double> temp(coeff.begin(), coeff.end());
296 filter_line(temp, poles);
297 std::transform(temp.begin(), temp.end(), coeff.begin(), [](
double x) {
298 return static_cast<T>(x);
PSplineBoundaryCondition produce_spline_boundary_condition(const std::string &descr)
The base class for all plug-in created object.
Base plugin for spline boundary conditions.
CSplineBoundaryConditionPlugin(const char *name)
Abstract base class for B-spline interpolation boundary conditions.
bool apply(CSplineKernel::VIndex &index, CSplineKernel::VWeight &weights) const
CSplineBoundaryCondition(int width)
std::unique_ptr< CSplineBoundaryCondition > Pointer
pointer type to this boundary condition
void set_width(int width)
CSplineBoundaryCondition()
CSplineBoundaryCondition plugin_type
helper typedef for plug-in handling
CSplineBoundaryCondition(const CSplineBoundaryCondition &)=delete
CSplineBoundaryCondition plugin_data
helper typedef for plug-in handling
void filter_line(std::vector< double > &coeff, const std::vector< double > &poles) const
void template_filter_line(std::vector< T > &coeff, const std::vector< double > &poles) const
virtual CSplineBoundaryCondition * clone() const __attribute__((warn_unused_result))=0
static const char *const data_descr
data portion of the plugin search path
static const char *const type_descr
type portion of the plugin search path
void filter_line(std::vector< T > &coeff, const std::vector< double > &poles) const
Base class for all spline based interpolation kernels.
std::vector< double > VWeight
type for the weight vector
std::vector< int > VIndex
type for the index vector
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
the singleton that a plug-in handler really is
static const T & instance()
The basic template of all plugin handlers.
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
#define NS_MIA_END
conveniance define to end the mia namespace
CSplineBoundaryCondition::Pointer PSplineBoundaryCondition
THandlerSingleton< TFactoryPluginHandler< CSplineBoundaryConditionPlugin > > CSplineBoundaryConditionPluginHandler