Skip to content

code style refactor on if statement #345

Description

@jeffeaton

Very small note: this conditional looks a bit unnecessary clunky with the nested conditionals (the else at line 100). I suspect this could be rationalised with more unified style.

if constexpr (ModelVariant::run_goals) {
if (hiv_step==0) {
state_next.hv.new_infections_dp = 0.0;//init new infections from DP
}
calc_new_infections_agesex_goals(hiv_step);
}
else {
if (p_ha.incidence_model_choice == SS::INCIDMOD_DIRECTINCID_HTS) {
calc_new_infections_agesex(hiv_step);
} else if (p_ha.incidence_model_choice == SS::INCIDMOD_TRANSMRATE_HTS){
calc_new_infections_incidmod_transmrate(hiv_step);
} else {
throw std::invalid_argument("Incidence model choice not vaild\n");
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions