Skip to content

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

@lenaploetzke

Description

@lenaploetzke

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

  • Attached labels, especially loc:: or model:: labels.
  • Linked to project

Metadata

Metadata

Assignees

Labels

class::improvementCleanup that doesn't affect functionalityloc::backendThis issue concerns the C++ backend implementation.model::lctModels using the linear chain trickprio::lowThe priority of this task is low. It is an interesting item but with low priority.

Type

No type

Projects

Status

Done (Total)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions