
useDynLib("mlt", .registration = TRUE)

import("basefun")
import("variables")
importFrom("Matrix", "Matrix", "colSums", "rowSums", "crossprod", "bdiag")
import("numDeriv") ### needed by BB???
import("mvtnorm")
importFrom("BB", "spg", "BBoptim")
importFrom("alabama", "auglag")
importFrom("nloptr", "nloptr")
importFrom("sandwich", "estfun", "bread")
importFrom("icenReg", "ic_np")
importFrom("stats", "simulate", "variable.names", "model.matrix", "logLik",
           "vcov", "AIC", "coef", "confint", "dlogis", "dnorm",
           "lm.fit", "plogis", "pnorm", "predict", "qlogis", "qnorm",
           "runif", "stepfun", "weights", "approxfun", "xtabs", "resid",
           "complete.cases", "dexp", "pexp", "qexp",
           "approx", "optimise", "spline", "update",
           "dcauchy", "pcauchy", "qcauchy", "rnorm", "var", "optim",
           "constrOptim", "optimHess", "splinefun", "quantile")

importFrom("quadprog", "solve.QP")
importFrom("coneproj", "qprog")
importFrom("grDevices", "rgb")
importFrom("graphics", "axis", "box", "lines", "plot")
importFrom("methods", "as")
importFrom("survival", "Surv", "survfit")

export(R, "coef<-", mlt, ctm, confband, Hessian, Gradient, as.mlt, 
       mltoptim, as.Surv, mmlt, has_scale)
#, paraboot, description
# Hmlt dmlt, hmlt, pmlt, qmlt, smlt, tmlt

S3method("update", "mlt_fit")

S3method("predict", "mlt")
S3method("predict", "ctm")
S3method("simulate", "mlt")
S3method("simulate", "ctm")
S3method("coef", "mlt")
S3method("coef", "ctm")
S3method("variable.names", "mlt")
S3method("mkgrid", "mlt")
S3method("logLik", "mlt")
S3method("vcov", "mlt")
S3method("coef<-", "mlt")
S3method("coef<-", "ctm")
S3method("summary", "mlt")
S3method("print", "mlt")
S3method("print", "summary.mlt")
S3method("R", "Surv")
S3method("R", "factor")
S3method("R", "ordered")
S3method("R", "numeric")
S3method("R", "integer")
S3method("R", "interval")
S3method("R", "list")
S3method("R", "response")
S3method("R", "logical")
S3method("R", "default")
S3method("print", "response")
S3method("bounds", "mlt")
S3method("bounds", "ctm")

S3method("variable.names", "ctm")
S3method("mkgrid", "ctm")
S3method("model.matrix", "ctm")
S3method("confband", "mlt")
S3method("plot", "mlt")
S3method("plot", "ctm")
S3method("weights", "mlt")
S3method("Hessian", "mlt")
S3method("Gradient", "mlt")

S3method("as.mlt", "mlt")

S3method("as.Surv", "response")
S3method("as.Surv", "numeric")
S3method("[", "response")
S3method("[<-", "response")
S3method("as.double", "response")

#S3method("model.matrix", "mlt")
#S3method("paraboot", "mlt")

S3method("estfun", "mlt")
S3method("residuals", "mlt")
S3method("bread", "mlt")
S3method("bread", "mlt_fit")

S3method("coef", "fmlt")
S3method("Hessian", "fmlt")
S3method("vcov", "fmlt")

S3method("logLik", "mmlt")
S3method("estfun", "mmlt")
S3method("coef", "cmmlt")
S3method("coef", "mmmlt")
S3method("coef<-", "mmlt")
S3method("vcov", "mmlt")
S3method("predict", "mmlt")
S3method("summary", "mmlt")
S3method("print", "mmlt")
S3method("simulate", "mmlt")
S3method("variable.names", "mmlt")
S3method("mkgrid", "mmlt")
S3method("Hessian", "mmlt")
S3method("Gradient", "mmlt")
S3method("weights", "mmlt")

S3method("pstart", "numeric")
S3method("pstart", "factor")
S3method("pstart", "Surv")
S3method("pstart", "response")

S3method("findsupport", "numeric")
S3method("findsupport", "Surv")
S3method("findsupport", "response")

S3method("pretrafo", "numeric")
S3method("pretrafo", "Surv")
S3method("pretrafo", "response")
S3method("pretrafo", "ordered")

