1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 04:30:33 +00:00

Remove unused includes, avoid pointer dereference

This commit is contained in:
Carles Fernandez 2018-08-21 18:11:03 +02:00
parent 1ee3e867f0
commit 8184e0eb81
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D

View File

@ -29,15 +29,9 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include <chrono>
#include <complex>
#include <random> #include <random>
#include <thread>
#include <armadillo> #include <armadillo>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <gflags/gflags.h>
#include <gnuradio/gr_complex.h>
#include <volk_gnsssdr/volk_gnsssdr.h>
#include "bayesian_estimation.h" #include "bayesian_estimation.h"
#define BAYESIAN_TEST_N_TRIALS 100 #define BAYESIAN_TEST_N_TRIALS 100
@ -46,16 +40,11 @@
TEST(BayesianEstimationPositivityTest, BayesianPositivityTest) TEST(BayesianEstimationPositivityTest, BayesianPositivityTest)
{ {
Bayesian_estimator bayes; Bayesian_estimator bayes;
std::chrono::time_point<std::chrono::system_clock> start, end;
std::chrono::duration<double> elapsed_seconds(0);
arma::vec bayes_mu = arma::zeros(1, 1); arma::vec bayes_mu = arma::zeros(1, 1);
int bayes_nu = 0; int bayes_nu = 0;
int bayes_kappa = 0; int bayes_kappa = 0;
arma::mat bayes_Psi = arma::ones(1, 1); arma::mat bayes_Psi = arma::ones(1, 1);
arma::vec input = arma::zeros(1, 1); arma::vec input = arma::zeros(1, 1);
arma::mat output = arma::ones(1, 1);
//--- Perform initializations ------------------------------ //--- Perform initializations ------------------------------
@ -67,14 +56,14 @@ TEST(BayesianEstimationPositivityTest, BayesianPositivityTest)
{ {
bayes.init(bayes_mu, bayes_kappa, bayes_nu, bayes_Psi); bayes.init(bayes_mu, bayes_kappa, bayes_nu, bayes_Psi);
for (int n = 0; n < BAYESIAN_TEST_ITER; n++) for (int n = 0; n < BAYESIAN_TEST_ITER; n++)
{ {
input(0) = (double)(normal_dist(e1)); input(0) = static_cast<double>(normal_dist(e1));
bayes.update_sequential(input); bayes.update_sequential(input);
output = bayes.get_Psi_est(); arma::mat output = bayes.get_Psi_est();
ASSERT_EQ(output(0) > 0, true); double output0 = output(0, 0);
ASSERT_EQ(output0 > 0.0, true);
} }
} }
} }