21 #ifndef mia_core_boundary_conditions_hh
22 #define mia_core_boundary_conditions_hh
69 typedef std::unique_ptr<CSplineBoundaryCondition>
Pointer;
99 void set_width(
int width);
116 template <
typename T>
117 void filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
126 void filter_line(std::vector<double>& coeff,
const std::vector<double>& poles)
const;
135 template <
typename T>
136 void template_filter_line(std::vector<T>& coeff,
const std::vector<double>& poles)
const;
146 virtual
void test_supported(
int npoles) const = 0;
148 virtual
void do_set_width(
int width);
151 virtual
double initial_coeff(const std::vector<
double>& coeff,
double pole) const = 0;
152 virtual
double initial_anti_coeff(const std::vector<
double>& coeff,
double pole)const = 0;
173 virtual CSplineBoundaryCondition *do_create()
const;
175 virtual CSplineBoundaryCondition *do_create(
int width)
const = 0;
219 __attribute__((deprecated));
239 template <
typename T,
int size>
240 struct __dispatch_filter_line {
244 template <
typename T,
int size>
246 const std::vector<double>& poles)
248 std::vector<double> temp(coeff.size());
249 for (
int i = 0; i < size; ++i) {
250 std::transform(coeff.begin(), coeff.end(), temp.begin(),
251 [i](
const T& x) {
return x[i]; });
253 for (
size_t j = 0; j < coeff.size(); ++j)
254 coeff[j][i] = temp[j];
263 template <
typename T>
264 struct __dispatch_filter_line<T,1> {
272 template <
typename T>
275 typedef atomic_data<T> atom;
276 __dispatch_filter_line<T, atom::size>::apply(*
this, coeff, poles);
280 template <
typename T>
283 std::vector<double> temp(coeff.begin(), coeff.end());
284 filter_line(temp, poles);
285 std::transform(temp.begin(), temp.end(), coeff.begin(), [](
double x) {
return static_cast<T
>(x);});