# only when we have src code
# useDynLib("restriktor")

importFrom("lavaan",
           lavParseModelString,
           lav_constraints_parse,
           lav_func_jacobian_complex,
           lav_partable_constraints_ciq,
           lav_partable_constraints_ceq,
           lav_matrix_symmetric_sqrt,
           lav_samplestats_from_data,
           lav_data_update,
           lav_partable_add,
           lav_model_implied,
           standardizedSolution,
           parTable,
           lavInspect,
           sem,
           lavaan)

importFrom("mvtnorm",
           rmvnorm)

importFrom("quadprog",
           solve.QP)

importFrom("boot",
           boot,
           boot.ci)

importFrom("MASS",
           psi.bisquare,
           psi.huber,
           ginv)

importFrom("mvtnorm",
           dmvnorm)

importFrom("ic.infer",
           #nchoosek, NOT EXPORTED!
           ic.weights)

importFrom("utils", "combn", "packageDescription", "menu")

importFrom("stats", "coef", "df.residual", "dnorm", "fitted",
           "formula", "frequency", "median", "model.matrix",
           "naresid", "pchisq", "pf", "pnorm", "printCoefmat", "pt",
           "quantile", "rchisq", "residuals", "rnorm", "rt", "runif",
           "sd", "start", "terms", "update", "var", "vcov",
           "weighted.residuals", "weights", "gaussian", "lm.fit",
           "lm.wfit", "mad", "coefficients", "family", "logLik",
           "model.frame", "anova", "optimize") 


importFrom("graphics", "abline", "axis", "box", "hist", "par")

# export ordinary functions defined in this package
export("restriktor", 
       "conLM.lm", "conRLM.rlm", "conGLM.glm", "conMLM.mlm", 
       "conTest", "iht", 
       "conTest_summary", "conTest_ceq", "conTestC",
       "conTestF.conLM", "conTestF.conRLM", "conTestF.conGLM", 
       "conTestLRT.conLM", "conTestLRT.conGLM", "conTestLRT.conMLM", 
       "conTestScore.conLM", "conTestScore.conRLM", "conTestScore.conGLM", 
       "conTestWald.conRLM", 
       "conTestC.restriktor", 
       "conTest_ceq.conLM", "conTest_ceq.conRLM", "conTest_ceq.conGLM", 
       "conTestD", "bootstrapD", 
       "goric", "print.con_goric", "print.conTestLavaan",
       "print.restriktor", "print.summary.restriktor",
       "summary.restriktor", "conTest_summary.restriktor",
       "print.conTest", "logLik.restriktor",
       "coef.restriktor", "model.matrix.restriktor",
       "con_weights_boot", "coef.con_goric", "summary.con_goric")#, "plot.conTestLavaan")

S3method(coef, restriktor)
S3method(model.matrix, restriktor)
S3method(logLik, restriktor)
S3method(print, restriktor)
S3method(print, conTest)
S3method(print, conTestLavaan)
S3method(print, summary.restriktor)
S3method(summary, restriktor)
S3method(print, con_goric)
S3method(summary, con_goric)
S3method(coef, con_goric)
#S3method(plot, conTestLavaan)

#S3method(conTestD, conLavaan)
S3method(conTestC, restriktor)
S3method(conTestLRT, conLM)
S3method(conTestLRT, conGLM)
S3method(conTestLRT, conMLM)
S3method(conTestScore, conLM)
S3method(conTestScore, conRLM)
S3method(conTestScore, conGLM)
S3method(conTestWald, conRLM)
S3method(conTestF, conLM)
S3method(conTestF, conRLM)
S3method(conTestF, conGLM)
S3method(conTest_ceq, conLM)
S3method(conTest_ceq, conRLM)
S3method(conTest_ceq, conGLM)
S3method(conTest_summary, restriktor)

S3method(conLM, lm)
S3method(conRLM, rlm)
S3method(conGLM, glm)
S3method(conMLM, mlm)

S3method(goric, restriktor)
S3method(goric, lm)
S3method(goric, lavaan)
S3method(goric, numeric)
S3method(goric, CTmeta)