## exporting main dclone functions
export("dclone", "dcdim", "dciid", "dctr",
       "jags.fit", "bugs.fit", "dc.fit", ".dcFit",
       "clean.jags.model", "write.jags.model", "custommodel",
       "updated.model",
       "dcsd",
       "nclones",
       "mcmcapply",
       "make.symmetric",
       "dctable", "extractdctable",
       "dcdiag", "extractdcdiag",
       "lambdamax.diag", "chisq.diag",
       "dcoptions")

## exporting rjags remakes
export("jagsModel", "codaSamples")

## exporting parallel functions
export("jags.parfit", "dc.parfit", "bugs.parfit",
       "parDosa",
       "clusterSize", "plotClusterSize",
       "clusterSplitSB",
       "parLapplySB", "parLapplySLB",
       "parallel.inits",
       "mclapplySB",
       "evalParallelArgument")
## exporting parallel rjags functions
export("parListModules", "parLoadModule", "parUnloadModule",
      "parListFactories", "parSetFactory",
      "parJagsModel", "parUpdate", "parCodaSamples")

## exporting DcloneEnv related functions
export(pullDcloneEnv,
    pushDcloneEnv,
    clearDcloneEnv,
    listDcloneEnv,
    existsDcloneEnv)

## exporting graphical helper functions
export("errlines")

## imports from other packages
importFrom("stats", "quantile", "update",
      "coef", "vcov", "confint")
importFrom("coda", "as.mcmc.list")
importFrom("utils", "stack")
importFrom("Matrix", "nearPD")
importFrom("parallel", "mclapply")

importFrom("grDevices", "terrain.colors")
importFrom("graphics", "abline", "axis", "box", "hist", "image",
      "legend", "lines", "pairs.default", "par", "plot",
      "plot.new", "plot.window", "points", "polygon", "rect",
      "rug", "text", "title")
importFrom("methods", "as")
importFrom("stats", "cor", "cov", "qchisq", "qnorm", "qqplot", "sd",
      "time", "var")
importFrom("utils", "flush.console")
importFrom("coda", "varnames", "nchain", "mcmc", "as.mcmc",
      "nvar", "gelman.diag", "niter")
importFrom("parallel", "clusterSplit", "clusterEvalQ", "parLapply",
      "clusterExport", "clusterApplyLB", "clusterApply", "clusterCall",
      "clusterSetRNGStream")
importFrom("rjags", "coda.samples", "list.modules")

## export methods for main dclone functions/classes
export(dcsd.mcmc.list,
        coef.mcmc.list,
        confint.mcmc.list.dc,
        vcov.mcmc.list.dc,
        vcov.mcmc.list,
        quantile.mcmc.list,
        dclone.default,
        dclone.list,
        dclone.environment,
        dclone.dcdim,
        dclone.dciid,
        dctable.default,
        extractdctable.default,
        plot.dctable,
        dcdiag.default,
        extractdcdiag.default,
        plot.dcdiag,
        errlines.default,
        nclones.list,
        nclones.default,
        pairs.mcmc.list,
        update.mcmc.list,
        stack.mcmc.list,
        lambdamax.diag.mcmc.list,
        chisq.diag.mcmc.list,
        as.mcmc.list.bugs)

## register methods for main dclone functions/classes
S3method("nclones", "default")
S3method("nclones", "list")
S3method("dclone", "dcdim")
S3method("dclone", "dciid")
S3method("dclone", "default")
S3method("dclone", "list")
S3method("dclone", "environment")
S3method("dctable", "default")
S3method("extractdctable", "default")
S3method("dcdiag", "default")
S3method("extractdcdiag", "default")
S3method("updated.model", "mcmc.list")
S3method("updated.model", "mcmc.list.dc")
S3method("update", "mcmc.list")
S3method("stack", "mcmc.list")
S3method("chisq.diag", "mcmc.list")
S3method("lambdamax.diag", "mcmc.list")

S3method("[", "mcmc.list.dc")
S3method("coef", "mcmc")
S3method("vcov", "mcmc")
S3method("quantile", "mcmc")
S3method("as.mcmc.list", "bugs")
S3method("print", "mcmc.list")
S3method("pairs", "mcmc.list")
S3method("quantile", "mcmc.list")
S3method("coef", "mcmc.list")
S3method("dcsd", "mcmc.list")
S3method("vcov", "mcmc.list")
S3method("vcov", "mcmc.list")
S3method("vcov", "mcmc.list.dc")
S3method("confint", "mcmc.list.dc")
S3method("summary", "mcmc.list.dc")
S3method("print", "summary.mcmc.dc")
S3method("plot", "dctable")
S3method("plot", "dcdiag")
S3method("print", "lambdamax.diag")
S3method("print", "chisq.diag")
S3method("plot", "chisq.diag")
S3method("print", "custommodel")

## methods for helper functions/classes
S3method("errlines", "default")

## exporting Stan related functions
export("stan.fit", "stan.parfit", "stan.model")
S3method("stan.model", "mcmc.list")
S3method("stan.model", "mcmc.list.dc")
importFrom("rstan",
  "stan", "get_stanmodel", "sampling", "sflist2stanfit",
  "As.mcmc.list")

