useDynLib(mbest, .registration = TRUE, .fixes = "C_")

## base backages
importFrom("stats", .checkMFClasses, .getXlevels, coef, delete.response,
    family, fitted, gaussian, is.empty.model, model.extract, model.frame,
    model.offset, model.matrix, model.response, model.weights, na.pass,
    naresid, nobs, pnorm, predict, printCoefmat, pt, residuals, terms,
    update, vcov, weights, as.formula, setNames, rnorm,  runif, plogis)

## Recommended packages
importFrom("reformulas",  nobars, subbars, findbars, expandDoubleVerts)
importFrom("nlme", fixef, ranef, VarCorr)

importFrom("stats", sigma)

## Contributed packages
importFrom("bigmemory", as.big.matrix)
importFrom("logging", loginfo)
importFrom("foreach", foreach, "%dopar%")
importFrom("abind", abind)


## Exports
export(mhglm_sim)

export(VarCorr.mhglm)
export(firthglm.control)
export(firthglm.fit)
export(fixef.mhglm)
export(mhglm)
export(mhglm.control)
export(mhglm.fit)
export(ranef.mhglm)
export(sigma.mhglm)

export(VarCorr.mhglm_ml)
export(fixef.mhglm_ml)
export(mhglm_ml)
export(mhglm.control)
export(mhglm.fit)
export(ranef.mhglm_ml)
export(sigma.mhglm_ml)


## Methods
S3method(coef,mhglm)
S3method(family,mhglm)
S3method(fixef,mhglm)
S3method(fitted,mhglm)
S3method(model.frame,mhglm)
S3method(model.matrix,mhglm)
S3method(predict,mhglm)
S3method(print,VarCorr.mhglm)
S3method(print,mhglm)
S3method(print,summary.mhglm)
S3method(ranef,mhglm)
S3method(residuals,mhglm)
S3method(sigma,mhglm)
S3method(summary,mhglm)
S3method(terms,mhglm)
S3method(VarCorr,mhglm)
S3method(vcov,mhglm)
S3method(weights,mhglm)

S3method(coef,mhglm_ml)
S3method(family,mhglm_ml)
S3method(fixef,mhglm_ml)
S3method(fitted,mhglm_ml)
S3method(model.frame,mhglm_ml)
S3method(model.matrix,mhglm_ml)
S3method(predict,mhglm_ml)
S3method(print,mhglm_ml)
S3method(ranef,mhglm_ml)
S3method(residuals,mhglm_ml)
S3method(sigma,mhglm_ml)
S3method(summary,mhglm_ml)
S3method(terms,mhglm_ml)
S3method(VarCorr,mhglm_ml)
S3method(vcov,mhglm_ml)
S3method(weights,mhglm_ml)

