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

import(methods, igraph, MASS)

# stats
importFrom("stats", "optim", "dnorm", "qnorm", "pnorm", "rnorm", "rbinom", "sd", "ppoints", "uniroot", "var", "coef",
    "terms", "AIC", "BIC", "nobs", "formula", "update", "model.response", "model.matrix", "na.pass", "getCall")

# graphics
importFrom("graphics", "abline", "plot", "matplot", "par", "hist", "points", "polygon", "segments", "image", "axis",
    "legend", "contour", "mtext", "title", "matpoints", "text")

# grDevices
importFrom("grDevices", "dev.interactive", "adjustcolor", "dev.flush", "dev.hold", "n2mfrow", "dev.off", "devAskNewPage",
    "pdf", "gray.colors", "dev.list")

# utils
importFrom("utils", "head", "tail", "setTxtProgressBar", "txtProgressBar")

export(datacggm, is.datacggm, fit_matrix, getMatrix, event, rowNames, colNames, "rowNames<-", "colNames<-", lower, upper,
    ColMeans, ColVars, nresp, npred, rcggm, qqcnorm, ShowStructure, cglasso, cglasso.fit, impute, function2xy, cggm,
    cggm.fit, QFun, select_cglasso,  to_graph, is.cglasso2igraph, getGraph)

# S3method(is, datacggm)
S3method(dim, datacggm)
S3method(dimnames, datacggm)
S3method("dimnames<-", datacggm)
S3method(nobs, datacggm)
S3method(nresp, datacggm)
S3method(npred, datacggm)
S3method(Math, datacggm)
S3method(Ops, datacggm)
S3method(as.character, datacggm)
S3method(print, datacggm)
S3method(summary, datacggm)
S3method(hist, datacggm)

S3method(print, cglasso)
S3method(coef, cglasso)
S3method(fitted, cglasso)
S3method(residuals, cglasso)
S3method(predict, cglasso)
S3method(plot, cglasso)
S3method(summary, cglasso)
S3method(AIC, cglasso)
S3method(BIC, cglasso)

S3method(print, cggm)
S3method(predict, cggm)
S3method(plot, cggm)

S3method(print, QFun)
S3method(print, GoF)
S3method(plot, GoF)

S3method(print, cglasso2igraph)
# S3method(is, cglasso2igraph)
S3method(plot, cglasso2igraph)









