diff --git a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.cc b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.cc index 0decedc99..f19f2c66c 100644 --- a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.cc +++ b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.cc @@ -79,7 +79,7 @@ galileo_e1_ls_pvt::~galileo_e1_ls_pvt() } -arma::vec galileo_e1_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) +arma::vec galileo_e1_ls_pvt::rotateSatellite(double traveltime, const arma::vec & X_sat) { /* * Returns rotated satellite ECEF coordinates due to Earth @@ -116,7 +116,7 @@ arma::vec galileo_e1_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) } -arma::vec galileo_e1_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w) +arma::vec galileo_e1_ls_pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w) { /* Computes the Least Squares Solution. * Inputs: @@ -660,7 +660,7 @@ void galileo_e1_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double } -void galileo_e1_ls_pvt::topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx) +void galileo_e1_ls_pvt::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx) { /* Transformation of vector dx into topocentric coordinate system with origin at x diff --git a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h index 8bd0bdca0..1119a2291 100644 --- a/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h +++ b/src/algorithms/PVT/libs/galileo_e1_ls_pvt.h @@ -58,9 +58,9 @@ class galileo_e1_ls_pvt { private: - arma::vec leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w); - arma::vec rotateSatellite(double traveltime, arma::vec X_sat); - void topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx); + arma::vec leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w); + arma::vec rotateSatellite(double traveltime, const arma::vec & X_sat); + void topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx); void togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); void tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); public: diff --git a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc index 7c9e7a9ff..6f56c08e2 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.cc @@ -99,7 +99,7 @@ gps_l1_ca_ls_pvt::~gps_l1_ca_ls_pvt() } -arma::vec gps_l1_ca_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) +arma::vec gps_l1_ca_ls_pvt::rotateSatellite(double traveltime, const arma::vec & X_sat) { /* * Returns rotated satellite ECEF coordinates due to Earth @@ -136,7 +136,7 @@ arma::vec gps_l1_ca_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) } -arma::vec gps_l1_ca_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w) +arma::vec gps_l1_ca_ls_pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w) { /* Computes the Least Squares Solution. * Inputs: @@ -655,7 +655,7 @@ void gps_l1_ca_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double a } -void gps_l1_ca_ls_pvt::topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx) +void gps_l1_ca_ls_pvt::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx) { /* Transformation of vector dx into topocentric coordinate system with origin at x diff --git a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h index 207a0cf74..c7e3bab3f 100644 --- a/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h +++ b/src/algorithms/PVT/libs/gps_l1_ca_ls_pvt.h @@ -61,9 +61,9 @@ class gps_l1_ca_ls_pvt { private: - arma::vec leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w); - arma::vec rotateSatellite(double traveltime, arma::vec X_sat); - void topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx); + arma::vec leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w); + arma::vec rotateSatellite(double traveltime, const arma::vec & X_sat); + void topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx); void togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); void tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); public: diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc index 84b6ca34a..72d0fd499 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.cc +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.cc @@ -81,7 +81,7 @@ hybrid_ls_pvt::~hybrid_ls_pvt() } -arma::vec hybrid_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) +arma::vec hybrid_ls_pvt::rotateSatellite(double traveltime, const arma::vec & X_sat) { /* * Returns rotated satellite ECEF coordinates due to Earth @@ -118,7 +118,7 @@ arma::vec hybrid_ls_pvt::rotateSatellite(double traveltime, arma::vec X_sat) } -arma::vec hybrid_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w) +arma::vec hybrid_ls_pvt::leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w) { /* Computes the Least Squares Solution. * Inputs: @@ -190,7 +190,7 @@ arma::vec hybrid_ls_pvt::leastSquarePos(arma::mat satpos, arma::vec obs, arma::m togeod(&dphi, &dlambda, &h, 6378137.0, 298.257223563, pos(0), pos(1), pos(2)); //--- Find delay due to troposphere (in meters) - tropo(&trop, sin(d_visible_satellites_El[i] * GALILEO_PI/180.0), h/1000, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); + tropo(&trop, sin(d_visible_satellites_El[i] * GALILEO_PI/180.0), h / 1000.0, 1013.0, 293.0, 50.0, 0.0, 0.0, 0.0); if(trop > 50.0 ) trop = 0.0; } } @@ -642,17 +642,17 @@ void hybrid_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double a, d *h = 0; double tolsq = 1.e-10; // tolerance to accept convergence int maxit = 10; // max number of iterations - double rtd = 180/GPS_PI; + double rtd = 180.0 / GPS_PI; // compute square of eccentricity double esq; if (finv < 1.0E-20) { - esq = 0; + esq = 0.0; } else { - esq = (2 - 1/finv) / finv; + esq = (2.0 - 1.0 / finv) / finv; } // first guess @@ -695,14 +695,14 @@ void hybrid_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double a, d return; } - *h = r - a*(1 - sinphi*sinphi/finv); + *h = r - a*(1.0 - sinphi*sinphi/finv); // iterate double cosphi; double N_phi; double dP; double dZ; - double oneesq = 1 - esq; + double oneesq = 1.0 - esq; for (int i = 0; i < maxit; i++) { @@ -734,7 +734,7 @@ void hybrid_ls_pvt::togeod(double *dphi, double *dlambda, double *h, double a, d } -void hybrid_ls_pvt::topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx) +void hybrid_ls_pvt::topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx) { /* Transformation of vector dx into topocentric coordinate system with origin at x diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h index 261121317..a989532bf 100644 --- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h +++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h @@ -62,9 +62,9 @@ class hybrid_ls_pvt { private: - arma::vec leastSquarePos(arma::mat satpos, arma::vec obs, arma::mat w); - arma::vec rotateSatellite(double traveltime, arma::vec X_sat); - void topocent(double *Az, double *El, double *D, arma::vec x, arma::vec dx); + arma::vec leastSquarePos(const arma::mat & satpos, const arma::vec & obs, const arma::mat & w); + arma::vec rotateSatellite(double traveltime, const arma::vec & X_sat); + void topocent(double *Az, double *El, double *D, const arma::vec & x, const arma::vec & dx); void togeod(double *dphi, double *dlambda, double *h, double a, double finv, double X, double Y, double Z); void tropo(double *ddr_m, double sinel, double hsta_km, double p_mb, double t_kel, double hum, double hp_km, double htkel_km, double hhum_km); public: