useDynLib(rstpm2, .registration=TRUE)

exportClasses(stpm2,pstpm2,tvcCoxph,aft)

export(stpm2, pstpm2, aft, gsm,
       cox.tvc, # experimental --- don't export?
       markov_msm, ratio_markov_msm,
       zeroModel, hrModel, aftModel, addModel, # stratifiedModel,
       markov_sde,
       hazFun, splineFun,
       standardise,
       incrVar, nsx, nsxD, "coef<-",
       eform, predictnl, coef, confint, 
       predictnl.default, confint.predictnl,
       vuniroot, voptimize, voptimise, bhazard,
       smoothpwc, gsm_design)

S3method(makepredictcall, nsx)
S3method(makepredictcall, nsxD)
S3method(predict, nsx)
S3method(predict, nsxD)
S3method(predict, formula)
S3method(predictnl, default)
S3method(predictnl, lm)
S3method(confint, predictnl)

S3method(lines, stpm2)
S3method(lines, pstpm2)
S3method(lines, aft)
S3method(eform, stpm2)
S3method(eform, default)
S3method(coef, stpm2)
S3method(vcov, stpm2)
S3method(coef, pstpm2)
S3method(vcov, pstpm2)
S3method("coef<-", default)
S3method("coef<-", mle2)
S3method("coef<-", survPen)

S3method(as.data.frame, markov_msm)
S3method(as.data.frame, markov_sde)
S3method(as.data.frame, markov_msm_diff)
S3method(as.data.frame, markov_msm_ratio)
S3method(vcov, markov_msm)
S3method(standardise, markov_msm)
S3method(standardise, markov_sde)
S3method(print, markov_msm)
S3method(plot, markov_msm)
S3method(plot, markov_sde)
S3method(subset, markov_msm)
S3method(rbind, markov_msm)
S3method(transform, markov_msm)
S3method(nrow, markov_msm)
S3method(diff, markov_msm)

## S3method(predict, zeroModel)
## S3method(coef, zeroModel)
## S3method(vcov, zeroModel)
## S3method(predict, hrModel)
## S3method(coef, hrModel)
## S3method(vcov, hrModel)
## S3method(predict, stratifiedModel)
## S3method(coef, stratifiedModel)
## S3method(vcov, stratifiedModel)


## All methods for imported generics:
exportMethods(plot,predict,predictnl,coef,confint,summary,update,anova,vcov,formula,
              BIC,AIC,AICc,qAICc,simulate,residuals,lines,eform)

importFrom(graphics,plot,lines,matplot,par,polygon,abline,matlines,box)
importFrom(stats, quantile, lm, as.formula, coef, makepredictcall, na.fail, predict,
           contrasts,delete.response, get_all_vars, model.extract, model.frame, 
           model.matrix, model.weights, na.pass, optimHess, pweibull, 
           terms, terms.formula, .checkMFClasses, .getXlevels, pchisq, printCoefmat,
           anova, var, residuals, confint, qnorm, complete.cases, reformulate,
           simulate,splinefun, update.default,runif,
           aggregate, dgamma, dlogis, dnorm, dweibull, integrate)
importFrom(mgcv,gam,s)
importFrom(Rcpp,sourceCpp)
## importFrom(deSolve,ode)
import(bbmle,methods,survival,splines)
importFrom(utils,str,head,tail,modifyList)
importFrom(numDeriv,jacobian)


