import (secr)
import (parallel)

importFrom (graphics, "abline", "axis", "box", "contour", "plot", "points", "segments", 
    "mtext", "lines", "par", "rug", "symbols")
importFrom (utils, "packageDescription", "packageVersion", "flush.console", "combn", "head", "tail")
importFrom (MASS, "ginv", "eqscplot")
importFrom (nlme, "fdHess")
importFrom (stringr, "str_trim", "str_split", "str_c", "str_pad")
importFrom (plyr, "count", "rbind.fill")
importFrom (abind, "abind")
importFrom (stats, "AIC", "as.formula", "coef", "contrasts", "dist", "integrate", 
    "logLik", "model.matrix", "nlm", "optim", "vcov",
    "predict", "qnorm", "dpois", "dbinom", "dnbinom", "dgamma", "dlnorm", 
    "pgamma", "pnorm", "qexp", "qgamma", "qlnorm", "runif", "sd", "median", 
    "uniroot", "update")
importFrom (methods, "formalArgs")
importFrom (Rcpp, "evalCpp")
importFrom (RcppParallel, "RcppParallelLibs", "setThreadOptions", "defaultNumThreads")

export (age.matrix)
export (bd.array)
export (classMembership)       # generic
export (cloned.fit)
export (cumMove)
export (dkernel)
export (expected.d)
export (extractFocal)
export (gkernel)
export (JS.counts)
export (JS.direct)
export (m.array)
export (make.kernel)
export (make.table)
export (matchscale)
export (moving.fit)
export (openCR.design)
export (openCR.esa)
export (openCR.fit)
export (openCR.pdot)
export (openCRlist)
export (par.openCR.fit)
export (pkernel)
export (primarysessions)
export (proportionInPolygon)
export (qkernel)
export (read.inp)
export (runsim.nonspatial)
export (runsim.RMark)
export (runsim.spatial)
export (secondarysessions)
export (sim.nonspatial)
export (squeeze)
export (strata)                # generic
export ('strata<-')
export (stratify)
export (sumsims)
export (ucare.cjs)   # temporarily blocked in version 2.2.4, restored 2.2.5
export (unsqueeze)

S3method('[', openCRlist)
S3method (AIC, openCR)
S3method (AIC, openCRlist)
S3method (AIC, summary.openCR)
S3method (classMembership, openCR)
S3method (c, openCRlist)
S3method (coef, openCR)
S3method (derived, openCR)
S3method (derived, openCRlist)
S3method (LLsurface, openCR)
S3method (logLik, openCR)
S3method (makeNewData, openCR)
S3method (modelAverage, openCR)
S3method (modelAverage, openCRlist)
S3method (collate, openCR)
S3method (collate, openCRlist)
S3method (plot, derivedopenCR)
S3method (plot, kernel)
S3method (plot, openCR)
S3method (predict, openCR)
S3method (predict, openCRlist)
S3method (print, derivedopenCR)
S3method (print, openCR)
S3method (print, summary.kernel)
S3method (print, summary.openCR)
S3method (rev, capthist)
S3method (strata, default)
S3method (summary, kernel)
S3method (summary, openCR)
S3method (vcov, openCR)

useDynLib (openCR, .registration = TRUE)

## DEBUGGING ONLY (cpp functions not documented)
## exportPattern("*cpp")