#pragma once
// rx_globals: shared definition for rxData.cpp and rxSerialize.cpp
struct rx_globals {
  double *gLin;
  double *gLlikSave;
  double *gSolveLast2;
  double *gSolveLast;
  double *gSolveSave;
  int *gon;
  double *gIndSim;
  double *gsolve;
  double **gInfusionRate;
  int    *gInfusionRateN;
  int     nInfusionRateThreads;
  double *gTlastS;
  double *gTfirstS;
  double *gCurDoseS;
  double *gall_times;
  double *gall_timesS;
  int *gix;
  double *gdv;
  double *glimit;
  int *gcens;
  double *gamt;
  double *gamtS;
  double *gii;
  double *glhs;
  double *gcov;
  double *ginits;
  double *gscale;
  double *gatol2;
  double *grtol2;
  double *gssAtol;
  double *gssRtol;
  double *gpars;
  double *gLinSave;
  double *gLinDummy;
  int *gevid;
  int *gBadDose;
  int *grc;
  int *gidose;
  int *gpar_cov;
  int *gpar_covInterp;
  int *glhs_str;
  int *gParPos;
  int *gParPos2;
  int *gsvar;
  int *govar;
  int *gsiV;
  int *gsi;
  int *slvr_counter;
  int *dadt_counter;
  int *jac_counter;
  int *gSampleCov;
  double *gmtime;
  double *gmtime0;
  double *gsigma = NULL;
  int nSigma = 0;
  double *gomega = NULL;
  int nOmega = 0;
  int *ordId = NULL;
  bool zeroTheta = false;
  bool zeroOmega = false;
  bool zeroSigma = false;
  int *gindLin = NULL;
  int **pendingDoses = NULL;
  int *  nPendingDoses = NULL;
  int *  nAllocPendingDoses = NULL;
  int **ignoredDoses = NULL;
  int *  nIgnoredDoses = NULL;
  int *  nAllocIgnoredDoses = NULL;
  int    **extraDoseTimeIdx = NULL;
  double **extraDoseTime    = NULL;
  int    **extraDoseEvid    = NULL;
  double **extraDoseDose    = NULL;
  int     *extraDoseN       = NULL;
  int     *extraDoseAllocN  = NULL;
  int extraDoseCores = 0;
  double *timeThread = NULL;
  double *gatol2Thread = NULL;
  double *grtol2Thread = NULL;
  double *gssAtolThread = NULL;
  double *gssRtolThread = NULL;
  double *geta_pre = NULL;
  int geta_pre_n = 0;
  bool alloc=false;
};
