@@ -47,59 +47,58 @@ int main()
4747 {50 }, {10 , 10 , 5 , 3 , 2 }, {20 }, {10 }};
4848
4949 // Assert that initial_populations has the right shape.
50- if (initial_populations.size () != (int )LctState::InfectionState::Count) {
50+ if (initial_populations.size () != (size_t )LctState::InfectionState::Count) {
5151 mio::log_error (" The number of vectors in initial_populations does not match the number of InfectionStates." );
5252 return 1 ;
5353 }
5454 if ((initial_populations[(int )LctState::InfectionState::Susceptible].size () !=
55- LctState::get_num_subcompartments<LctState::InfectionState::Susceptible>()) ||
55+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::Susceptible>()) ||
5656 (initial_populations[(int )LctState::InfectionState::Exposed].size () !=
57- LctState::get_num_subcompartments<LctState::InfectionState::Exposed>()) ||
57+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::Exposed>()) ||
5858 (initial_populations[(int )LctState::InfectionState::InfectedNoSymptoms].size () !=
59- LctState::get_num_subcompartments<LctState::InfectionState::InfectedNoSymptoms>()) ||
59+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::InfectedNoSymptoms>()) ||
6060 (initial_populations[(int )LctState::InfectionState::InfectedSymptoms].size () !=
61- LctState::get_num_subcompartments<LctState::InfectionState::InfectedSymptoms>()) ||
61+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::InfectedSymptoms>()) ||
6262 (initial_populations[(int )LctState::InfectionState::InfectedSevere].size () !=
63- LctState::get_num_subcompartments<LctState::InfectionState::InfectedSevere>()) ||
63+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::InfectedSevere>()) ||
6464 (initial_populations[(int )LctState::InfectionState::InfectedCritical].size () !=
65- LctState::get_num_subcompartments<LctState::InfectionState::InfectedCritical>()) ||
65+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::InfectedCritical>()) ||
6666 (initial_populations[(int )LctState::InfectionState::Recovered].size () !=
67- LctState::get_num_subcompartments<LctState::InfectionState::Recovered>()) ||
67+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::Recovered>()) ||
6868 (initial_populations[(int )LctState::InfectionState::Dead].size () !=
69- LctState::get_num_subcompartments<LctState::InfectionState::Dead>())) {
69+ ( size_t ) LctState::get_num_subcompartments<LctState::InfectionState::Dead>())) {
7070 mio::log_error (" The length of at least one vector in initial_populations does not match the related number of "
7171 " subcompartments." );
7272 return 1 ;
7373 }
7474
7575 // Transfer the initial values in initial_populations to the vector init.
7676 Eigen::VectorXd init = Eigen::VectorXd::Zero (LctState::Count);
77- init[( int ) LctState::get_first_index<LctState::InfectionState::Susceptible>()] =
77+ init[LctState::get_first_index<LctState::InfectionState::Susceptible>()] =
7878 initial_populations[(int )LctState::InfectionState::Susceptible][0 ];
79- for (unsigned int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::Exposed>(); i++) {
80- init[( int ) LctState::get_first_index<LctState::InfectionState::Exposed>() + i] =
79+ for (int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::Exposed>(); i++) {
80+ init[LctState::get_first_index<LctState::InfectionState::Exposed>() + i] =
8181 initial_populations[(int )LctState::InfectionState::Exposed][i];
8282 }
83- for (unsigned int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedNoSymptoms>();
84- i++) {
85- init[(int )LctState::get_first_index<LctState::InfectionState::InfectedNoSymptoms>() + i] =
83+ for (int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedNoSymptoms>(); i++) {
84+ init[LctState::get_first_index<LctState::InfectionState::InfectedNoSymptoms>() + i] =
8685 initial_populations[(int )LctState::InfectionState::InfectedNoSymptoms][i];
8786 }
88- for (unsigned int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedSymptoms>(); i++) {
89- init[( int ) LctState::get_first_index<LctState::InfectionState::InfectedSymptoms>() + i] =
87+ for (int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedSymptoms>(); i++) {
88+ init[LctState::get_first_index<LctState::InfectionState::InfectedSymptoms>() + i] =
9089 initial_populations[(int )LctState::InfectionState::InfectedSymptoms][i];
9190 }
92- for (unsigned int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedSevere>(); i++) {
93- init[( int ) LctState::get_first_index<LctState::InfectionState::InfectedSevere>() + i] =
91+ for (int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedSevere>(); i++) {
92+ init[LctState::get_first_index<LctState::InfectionState::InfectedSevere>() + i] =
9493 initial_populations[(int )LctState::InfectionState::InfectedSevere][i];
9594 }
96- for (unsigned int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedCritical>(); i++) {
97- init[( int ) LctState::get_first_index<LctState::InfectionState::InfectedCritical>() + i] =
95+ for (int i = 0 ; i < LctState::get_num_subcompartments<LctState::InfectionState::InfectedCritical>(); i++) {
96+ init[LctState::get_first_index<LctState::InfectionState::InfectedCritical>() + i] =
9897 initial_populations[(int )LctState::InfectionState::InfectedCritical][i];
9998 }
100- init[( int ) LctState::get_first_index<LctState::InfectionState::Recovered>()] =
99+ init[LctState::get_first_index<LctState::InfectionState::Recovered>()] =
101100 initial_populations[(int )LctState::InfectionState::Recovered][0 ];
102- init[( int ) LctState::get_first_index<LctState::InfectionState::Dead>()] =
101+ init[LctState::get_first_index<LctState::InfectionState::Dead>()] =
103102 initial_populations[(int )LctState::InfectionState::Dead][0 ];
104103
105104 // Initialize model.
0 commit comments