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;
223 __attribute__((deprecated));
243 template <
typename T,
int size>
244 struct __dispatch_filter_line {
248 template <
typename T,
int size>
250 const std::vector<double>& poles)
252 std::vector<double> temp(coeff.size());
253 for (
int i = 0; i < size; ++i) {
254 std::transform(coeff.begin(), coeff.end(), temp.begin(),
255 [i](
const T& x) { return x[i]; });
257 for (
size_t j = 0; j < coeff.size(); ++j)
258 coeff[j][i] = temp[j];
267 template <
typename T>
268 struct __dispatch_filter_line<T,1> {
276 template <
typename T>
279 typedef atomic_data<T> atom;
280 __dispatch_filter_line<T, atom::size>::apply(*
this, coeff, poles);
284 template <
typename T>
287 std::vector<double> temp(coeff.begin(), coeff.end());
288 filter_line(temp, poles);
289 std::transform(temp.begin(), temp.end(), coeff.begin(), [](
double x) {return static_cast<T>(x);});