useDynLib(RTMB, .registration=TRUE)
importFrom(Rcpp, evalCpp)
importFrom(Rcpp, loadModule)
importClassesFrom(Matrix, sparseMatrix)
importFrom(Matrix, expm)
importFrom(MASS, mvrnorm)
importFrom(TMB, MakeADFun, sdreport)
importFrom("methods", "as", "callGeneric", "callNextMethod", "is", "new")
importFrom("utils", "as.relistable", "relist", "tail")
importFrom("stats", "rgamma", "rpois", "rnorm", "cov2cor", "qpois", "fft")
##exportPattern(".")
S3method(Ops, advector)
S3method(Math, advector)
S3method(as.vector, advector)
S3method(as.complex, advector)
##S3method(unlist, advector)
S3method(aperm, advector)
S3method(c, advector)
S3method(chol, advector)
S3method(determinant, advector)
S3method("[", advector)
S3method("[<-", advector)
S3method("[[", advector)
S3method(rep, advector)
S3method(diff, advector)
S3method(is.nan, advector)
S3method(is.finite, advector)
S3method(is.infinite, advector)
S3method(is.na, advector)
S3method(sum, advector)
S3method(mean, advector)
S3method(prod, advector)
S3method(min, advector)
S3method(max, advector)
S3method(print, advector)
S3method(is.numeric, advector)
S3method(as.double, advector)
S3method(Complex, advector)
S3method(Summary, advector)
S3method(rbind, advector)
S3method(cbind, advector)
S3method("$", Tape)
S3method(print, Tape)
S3method("[", osa)
S3method(length, osa)
S3method(dim, osa)
S3method(is.array, osa)
S3method(is.matrix, osa)
S3method(Ops, simref)
S3method(Math, simref)
S3method("[", simref)
S3method("[<-", simref)
S3method(length, simref)
S3method(dim, simref)
S3method("dim<-", simref)
S3method(is.array, simref)
S3method(is.matrix, simref)
S3method(as.array, simref)
S3method(is.na, simref)
S3method(t, simref)
S3method(diff, simref)
S3method(Summary, simref)
S3method(t, adsparse)
S3method("[", adsparse)
S3method("[<-", adsparse)
S3method("as.matrix", adsparse)

## ===============================================
## Generate full export table:
##     x <- ls("package:RTMB")
##     x <- x[!grepl("^_RTMB_",x)]
##     x <- x[!grepl("^distr_",x)]
##     cat(paste0('export("',x,'")\n'))
## ===============================================

export("rbind.advector")
export("cbind.advector")
export("colSums")
export("rowSums")
##export("_rcpp_module_boot_mod_adfun")
export("[.advector")
export("[.osa")
export("[.simref")
export("[[.advector")
export("[<-.advector")
export("[<-.simref")
export("$.Tape")
## export("ad_context")
## export("adfun")
export("AD")
export("ADjoint")
export("ADoverload")
export("ADREPORT")
## export("ADREPORT_ENV")
## export("advec")
export("advector") ## FIXME: Perhaps not export ?
export("aperm.advector")
export("apply")
## export("Arith2")
export("as.array.simref")
export("as.vector.advector")
export("besselI")
export("besselJ")
export("besselK")
export("besselY")
export("cov2cor")
export("c.advector")
export("checkConsistency")
## export("compare_allow")
export("Complex.advector")
## export("compois_calc_loglambda")
## export("compois_calc_logZ")
exportMethods("crossprod")
export("DataEval")
## export("data")
## export("data.term.indicator")
export("dbeta")
## export("dbgprint")
export("dbinom")
export("dbinom_robust")
export("dcompois")
export("dcompois2")
## export("dependent")
export("dexp")
export("df")
export("dgamma")
## export("dGenericOSA")
## export("dGenericSim")
export("dgmrf")
## export("dgmrf0")
export("diag")
## export("diff_patch")
export("diff.advector")
export("diff.simref")
export("dim.simref")
export("dim<-.simref")
export("dlgamma")
export("dlogis")
export("dautoreg")
export("dmvnorm")
export("dseparable")
## export("dmvnorm0")
export("dmultinom")
export("dnbinom")
export("dnbinom_robust")
export("dnbinom2")
export("dnorm")
export("dlnorm")
export("dpois")
export("dSHASHo")
export("dsn")
export("dt")
export("dtweedie")
export("dweibull")
export("eigen")
export("expAv")
## export("EvalADFunObject")
## export("EvalDoubleFunObject")
## export("FreeADFunObject")
## export("get_graph")
export("getAll")
export("GetTape")
## export("getFramework")
## export("getParameterOrder")
## export("getValues")
## export("getVariables")
export("ifelse")
## export("independent")
## export("InfoADFunObject")
export("interpol1Dfun")
export("interpol2Dfun")
export("is.array.simref")
export("is.matrix.simref")
export("is.na.simref")
export("is.numeric.advector")
export("length.simref")
export("logspace_add")
export("logspace_sub")
## export("magic")
export("MakeADFun")
## export("MakeADFunObject")
## export("MakeADGradObject")
## export("MakeADHessObject2")
## export("MakeDoubleFunObject")
export("MakeTape")
## export("math_expm")
export("Math.advector")
export("Math.simref")
## export("Math1")
## export("matmul")
export("matrix")
## export("NACHECK<-")
export("OBS")
## export("OBS_ENV")
## export("observation.name")
export("oneStepPredict")
export("Ops.advector")
export("Ops.simref")
export("pbeta")
export("pbinom")
export("pexp")
export("pgamma")
export("plogis")
export("pnorm")
export("ppois")
export("print.advector")
export("print.Tape")
export("prod.advector")
export("pweibull")
export("qbeta")
export("qexp")
export("qgamma")
export("qlogis")
export("qnorm")
export("qweibull")
## export("Reduce1")
export("rep.advector")
export("REPORT")
## export("REPORT_ENV")
## export("reporter")
## export("rtweedie")
export("sapply")
export("sdreport")
## export("set_tape_config")
## export("SIM_ENV")
export("simref")
## export("simref2")
export("solve")
## export("SparseArith2")
export("splinefun")
export("sum.advector")
export("Summary.advector")
export("Summary.simref")
export("svd")
export("t.simref")
export("TapeConfig")
exportMethods("tcrossprod")
## export("tmbad_print")
## export("TMBconfig")
## export("TransformADFunObject")
export("unstructured")
## export("usingAtomics")
## export("valid")
export("%~%")

########## adcomplex
export("adcomplex")
S3method("Re", adcomplex)
S3method("Im" ,adcomplex)
S3method("dim", adcomplex)
S3method("dim<-", adcomplex)
S3method("[", adcomplex)
S3method("[<-", adcomplex)
S3method("t", adcomplex)
S3method("length", adcomplex)
S3method("Conj", adcomplex)
S3method("Mod", adcomplex)
S3method("Arg", adcomplex)
S3method("+", adcomplex)
S3method("-", adcomplex)
S3method("*", adcomplex)
S3method("/", adcomplex)
S3method("exp", adcomplex)
S3method("log", adcomplex)
S3method("sqrt", adcomplex)
export("fft")
S3method("rep", adcomplex)
S3method("as.vector", adcomplex)
S3method("is.matrix", adcomplex)
S3method("as.matrix", adcomplex)
