1 #ifndef SPATIALSEIR_INCLUDEFILES
2 #define SPATIALSEIR_INCLUDEFILES
8 #ifndef MODEL_CONTEXT_INC
9 #define MODEL_CONTEXT_INC
11 #define LSS_DEGENERATE_DATA_MODEL 1
12 #define LSS_OVERDISPERSED_DATA_MODEL 2
18 typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic>
MatrixType;
20 typedef Eigen::Matrix<int, Eigen::Dynamic, Eigen::Dynamic>
IntMatrixType;
288 void runSimulation(
int nIterations,
bool verbose,
bool debug);
296 double proportionChange
487 std::vector<FullConditional*>*
model;
double avgP_SE()
Definition: ModelContextSummaryFunctions.cpp:97
Definition: LSS_FC_R_star.hpp:18
std::vector< DistanceMatrix * > * scaledDistMatrices
Definition: ModelContext.hpp:479
std::vector< FullConditional * > * model
Definition: ModelContext.hpp:487
int totalR()
Definition: ModelContextSummaryFunctions.cpp:40
Definition: LSS_FC_S0.hpp:17
void calculateI_CPU()
Definition: ModelContext.cpp:861
CompartmentalModelMatrix * S
Definition: ModelContext.hpp:457
int dataModel
Definition: ModelContext.hpp:70
FC_Gamma_IR * gamma_ir_fc
Definition: ModelContext.hpp:440
FC_S_Star * S_star_fc
Definition: ModelContext.hpp:426
double * compartmentCache
Definition: ModelContext.hpp:510
Definition: IOProvider.hpp:59
void calculateP_EI_CPU()
Definition: ModelContext.cpp:1053
void calculateR_CPU()
Definition: ModelContext.cpp:919
void calculateP_SE_OCL()
Definition: ModelContext.cpp:1249
Definition: DistanceMatrix.hpp:22
Definition: LSS_FC_Beta_P_RS.hpp:19
modelConfiguration * config
Definition: ModelContext.hpp:483
int totalI()
Definition: ModelContextSummaryFunctions.cpp:36
CovariateMatrix * X
Definition: ModelContext.hpp:475
void calculateGenericCompartment_CPU(CompartmentalModelMatrix *comp, int *comp0, CompartmentalModelMatrix *compStarAdd, CompartmentalModelMatrix *compStarSub)
Definition: ModelContext.cpp:981
int * indexList
Definition: ModelContext.hpp:514
double * p_rs
Definition: ModelContext.hpp:524
PerformDecorrelationStep * decorrelationStepTask
Definition: ModelContext.hpp:451
int * indexLength
Definition: ModelContext.hpp:512
IOProvider * fileProvider
Definition: ModelContext.hpp:410
std::vector< IterationTask * > * iterationTasks
Definition: ModelContext.hpp:490
double * gamma
Definition: ModelContext.hpp:500
void setParameterSamplingMode(int mode)
Definition: ModelContext.cpp:90
InitData * A0
Definition: ModelContext.hpp:473
void configureIterationTasks()
Definition: ModelContext.cpp:440
Definition: CovariateMatrix.hpp:29
int performHybridStep
Definition: ModelContext.hpp:69
int totalI_star()
Definition: ModelContextSummaryFunctions.cpp:70
int * numIterations
Definition: ModelContext.hpp:532
RandomNumberProvider * random
Definition: ModelContext.hpp:413
void setRandomSeed(unsigned int seedValue)
Definition: ModelContext.cpp:36
double estimateR0()
Definition: ModelContextSummaryFunctions.cpp:134
void calculateE_givenI_CPU()
Definition: ModelContext.cpp:815
Definition: CompartmentalModelMatrix.hpp:25
int totalE()
Definition: ModelContextSummaryFunctions.cpp:32
double * offset
Definition: ModelContext.hpp:504
int * N
Definition: ModelContext.hpp:526
struct containing initial slice sampling tuning parameters.
Definition: LSS_FullConditional.hpp:39
int useDecorrelation
Definition: ModelContext.hpp:68
Definition: LSS_IterationTasks.hpp:40
FC_I_Star_overdispersed * I_star_overdispersed_fc
Definition: ModelContext.hpp:442
double * calculateEffectiveR0Components(int t)
Definition: ModelContextSummaryFunctions.cpp:346
FC_R_Star * R_star_fc
Definition: ModelContext.hpp:430
Eigen::Map< MatrixType, Eigen::ColMajor > MatrixMapType
Definition: ModelContext.hpp:19
FC_Rho * rho_fc
Definition: ModelContext.hpp:434
FC_S0 * S0_fc
Definition: ModelContext.hpp:418
Definition: LSS_FC_Rho.hpp:17
double * eta
Definition: ModelContext.hpp:502
void buildModel()
Definition: ModelContext.cpp:466
Definition: LSS_FC_E0.hpp:17
void calculateE_CPU()
Definition: ModelContext.cpp:802
Definition: CovariateMatrix.hpp:19
void setCompartmentSamplingMode(int mode)
Definition: ModelContext.cpp:43
double * beta
Definition: ModelContext.hpp:492
Definition: LSS_FC_R0.hpp:17
CompartmentalModelMatrix * I
Definition: ModelContext.hpp:461
Definition: DistanceMatrix.hpp:16
int totalS()
Definition: ModelContextSummaryFunctions.cpp:28
void simulationIter(bool verbose, bool debug)
Definition: ModelContext.cpp:692
SetCompartmentSamplingIndicesTask * setSamplingIndicesTask
Definition: ModelContext.hpp:447
void populate(InitData *_A0, covariateArgs *xArgs, covariateArgs *xPrsArgs, double *offset, int *Y, compartmentArgs *S_starArgs, compartmentArgs *E_starArgs, compartmentArgs *I_starArgs, compartmentArgs *R_starArgs, scaledDistanceArgs *scaledDistArgs, double *rho, double *phi, double *beta, double *gamma_ei, double *gamma_ir, double *betaPrs, int *N, sliceParameters *sliceWidths, priorControl *priorInformation, modelConfiguration _config)
Definition: ModelContext.cpp:109
void runSimulation(int nIterations, bool verbose, bool debug)
Definition: ModelContext.cpp:725
CompartmentalModelMatrix * E
Definition: ModelContext.hpp:459
PerformHybridSE_EI_UpdateStep * performHybridSE_EI_UpdateTask
Definition: ModelContext.hpp:449
int checkCompartmentBounds()
Definition: ModelContext.cpp:537
int totalS_star()
Definition: ModelContextSummaryFunctions.cpp:62
void calculateE_OCL()
Definition: ModelContext.cpp:853
void calculateGenericCompartment_OCL(int *comp, int *comp0, int *compStarAdd, int *compStarSub)
Definition: ModelContext.cpp:1046
double * calculateIntegratedG(int t)
Definition: ModelContextSummaryFunctions.cpp:186
double avgP_RS()
Definition: ModelContextSummaryFunctions.cpp:122
double * gamma_ir
Definition: ModelContext.hpp:520
Definition: LSS_FC_Phi.hpp:17
Definition: LSS_FullConditional.hpp:86
double * betaPrs
Definition: ModelContext.hpp:494
int totalR_star()
Definition: ModelContextSummaryFunctions.cpp:74
double * p_ir
Definition: ModelContext.hpp:522
int getCompartmentSamplingMode()
Definition: ModelContext.cpp:85
double * p_ei
Definition: ModelContext.hpp:518
Definition: LSS_FC_I0.hpp:18
void calculateP_IR_CPU()
Definition: ModelContext.cpp:1064
CompartmentalModelMatrix * S_star
Definition: ModelContext.hpp:465
void calculateS_CPU()
Definition: ModelContext.cpp:745
CompartmentalModelMatrix * R_star
Definition: ModelContext.hpp:471
void cacheP_SE_Calculation()
Definition: ModelContext.cpp:1219
double * p_se
Definition: ModelContext.hpp:506
void updateSamplingParameters(double desiredRatio, double targetWidth, double proportionChange)
Definition: ModelContext.cpp:683
void calculateR_givenS_CPU()
Definition: ModelContext.cpp:936
FC_E0 * E0_fc
Definition: ModelContext.hpp:420
Definition: RandomNumberProvider.hpp:78
int indexLength
Definition: ModelContext.hpp:67
FC_Beta_P_RS * betaPrs_fc
Definition: ModelContext.hpp:436
~ModelContext()
Definition: ModelContext.cpp:1254
Definition: LSS_FC_S_star.hpp:18
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixType
Definition: ModelContext.hpp:18
FC_R0 * R0_fc
Definition: ModelContext.hpp:424
void printFCValues()
Definition: ModelContext.cpp:647
Definition: LSS_IterationTasks.hpp:27
int compartmentSamplingMode
Definition: ModelContext.hpp:65
struct containing hyperparameters for beta, betaP_RS, P_EI, and P_IR
Definition: LSS_FullConditional.hpp:26
CompartmentalModelMatrix * I_star
Definition: ModelContext.hpp:469
double * p_se_components
Definition: ModelContext.hpp:508
double * calculateR0Components(int t)
Definition: ModelContextSummaryFunctions.cpp:400
Definition: LSS_FC_Gamma_EI.hpp:18
void calculateS_OCL()
Definition: ModelContext.cpp:793
Definition: DistanceMatrix.hpp:36
void calculateI_OCL()
Definition: ModelContext.cpp:911
int totalE_star()
Definition: ModelContextSummaryFunctions.cpp:66
CovariateMatrix * X_pRS
Definition: ModelContext.hpp:477
Definition: OCLProvider.hpp:123
Definition: LSS_FC_Gamma_IR.hpp:18
void calculateI_givenR_CPU()
Definition: ModelContext.cpp:874
int reinfectionMode
Definition: ModelContext.hpp:64
CompartmentalModelMatrix * E_star
Definition: ModelContext.hpp:467
FC_E_Star * E_star_fc
Definition: ModelContext.hpp:428
FC_Beta * beta_fc
Definition: ModelContext.hpp:432
int getParameterSamplingMode()
Definition: ModelContext.cpp:104
Definition: LSS_FC_I_star_overdispersion.hpp:16
void calculateP_SE_CPU()
Definition: ModelContext.cpp:1092
Simple class containing the starting compartment sizes.
Definition: LSS_FullConditional.hpp:55
double * calculateG(int t)
Definition: ModelContextSummaryFunctions.cpp:286
int * isPopulated
Definition: ModelContext.hpp:528
int parameterSamplingMode
Definition: ModelContext.hpp:66
CompartmentalModelMatrix * R
Definition: ModelContext.hpp:463
double * rho
Definition: ModelContext.hpp:496
int * singleLocation
Definition: ModelContext.hpp:530
CompartmentalModelMatrix * tmpContainer
Definition: ModelContext.hpp:481
FC_Phi * phi_fc
Definition: ModelContext.hpp:444
void calculateP_RS_CPU()
Definition: ModelContext.cpp:1078
Eigen::Matrix< int, Eigen::Dynamic, Eigen::Dynamic > IntMatrixType
Definition: ModelContext.hpp:20
Definition: ModelContext.hpp:82
Definition: LSS_FC_E_star.hpp:17
double * phi
Definition: ModelContext.hpp:498
int * Y
Definition: ModelContext.hpp:455
FC_I0 * I0_fc
Definition: ModelContext.hpp:422
Eigen::Map< IntMatrixType, Eigen::ColMajor > IntMatrixMapType
Definition: ModelContext.hpp:21
Definition: CompartmentalModelMatrix.hpp:17
void calculateR_OCL()
Definition: ModelContext.cpp:972
ModelContext()
Definition: ModelContext.cpp:29
Definition: LSS_FC_Beta.hpp:19
double * gamma_ei
Definition: ModelContext.hpp:516
OCLProvider * oclProvider
Definition: ModelContext.hpp:416
Definition: ModelContext.hpp:62
FC_Gamma_EI * gamma_ei_fc
Definition: ModelContext.hpp:438
void calculateS_givenE_CPU()
Definition: ModelContext.cpp:757
double estimateEffectiveR0()
Definition: ModelContextSummaryFunctions.cpp:234