From a26686f0fd5e454247bbfa9d4d47526018f945f3 Mon Sep 17 00:00:00 2001 From: Christoph Mayer Date: Sun, 27 Oct 2019 22:48:09 +0100 Subject: [PATCH] &vec.front() -> vec.data() --- lib/adaptive_dfe_impl.cc | 8 ++++---- lib/filter_update.hpp | 1 + lib/lms.cc | 2 +- lib/nlms.cc | 2 +- lib/rls.cc | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/adaptive_dfe_impl.cc b/lib/adaptive_dfe_impl.cc index e176132..e08432d 100644 --- a/lib/adaptive_dfe_impl.cc +++ b/lib/adaptive_dfe_impl.cc @@ -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); diff --git a/lib/filter_update.hpp b/lib/filter_update.hpp index 3433597..d728ac8 100644 --- a/lib/filter_update.hpp +++ b/lib/filter_update.hpp @@ -16,6 +16,7 @@ namespace digitalhf { class filter_update : private boost::noncopyable { public: typedef std::unique_ptr sptr; + virtual ~filter_update() {} virtual void reset() = 0; virtual gr_complex const* update(gr_complex const*, gr_complex const*) = 0; diff --git a/lib/lms.cc b/lib/lms.cc index e027816..814d60d 100644 --- a/lib/lms.cc +++ b/lib/lms.cc @@ -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::mapconst & p) { diff --git a/lib/nlms.cc b/lib/nlms.cc index 1e13a93..da98230 100644 --- a/lib/nlms.cc +++ b/lib/nlms.cc @@ -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::mapconst & p) { diff --git a/lib/rls.cc b/lib/rls.cc index 231f194..ac99310 100644 --- a/lib/rls.cc +++ b/lib/rls.cc @@ -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 const& p) {