Skip to content

Increase performance in LCT model loop #1479

@mknaranja

Description

@mknaranja

@lenaploetzke just pointed me to the question if we could not extract the part (FP)LctStateGroup::template get_num_subcompartments<InfectionState::InfectedSevere>() * (1 / params.template get<TimeInfectedSevere<FP>>()[Group]) from the loop in

flow = (FP)LctStateGroup::template get_num_subcompartments<InfectionState::InfectedSevere>() *
(1 / params.template get<TimeInfectedSevere<FP>>()[Group]) * y[ISevi_first_index + subcomp];
to avoid redundant computations and to improve performance. This is probably a minor change and could be tested quickly if there is some spare time.

These also appear multiple times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    loc::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

    Product Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions