Mercurial > hg > aimc
changeset 670:443b522fb593
Remove dependency on google logging library in favor of simple asserts.
author | ronw@google.com |
---|---|
date | Thu, 23 May 2013 16:56:38 +0000 |
parents | 2341bb90adb8 |
children | 148270544ba4 |
files | trunk/carfac/agc_coeffs.cc trunk/carfac/carfac_common.h trunk/carfac/ear.cc trunk/carfac/main.cc |
diffstat | 4 files changed, 13 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/carfac/agc_coeffs.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/agc_coeffs.cc Thu May 23 16:56:38 2013 +0000 @@ -20,6 +20,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <assert.h> + #include "agc_coeffs.h" void AGCCoeffs::Design(const AGCParams& agc_params, const int stage, @@ -62,17 +64,12 @@ n_taps = 5; break; case 5: - n_iterations ++; - if (n_iterations > 16){ - // This implies too many iterations, so we shoud indicate and error. - CHECK_GE(16, n_iterations) << - "Too many iterations needed in AGC spatial smoothing."; - } + n_iterations++; + assert(n_iterations < 16 && + "Too many iterations needed in AGC spatial smoothing."); break; default: - // This means a bad n_taps has been provided, so there should again be - // an error. - CHECK_EQ(5, n_taps) << "Bad n_taps; should be 3 or 5."; + assert(true && "Bad n_taps; should be 3 or 5."); break; } // The smoothing function is a space-domain smoothing, but it considered @@ -124,4 +121,4 @@ agc_mix_coeffs_ = stage == 0 ? 0 : mix_coeff / (tau * (fs /decim_)); agc_gain_ = total_dc_gain; detect_scale_ = 1 / total_dc_gain; -} \ No newline at end of file +}
--- a/trunk/carfac/carfac_common.h Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/carfac_common.h Thu May 23 16:56:38 2013 +0000 @@ -53,8 +53,6 @@ #include <math.h> // <vector> is used in place of 2d Eigen Arrays for the AGC memory #include <vector> -// The Google Logging library is included for error handling. -#include <glog/logging.h> // The Eigen library is used extensively for 1d and 2d floating point arrays. // For more information, see: http://eigen.tuxfamily.org #include <Eigen/Dense> @@ -90,4 +88,4 @@ // values. This is here because it is called both in design and run phases. FloatArray CARFACDetect (const FloatArray& x); -#endif \ No newline at end of file +#endif
--- a/trunk/carfac/ear.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/ear.cc Thu May 23 16:56:38 2013 +0000 @@ -20,6 +20,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include <assert.h> + #include "ear.h" // The 'InitEar' function takes a set of model parameters and initializes the @@ -275,9 +277,8 @@ (fir_coeffs[2] * (ss_tap2 + ss_tap4)); break; default: + assert(true && "Bad n_taps in AGCSpatialSmooth; should be 3 or 5."); break; - CHECK_EQ(5, n_taps) << - "Bad n_taps in AGCSpatialSmooth; should be 3 or 5."; } } else { stage_state = AGCSmoothDoubleExponential(stage_state, @@ -318,4 +319,4 @@ return (1 - 2 * r * car_coeffs_.a0_coeffs_ + (r * r)) / (1 - 2 * r * car_coeffs_.a0_coeffs_ + car_coeffs_.h_coeffs_ * r * car_coeffs_.c0_coeffs_ + (r * r)); -} \ No newline at end of file +}
--- a/trunk/carfac/main.cc Thu May 23 04:28:43 2013 +0000 +++ b/trunk/carfac/main.cc Thu May 23 16:56:38 2013 +0000 @@ -35,8 +35,6 @@ int main(int argc, char **argv) { // This initializes the GoogleTest unit testing framework. ::testing::InitGoogleTest(&argc, argv); - // This initializes Google's logging library. - google::InitGoogleLogging(argv[0]); // This runs all of the tests that we've defined above. return RUN_ALL_TESTS(); -} \ No newline at end of file +}