import (parallel)
import (secr)

# Base R

importFrom("graphics", "abline", "hist", "lines", "mtext", "par",
           "plot", "points", "segments", "legend", "axis", "box", "polygon", "text")
importFrom("stats", "coef", "logLik", "lm", "pgamma", "predict", "qnorm", "quantile",
           "terms", "uniroot", "optimize", "approx", "dist", "pnorm", "symnum",
           "median", "sd", "rnorm", "runif")

importFrom("utils", 
    "flush.console", 
    "packageDescription", 
    "packageVersion")

importFrom("grDevices", 
    "topo.colors")

importFrom ("Rcpp", 
    "evalCpp")

# Other packages

importFrom ("abind", "adrop")

importFrom("sf",
    "st_as_sf",
    "st_buffer",
    "st_union",
    "st_make_grid",
    "st_coordinates",
    "st_intersection",
    "st_linestring",
    "st_multilinestring",
    "st_polygonize",
    "st_sfc"
    )

importFrom("kofnGA",
    "kofnGA")

export (make.scenarios)
export (scenariosFromStatistics)
export (run.scenarios)
export (fit.models)
export (select.stats)
export ('outputtype<-')
export (validate)
export (find.param)
export (find.stats)
export (make.array)
export (header)
export (Lambda)
# export (Lambdak)
export (Enrm)
export (getdetectpar)
export (minnrRSE)
export (optimalSpacing)
export (costing)
export (scenarioSummary)
export (saturation)
export (count)
export (GAoptim)
export (GApenfn)
export (compactSample)
export (Qpm)
export (En2)
export (expand.arg)

export (countSummary)
export (estimateArray)
export (estimateSummary)
export (transformOutput)

export (minsimRSE)

S3method (plot, optimalSpacing)
S3method (print, optimalSpacing)
S3method (minsimRSE, optimalSpacing)
S3method (print, summarysecrdesign)
S3method (summary, secrdesign)
S3method (summary, rawdata)
S3method (summary, estimatetables)
S3method (summary, selectedstatistics)
S3method (plot, selectedstatistics)
S3method (coef, fittedmodels)
S3method (predict, fittedmodels)
S3method (derived, fittedmodels)
S3method (region.N, fittedmodels)
S3method (count, summary)
S3method (predict, summary)
S3method (coef, summary)

S3method (c, estimatetables)
S3method (c, selectedstatistics)
S3method (rbind, estimatetables)
S3method (rbind, selectedstatistics)

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

useDynLib (secrdesign, .registration = TRUE)

