FAQs for developers
Jaideep Joshi
11 March 2022
faq_dev.Rmd
Why is the species templated, instead of using
IndividualBase
?
So that a vector of Cohort
s 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
growthRateXXX
andmortalityRateXXX
functions before call togrowthRate
ormortalityRate
. -
preCompute
was NOT called inafterStep.
This may not have been okay.