diff options
| author | Josh Blum <josh@joshknows.com> | 2010-08-06 15:02:33 -0700 | 
|---|---|---|
| committer | Josh Blum <josh@joshknows.com> | 2010-08-06 15:02:33 -0700 | 
| commit | d1711722dd432ba63b54f93d92270d4050465204 (patch) | |
| tree | 7b486a899ddafe706225189d22f5beac122c0ff2 | |
| parent | 8e1d51d628afb18dc9a36f268dda1e9f48a1c2ad (diff) | |
| download | uhd-d1711722dd432ba63b54f93d92270d4050465204.tar.gz uhd-d1711722dd432ba63b54f93d92270d4050465204.tar.bz2 uhd-d1711722dd432ba63b54f93d92270d4050465204.zip | |
uhd: use int to round down for gain group
| -rw-r--r-- | host/lib/utils/gain_group.cpp | 7 | 
1 files changed, 2 insertions, 5 deletions
| diff --git a/host/lib/utils/gain_group.cpp b/host/lib/utils/gain_group.cpp index 5a14fa96f..1be09dee2 100644 --- a/host/lib/utils/gain_group.cpp +++ b/host/lib/utils/gain_group.cpp @@ -21,13 +21,10 @@  #include <uhd/utils/assert.hpp>  #include <boost/foreach.hpp>  #include <boost/bind.hpp> -#include <boost/math/special_functions/round.hpp>  #include <algorithm>  #include <vector>  #include <iostream> -#define rint(x) boost::math::iround(x) -  using namespace uhd;  static const bool verbose = false; @@ -86,7 +83,7 @@ public:          BOOST_FOREACH(const gain_fcns_t &fcns, all_fcns){              const gain_range_t range = fcns.get_range();              gain_bucket.push_back( -                max_step*rint(std::clip(gain_left_to_distribute, range.min, range.max)/max_step) +                max_step*int(std::clip(gain_left_to_distribute, range.min, range.max)/max_step)              );              gain_left_to_distribute -= gain_bucket.back();          } @@ -109,7 +106,7 @@ public:          //fill in the largest step sizes first that are less than the remainder          BOOST_FOREACH(size_t i, indexes_step_size_dec){              const gain_range_t range = all_fcns.at(i).get_range(); -            float additional_gain = range.step*rint( +            float additional_gain = range.step*int(                  std::clip(gain_bucket.at(i) + gain_left_to_distribute, range.min, range.max              )/range.step) - gain_bucket.at(i);              gain_bucket.at(i) += additional_gain; | 
