From 3a827f4a7033b9d7c07ac8db54acf3c368816b1e Mon Sep 17 00:00:00 2001 From: wwang-at-github Date: Tue, 7 Nov 2017 13:40:02 -0500 Subject: [PATCH] rm temp rxode folder --- .../testthat/file213445f2e6c6f.d/LHS_VARS.txt | 0 .../testthat/file213445f2e6c6f.d/ODE_PARS.txt | 1 - .../file213445f2e6c6f.d/STATE_VARS.txt | 1 - .../testthat/file213445f2e6c6f.d/call_dvode.c | 412 ------------------ .../file213445f2e6c6f.d/file213445f2e6c6f.c | 40 -- tests/testthat/file213445f2e6c6f.d/model.txt | 3 - 6 files changed, 457 deletions(-) delete mode 100644 tests/testthat/file213445f2e6c6f.d/LHS_VARS.txt delete mode 100644 tests/testthat/file213445f2e6c6f.d/ODE_PARS.txt delete mode 100644 tests/testthat/file213445f2e6c6f.d/STATE_VARS.txt delete mode 100644 tests/testthat/file213445f2e6c6f.d/call_dvode.c delete mode 100644 tests/testthat/file213445f2e6c6f.d/file213445f2e6c6f.c delete mode 100644 tests/testthat/file213445f2e6c6f.d/model.txt diff --git a/tests/testthat/file213445f2e6c6f.d/LHS_VARS.txt b/tests/testthat/file213445f2e6c6f.d/LHS_VARS.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/testthat/file213445f2e6c6f.d/ODE_PARS.txt b/tests/testthat/file213445f2e6c6f.d/ODE_PARS.txt deleted file mode 100644 index 885c14f44..000000000 --- a/tests/testthat/file213445f2e6c6f.d/ODE_PARS.txt +++ /dev/null @@ -1 +0,0 @@ -CL V \ No newline at end of file diff --git a/tests/testthat/file213445f2e6c6f.d/STATE_VARS.txt b/tests/testthat/file213445f2e6c6f.d/STATE_VARS.txt deleted file mode 100644 index 4cb288dfb..000000000 --- a/tests/testthat/file213445f2e6c6f.d/STATE_VARS.txt +++ /dev/null @@ -1 +0,0 @@ -centr \ No newline at end of file diff --git a/tests/testthat/file213445f2e6c6f.d/call_dvode.c b/tests/testthat/file213445f2e6c6f.d/call_dvode.c deleted file mode 100644 index 98372da01..000000000 --- a/tests/testthat/file213445f2e6c6f.d/call_dvode.c +++ /dev/null @@ -1,412 +0,0 @@ -#include -#include -#include -#include -#include "dop853.h" -#define max(a, b) ((a) > (b) ? (a) : (b)) -#ifdef __STANDALONE__ -#define Rprintf printf -#define R_alloc calloc -#endif - - -void F77_NAME(dlsoda)( - void (*)(int *, double *, double *, double *), - int *, double *, double *, double *, int *, double *, double *, - int *, int *, int *, double *,int *,int *, int *, - void (*)(int *, double *, double *, int *, int *, double *, int *), - int *); - -void F77_NAME(dvode)( - void (*)(int *, double *, double *, double *, double *,int *), - int *, double *, double *, double *, int *, double *, double *, - int *, int *, int *, double *,int *,int *, int *, - void (*)(int *, double *, double *, int *, int *, double *, int *, double *, int *), - int *, double *, int *); - - -long slvr_counter, dadt_counter; -double InfusionRate[99]; -double ATOL; //absolute error -double RTOL; //relative error -int do_transit_abs=0; -double tlast=0; -double podo=0; -double *par_ptr; -FILE *fp; - - -void RxODE_mod_file213445f2e6c6f_dydt(unsigned int neq, double t, double *A, double *DADT); -void RxODE_mod_file213445f2e6c6f_calc_lhs(double t, double *A, double *lhs); - -//-------------------------------------------------------------------------- -void RxODE_mod_file213445f2e6c6f_dydt_lsoda_dum(int *neq, double *t, double *A, double *DADT) -{ - RxODE_mod_file213445f2e6c6f_dydt(*neq, *t, A, DADT); -} -void jdum_lsoda(int *a, double *b, double *c, int *d, int *e, double *f, int *g){} -void call_lsoda(int neq, double *x, int *evid, int nx, double *inits, double *dose, double *ret, int *rc) -{ - int ixds=0, i, j; - double xout, xp=x[0], yp[99]; - int itol = 1; - double rtol = RTOL, atol = ATOL; - int itask = 1, istate = 1, iopt = 0, lrw=22+neq*max(16, neq+9), liw=20+neq, jt = 2; - double *rwork; - int *iwork; - int wh, cmt; - - char *err_msg[]= - { - "excess work done on this call (perhaps wrong jt).", - "excess accuracy requested (tolerances too small).", - "illegal input detected (see printed message).", - "repeated error test failures (check all inputs).", - "repeated convergence failures (perhaps bad jacobian supplied or wrong choice of jt or tolerances).", - "error weight became zero during problem. (solution component i vanished, and atol or atol(i) = 0.)", - "work space insufficient to finish (see messages)." - }; - - rwork = (double*)R_alloc(lrw, sizeof(double)); - iwork = (int*)R_alloc(liw, sizeof(int)); - - //--- inits the system - for(i=0; i DBL_EPSILON*max(fabs(xout), fabs(xp))) - { - F77_CALL(dlsoda)(RxODE_mod_file213445f2e6c6f_dydt_lsoda_dum, &neq, yp, &xp, &xout, &itol, &rtol, &atol, &itask, - &istate, &iopt, rwork, &lrw, iwork, &liw, &jdum_lsoda, &jt); - - if (istate<0) - { - Rprintf("IDID=%d, %s\n", istate, err_msg[-istate-1]); -#ifdef __STANDALONE__ - exit(1); -#else - *rc = istate; - return; // exit(1); // dj: should not abort R -#endif - } - - slvr_counter++; - dadt_counter = 0; - } - if (wh) - { - cmt = (wh%10000)/100 - 1; - if (wh>10000) - { - InfusionRate[cmt] += dose[ixds]; - } - else - { - if (do_transit_abs) - { - podo = dose[ixds]; - tlast = xout; - } - else yp[cmt] += dose[ixds]; //dosing before obs - } - istate = 1; - - ixds++; - xp = xout; - } - for(j=0; j DBL_EPSILON*max(fabs(xout), fabs(xp))) - { - F77_CALL(dvode)(RxODE_mod_file213445f2e6c6f_dydt_dvode_dum, &neq, yp, &xp, &xout, &itol, &rtol, &atol, &itask, - &istate, &iopt, rwork, &lrw, iwork, &liw, &jdum_dvode, &mf, rpar, ipar); - - if (istate<0) - { - Rprintf("IDID=%d, %s\n", istate, err_msg[-istate-1]); -#ifdef __STANDALONE__ - exit(1); -#else - *rc = istate; - return; //exit(1); // dj: should not abort R -#endif - } - - slvr_counter++; - dadt_counter = 0; - } - if (wh) - { - cmt = (wh%10000)/100 - 1; - if (wh>10000) - { - InfusionRate[cmt] += dose[ixds]; - } - else - { - if (do_transit_abs) - { - podo = dose[ixds]; - tlast = xout; - } - else yp[cmt] += dose[ixds]; //dosing before obs - } - istate = 1; - - ixds++; - xp = xout; - } - for(j=0; j DBL_EPSILON*max(fabs(xout), fabs(xp))) - { - idid = dop853( - neq, /* dimension of the system <= UINT_MAX-1*/ - RxODE_mod_file213445f2e6c6f_dydt, /* function computing the value of f(x,y) */ - xp, /* initial x-value */ - yp, /* initial values for y */ - xout, /* final x-value (xend-x may be positive or negative) */ - &rtol, /* relative error tolerance */ - &atol, /* absolute error tolerance */ - itol, /* switch for rtoler and atoler */ - solout, /* function providing the numerical solution during integration */ - iout, /* switch for calling solout */ - NULL, /* messages stream */ - DBL_EPSILON, /* rounding unit */ - 0, /* safety factor */ - 0, /* parameters for step size selection */ - 0, - 0, /* for stabilized step size control */ - 0, /* maximal step size */ - 0, /* initial step size */ - 0, /* maximal number of allowed steps */ - 1, /* switch for the choice of the coefficients */ - -1, /* test for stiffness */ - 0, /* number of components for which dense outpout is required */ - NULL, /* indexes of components for which dense output is required, >= nrdens */ - 0 /* declared length of icon */ - ); - if (idid<0) - { - Rprintf("IDID=%d, %s\n", idid, err_msg[-idid-1]); -#ifdef __STANDALONE__ - exit(1); -#else - *rc = idid; - return; //exit(1); // dj: should not abort R -#endif - } - - xp = xRead(); - slvr_counter++; - dadt_counter = 0; - } - if (wh) - { - cmt = (wh%10000)/100 - 1; - if (wh>10000) - { - InfusionRate[cmt] += dose[ixds]; - } - else - { - if (do_transit_abs) - { - podo = dose[ixds]; - tlast = xout; - } - else yp[cmt] += dose[ixds]; //dosing before obs - } - ixds++; - xp = xout; - } - for(j=0; j -#define max(a,b) (((a)>(b))?(a):(b)) -#define min(a,b) (((a)<(b))?(a):(b)) -extern long dadt_counter; -extern double InfusionRate[99]; -extern double *par_ptr; -extern double podo; -extern double tlast; - -// prj-specific differential eqns -void RxODE_mod_file213445f2e6c6f_dydt(unsigned int neq, double t, double *__zzStateVar__, double *__DDtStateVar__) -{ -double - centr, - CL, - V; - - CL = par_ptr[0]; - V = par_ptr[1]; - - centr = __zzStateVar__[0]; - - __DDtStateVar__[0] = InfusionRate[0] + -( CL / V) * centr; - dadt_counter++; -} - -// prj-specific derived vars -void RxODE_mod_file213445f2e6c6f_calc_lhs(double t, double *__zzStateVar__, double *lhs) { -double - centr, - CL, - V; - - CL = par_ptr[0]; - V = par_ptr[1]; - - centr = __zzStateVar__[0]; - - -} diff --git a/tests/testthat/file213445f2e6c6f.d/model.txt b/tests/testthat/file213445f2e6c6f.d/model.txt deleted file mode 100644 index c6fddeb58..000000000 --- a/tests/testthat/file213445f2e6c6f.d/model.txt +++ /dev/null @@ -1,3 +0,0 @@ - - d/dt(centr) = -(CL/V)*centr; -