File tree 1 file changed +2
-1
lines changed
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -321,9 +321,10 @@ class Model
321
321
.sum ();
322
322
// Size of the Subpopulation Group2 without dead people.
323
323
double N_2 = pop.segment (first_index_group2, LctStateGroup2::Count - 1 ).sum ();
324
+ const double divN_2 = (N_2 < Limits<ScalarType>::zero_tolerance ()) ? 0.0 : 1.0 / N_2;
324
325
ScalarType season_val = 1 + params.template get <Seasonality>() *
325
326
sin (3.141592653589793 * ((params.template get <StartDay>() + t) / 182.5 + 0.5 ));
326
- dydt[Si_1] += -y[Si_1] / N_2 * season_val * params.template get <TransmissionProbabilityOnContact>()[Group1] *
327
+ dydt[Si_1] += -y[Si_1] * divN_2 * season_val * params.template get <TransmissionProbabilityOnContact>()[Group1] *
327
328
params.template get <ContactPatterns>().get_cont_freq_mat ().get_matrix_at (t)(
328
329
static_cast <Eigen::Index>(Group1), static_cast <Eigen::Index>(Group2)) *
329
330
(params.template get <RelativeTransmissionNoSymptoms>()[Group2] * infectedNoSymptoms_2 +
You can’t perform that action at this time.
0 commit comments