Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted Param.h icdf arrays from double array to InverseCdf class #316

Merged
merged 27 commits into from
Jun 19, 2020

Conversation

DavidVernest
Copy link
Contributor

@DavidVernest DavidVernest commented May 21, 2020

Closes #315. (Refactor the ICDF arrays in Param.h / CovidSim.cpp)

  • Introduces a new class InverseCdf
  • Removes SetICDF() from CovidSim.cpp
  • Adds helper function GetInverseCdf() to replace individual calls
  • Uses InverseCdf functions set_defaults() and apply_exponent()
  • Moves ChooseFromICDF() from Update.cpp to InverseCdf function choose()

src/CMakeLists.txt Outdated Show resolved Hide resolved
src/ICDF.h Outdated Show resolved Hide resolved
@CloneDeath
Copy link
Contributor

Looks good. I think it's a step in the right direction, for sure.

@DavidVernest DavidVernest changed the title Converted Param MildToRecovery_icdf from double array to ICDF class Converted Param.h icdf arrays from double array to InverseCdf wrapper class May 22, 2020
@DavidVernest DavidVernest marked this pull request as ready for review May 22, 2020 09:58
@DavidVernest DavidVernest reopened this May 22, 2020
@DavidVernest DavidVernest changed the title Converted Param.h icdf arrays from double array to InverseCdf wrapper class Converted Param.h icdf arrays from double array to InverseCdf class May 27, 2020
The start value for ICDF arrays was hardcoded to 100. This was extracted to a const, but incorrectly given the data type of int. To avoid any implicit type conversions, this has now been specified as a double value of 100.0.
@DavidVernest
Copy link
Contributor Author

DavidVernest commented Jun 19, 2020

@matt-gretton-dann @dlaydon @weshinsley PR #316 is now 29 days old. It finishes the cleanup of ICDF, incorporates Neil Ferguson's data-type fix (from int to double), and passes all tests. Would appreciate a review/merge so I can concentrate on the Update.cpp work. Thanks.

src/InverseCdf.cpp Outdated Show resolved Hide resolved
@weshinsley weshinsley merged commit 863389f into mrc-ide:master Jun 19, 2020
@DavidVernest DavidVernest deleted the ICDF branch July 28, 2020 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor the ICDF arrays in Param.h / CovidSim.cpp
4 participants