Skip to content

Commit

Permalink
not using std::max since Clang complains!
Browse files Browse the repository at this point in the history
  • Loading branch information
debog committed Nov 5, 2024
1 parent e4db458 commit c1a4331
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/AgentContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,12 @@ void AgentContainer::infectAgents ()
if (amrex::Random(engine) < prob_ptr[i]) {
status_ptr[i] = Status::infected;
counter_ptr[i] = 0.0_rt;
latent_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->latent_length_mean, lparm->latent_length_std, engine));
infectious_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->infectious_length_mean, lparm->infectious_length_std, engine));
incubation_period_ptr[i] = std::max(amrex::ParticleReal(0.0),amrex::RandomNormal(lparm->incubation_length_mean, lparm->incubation_length_std, engine));
latent_period_ptr[i] = amrex::RandomNormal(lparm->latent_length_mean, lparm->latent_length_std, engine);
infectious_period_ptr[i] = amrex::RandomNormal(lparm->infectious_length_mean, lparm->infectious_length_std, engine);
incubation_period_ptr[i] = amrex::RandomNormal(lparm->incubation_length_mean, lparm->incubation_length_std, engine);
if (latent_period_ptr[i] < 0) { latent_period_ptr[i] = 0.0_rt; }
if (infectious_period_ptr[i] < 0) { infectious_period_ptr[i] = 0.0_rt; }
if (incubation_period_ptr[i] < 0) { incubation_period_ptr[i] = 0.0_rt; }
if (latent_period_ptr[i] > (infectious_period_ptr[i]+incubation_period_ptr[i])) {
latent_period_ptr[i] = std::floor(infectious_period_ptr[i]+incubation_period_ptr[i]);
}
Expand Down

0 comments on commit c1a4331

Please sign in to comment.