import("stats", "graphics", "zoo", "sandwich")
importFrom("utils", "globalVariables")

export(
## testing
  "efp",
  "gefp",
  "Fstats",

## monitoring  
  "mefp",
  "monitor",

## dating
  "breakpoints",
  "breakdates",
  "breakfactor",

## efp functionals
  "efpFunctional",
  "maxBM",
  "maxBB",
  "maxBMI",
  "maxBBI",
  "maxL2BB",
  "meanL2BB",
  "rangeBM",
  "rangeBB",
  "rangeBMI",
  "rangeBBI",
  "supLM",
  "maxMOSUM",
  "catL2BB",
  "ordL2BB",
  "ordwmax",

## new generics
  "sctest",
  "boundary",
  "recresid",

## utilities
  "recresid.default",
  "simulateBMDist",
  "root.matrix",
  "solveCrossprod",

## internal objects
## (currently still exported, needs fixing)
  "pvalue.efp",
  "pvalue.Fstats",
  "pargmaxV",
  "sc.beta.sup",
  "sc.beta.ave",
  "sc.beta.exp",
  "sc.me",
  "sc.meanL2",
  "sc.maxL2",
  "monitorMECritval",
  "monitorMECritvalData",
  "monitorMECritvalTable",
  "monitorRECritval",
  "monitorRECritvalData",
  "monitorRECritvalTable")

## methods to new generics
S3method("sctest", "default")
S3method("sctest", "formula")
S3method("sctest", "efp")
S3method("sctest", "gefp")
S3method("sctest", "Fstats")

S3method("boundary", "efp")
S3method("boundary", "Fstats")
S3method("boundary", "mefp")

S3method("breakpoints", "formula")
S3method("breakpoints", "breakpointsfull")
S3method("breakpoints", "Fstats")

S3method("breakdates", "breakpoints")
S3method("breakdates", "confint.breakpoints")

S3method("mefp", "formula")
S3method("mefp", "efp")

S3method("recresid", "formula")
S3method("recresid", "lm")
S3method("recresid", "default")

## methods to standard generics
S3method("plot", "efp")
S3method("print", "efp")
S3method("lines", "efp")

S3method("print", "gefp")
S3method("plot", "gefp")
S3method("time", "gefp")

S3method("plot", "Fstats")
S3method("print", "Fstats")
S3method("lines", "Fstats")

S3method("plot", "mefp")
S3method("print", "mefp")
S3method("lines", "mefp")

S3method("print", "breakpoints")
S3method("lines", "breakpoints")
S3method("logLik", "breakpoints")
S3method("summary", "breakpoints")

S3method("logLik", "breakpointsfull")
S3method("AIC", "breakpointsfull")
S3method("summary", "breakpointsfull")
S3method("plot", "breakpointsfull")
S3method("confint", "breakpointsfull")
S3method("coef", "breakpointsfull")
S3method("vcov", "breakpointsfull")
S3method("fitted", "breakpointsfull")
S3method("residuals", "breakpointsfull")
S3method("df.residual", "breakpointsfull")

S3method("plot", "summary.breakpointsfull")
S3method("print", "summary.breakpointsfull")

S3method("print", "confint.breakpoints")
S3method("lines", "confint.breakpoints")

useDynLib(strucchange, .registration = TRUE)

