Skip to content

Commit

Permalink
Update function names, remove unused arg
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Jun 28, 2023
1 parent d0f62af commit 98d53b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/frogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "frogger.hpp"
#include "types.hpp"

int get_simulation_years(const Rcpp::List demp, SEXP r_sim_years) {
int transform_simulation_years(const Rcpp::List demp, SEXP r_sim_years) {
Rcpp::NumericVector Sx = demp["Sx"];
Rcpp::Dimension d = Sx.attr("dim");
// Simulation initialises state from first years input data (index 0)
Expand All @@ -21,7 +21,7 @@ int get_simulation_years(const Rcpp::List demp, SEXP r_sim_years) {
return sim_years;
}

int get_hiv_steps_per_year(SEXP r_hiv_steps_per_year) {
int transform_hiv_steps_per_year(SEXP r_hiv_steps_per_year) {
int hiv_steps_per_year;
if (r_hiv_steps_per_year == R_NilValue) {
hiv_steps_per_year = 10;
Expand Down Expand Up @@ -54,7 +54,7 @@ leapfrog::TensorMap1<int> get_age_groups_hiv_span(const Rcpp::List projection_pa
return age_groups_hiv_span;
}

std::vector<int> parse_output_steps(Rcpp::NumericVector output_steps, int proj_years) {
std::vector<int> transform_output_steps(Rcpp::NumericVector output_steps) {
return Rcpp::as<std::vector<int>>(output_steps);
}

Expand All @@ -65,9 +65,9 @@ Rcpp::List run_base_model(const Rcpp::List data,
SEXP hiv_steps_per_year,
Rcpp::NumericVector output_steps,
std::string hiv_age_stratification = "full") {
const int proj_years = get_simulation_years(data, sim_years);
const std::vector<int> save_steps = parse_output_steps(output_steps, proj_years);
const int hiv_steps = get_hiv_steps_per_year(hiv_steps_per_year);
const int proj_years = transform_simulation_years(data, sim_years);
const std::vector<int> save_steps = transform_output_steps(output_steps);
const int hiv_steps = transform_hiv_steps_per_year(hiv_steps_per_year);
const double dt = (1.0 / hiv_steps);
const int num_genders = 2;
const int age_groups_pop = 81;
Expand Down

0 comments on commit 98d53b9

Please sign in to comment.