SciCompMod / memilio

Modular spatio-temporal models for epidemic and pandemic simulations
https://scicompmod.github.io/memilio/
Apache License 2.0
51 stars 15 forks source link

Use int instead of unsigned int in LCT infection state #965

Closed lenaploetzke closed 2 months ago

lenaploetzke commented 3 months ago

Motivation / Current Behaviour

Currently LctInfectionState uses unsigned ints as template parameters and as return values of the functions. This leads to some hard to detect unexpected behaviour when using the return values in calculations, especially when multiplying them with negative values.

Enhancement description

Replace unsigned int with int and include some static assert statements to ensure that the parameters are non-negative. Also update all the explicit type conversions. This change should simplify some calculations and make them less error-prone

Additional context

No response

Checklist