1
0
Fork 0
mirror of https://github.com/hb9fxq/gr-digitalhf synced 2024-12-22 07:09:59 +00:00

&vec.front() -> vec.data()

This commit is contained in:
Christoph Mayer 2019-10-27 22:48:09 +01:00
parent dac2e9e080
commit a26686f0fd
5 changed files with 8 additions and 7 deletions

View file

@ -208,9 +208,9 @@ adaptive_dfe_impl::general_work(int noutput_items,
#endif
}
assert(i+_nF < nin && i-1-_nB >= 0);
out_symb[nout] = filter(&_rotated_samples.front() + i - _nB,
&_rotated_samples.front() + i + _nF+1);
std::memcpy(&out_taps[(_nB+_nF+1)*nout], &_taps_samples.front(), (_nB+_nF+1)*sizeof(gr_complex));
out_symb[nout] = filter(_rotated_samples.data() + i - _nB,
_rotated_samples.data() + i + _nF+1);
std::memcpy(&out_taps[(_nB+_nF+1)*nout], _taps_samples.data(), (_nB+_nF+1)*sizeof(gr_complex));
++nout;
} // next sample
consume(0, ninput_processed);
@ -254,7 +254,7 @@ gr_complex adaptive_dfe_impl::filter(gr_complex const* start, gr_complex const*
// (1a) taps_samples
volk_32fc_x2_dot_prod_32fc(&filter_output,
start,
&_taps_samples.front(),
_taps_samples.data(),
_nB+_nF+1);
// (1b) taps_symbols
gr_complex dot_symbols(0);

View file

@ -16,6 +16,7 @@ namespace digitalhf {
class filter_update : private boost::noncopyable {
public:
typedef std::unique_ptr<filter_update> sptr;
virtual ~filter_update() {}
virtual void reset() = 0;
virtual gr_complex const* update(gr_complex const*, gr_complex const*) = 0;

View file

@ -40,7 +40,7 @@ gr_complex const* lms::update(gr_complex const* beg,
volk_32fc_conjugate_32fc(&_tmp[0], beg, n);
volk_32f_s32f_multiply_32f((float*)&_gain[0], (float const*)&_tmp[0], _mu, 2*n);
return &_gain.front();
return _gain.data();
}
void lms::set_parameters(std::map<std::string, float>const & p) {

View file

@ -46,7 +46,7 @@ gr_complex const* nlms::update(gr_complex const* beg,
volk_32f_accumulator_s32f(&norm, &_t1[0], n);
volk_32f_s32f_multiply_32f((float*)&_gain[0], (float const*)&_tmp[0], std::max(0.005f, _mu/norm), 2*n);
return &_gain.front();
return _gain.data();
}
void nlms::set_parameters(std::map<std::string, float>const & p) {

View file

@ -63,7 +63,7 @@ gr_complex const* rls::update(gr_complex const* beg,
volk_32f_s32f_multiply_32f((float*)&_inv_corr[k], (float const*)&_inv_corr[k], 1.0f/_lambda, 2*n);
}
return &_gain.front();
return _gain.data();
}
void rls::set_parameters(std::map<std::string, float> const& p) {