FAQs for developers
Jaideep Joshi
11 March 2022
faq_dev.RmdWhy is the species templated, instead of using
IndividualBase?
So that a vector of Cohorts can be created, rather than
a vector of base pointer CohortBase*. This allows cache
locality and has better performance.
Where should precompute be triggered?
Upon every state update (in setSize()) and every
environment update (in updateEnv()).
In the earlier implementation in which precompute was not auto-triggered, where was it called?
The Solver called precompute in the following
situations:
- before every call to
calcRates - before computation of
newborns_out - for all offset cohorts in
growthRateXXXandmortalityRateXXXfunctions before call togrowthRateormortalityRate. -
preComputewas NOT called inafterStep.This may not have been okay.