useDynLib(CDM)




####################################################
############# IMPORTS ##############################


#***************************************************
#*************** R Basics / Linking To *************

importFrom(graphics, abline)
importFrom(graphics, axis)
importFrom(graphics, barplot)
importFrom(graphics, hist)
importFrom(graphics, legend)
importFrom(graphics, lines)
importFrom(graphics, par)
importFrom(graphics, plot)
importFrom(graphics, points)
importFrom(graphics, rect)
importFrom(graphics, text)
importFrom(grDevices, dev.off)
importFrom(grDevices, pdf)
importFrom(methods, is)
importFrom(Rcpp, evalCpp)
importFrom(stats, aggregate)
importFrom(stats, anova)
importFrom(stats, as.formula)
importFrom(stats, coef)
importFrom(stats, confint)
importFrom(stats, cor)
importFrom(stats, cov2cor)
importFrom(stats, dnorm)
importFrom(stats, fitted)
importFrom(stats, lm)
importFrom(stats, loess)
importFrom(stats, logLik)
importFrom(stats, median)
importFrom(stats, model.matrix)
importFrom(stats, na.omit)
importFrom(stats, p.adjust)
importFrom(stats, pchisq)
importFrom(stats, plogis)
importFrom(stats, pnorm)
importFrom(stats, predict)
importFrom(stats, qlogis)
importFrom(stats, qnorm)
importFrom(stats, rbinom)
importFrom(stats, runif)
importFrom(stats, sd)
importFrom(stats, terms)
importFrom(stats, vcov)
importFrom(stats, weighted.mean)
importFrom(utils, combn)
importFrom(utils, flush.console)
importFrom(utils, packageDescription)
importFrom(utils, sessionInfo)



#***************************************************
#************** Depends ****************************

import(mvtnorm)


#***************************************************
#************** Imports ****************************


importFrom(polycor, polychor)


#***************************************************
#************** Suggests ****************************

# requireNamespace("another_package")
# CDM_require_namespace("CDM_another_package")

# importFrom(BIFIEsurvey, BIFIE.data.jack)
# importFrom(BIFIEsurvey, BIFIE.data.boot)
# importFrom(lattice, xyplot)
# importFrom(MASS, ginv)
# importFrom(psych, fa)
# importFrom(sfsmisc, QUnif)
# importFrom(sirt, rowCumsums.sirt)
# importFrom(sirt, rowIntervalIndex.sirt)


########################################################
################ EXPORTS ###############################

export(abs_approx)
export(abs_approx_D1)
export(cat_paste)
export(cdi.kli)
export(cdm.est.class.accuracy)
export(cdm_attach_internal_function)
export(cdm_calc_information_criteria)
export(cdm_fa1)
export(cdm_fit_normal)
export(cdm_fit_normal)
export(cdm_matrix1)
export(cdm_matrix2)
export(cdm_matrixstring)
export(cdm_parameter_regularization)
export(cdm_pem_acceleration)
export(cdm_pem_acceleration_assign_output_parameters)
export(cdm_pem_inits)
export(cdm_pem_inits_assign_parmlist)
export(cdm_penalty_threshold_elnet)
export(cdm_penalty_threshold_mcp)
export(cdm_penalty_threshold_ridge)
export(cdm_penalty_threshold_scad)
export(cdm_penalty_threshold_scadL2)
export(cdm_penalty_threshold_tlp)
export(cdm_penalty_values)
export(cdm_print_summary_call)
export(cdm_print_summary_computation_time)
export(cdm_print_summary_data_frame)
export(cdm_print_summary_information_criteria)
export(CDM_rbind_fill)
export(CDM_require_namespace)
export(CDM_rmvnorm)
export(csink)
export(deltaMethod)
export(din)
export(din_identifiability)
export(din.deterministic)
export(din.equivalent.class)
export(din.validate.qmatrix)
export(discrim.index)
export(entropy.lca)
export(equivalent.dina)
export(eval_likelihood)
export(gdd)
export(gdina)
export(gdina.dif)
export(gdina.wald)
export(gdm)
export(ideal.response.pattern)
export(IRT.anova)
export(IRT.classify)
export(IRT.compareModels)
export(IRT.data)
export(IRT.derivedParameters)
export(IRT.expectedCounts)
export(IRT.factor.scores)
export(IRT.frequencies)
export(IRT.IC)
export(IRT.irfprob)
export(IRT.irfprobPlot)
export(IRT.itemfit)
export(IRT.jackknife)
export(IRT.likelihood)
export(IRT.marginal_posterior)
export(IRT.modelfit)
export(IRT.parameterTable )
export(IRT.posterior)
export(IRT.predict)
export(IRT.repDesign)
export(IRT.RMSD)
export(IRT.se)
export(IRT_frequencies_default)
export(IRT_frequencies_wrapper)
export(IRT_RMSD_calc_rmsd)
export(item_by_group)
export(itemfit.rmsea)
export(itemfit.sx2)
export(mcdina)
export(modelfit.cor)
export(modelfit.cor.din)
export(modelfit.cor2)
export(numerical_gradient)
export(numerical_Hessian)
export(numerical_Hessian_partial)
export(osink)
export(personfit.appropriateness)
export(plot_item_mastery)
export(reglca)
export(sequential.items)
export(sim.din)
export(sim.gdina)
export(sim.gdina.prepare)
export(sim_model)
export(skill.cor)
export(skill.polychor)
export(skillspace.approximation)
export(skillspace.full)
export(skillspace.hierarchy)
export(slca)
export(summary_sink)
export(WaldTest)


# internal functions; not intended to be visible to users
# export(check.input, rowMaxs, rowProds2, plot.din, print.din, summary.din,
#        print.summary.din)



#####################################################
######### S3 methods ################################



S3method(anova, din)
S3method(anova, gdina)
S3method(anova, gdm)
S3method(anova, mcdina)
S3method(anova, reglca)
S3method(anova, slca)
S3method(coef, din)
S3method(coef, gdina)
S3method(coef, gdm)
S3method(coef, IRT.jackknife)
S3method(coef, mcdina)
S3method(coef, slca)
S3method(confint,din)
S3method(discrim.index, din)
S3method(discrim.index, gdina)
S3method(IRT.data, din)
S3method(IRT.data, gdina)
S3method(IRT.data, gdm)
S3method(IRT.data, mcdina)
S3method(IRT.data, reglca)
S3method(IRT.data, slca)
S3method(IRT.frequencies, din)
S3method(IRT.frequencies, gdina)
S3method(IRT.frequencies, gdm)
S3method(IRT.frequencies, mcdina)
S3method(IRT.frequencies, slca)
S3method(IRT.expectedCounts, din)
S3method(IRT.expectedCounts, gdina)
S3method(IRT.expectedCounts, gdm)
S3method(IRT.expectedCounts, mcdina)
S3method(IRT.expectedCounts, reglca)
S3method(IRT.expectedCounts, slca)
S3method(IRT.factor.scores, din)
S3method(IRT.factor.scores, gdina)
S3method(IRT.factor.scores, gdm)
S3method(IRT.factor.scores, mcdina)
S3method(IRT.factor.scores, slca)
S3method(IRT.irfprob, din)
S3method(IRT.irfprob, gdina)
S3method(IRT.irfprob, gdm)
S3method(IRT.irfprob, mcdina)
S3method(IRT.irfprob, reglca)
S3method(IRT.irfprob, slca)
S3method(IRT.itemfit, din)
S3method(IRT.itemfit, gdina)
S3method(IRT.itemfit, gdm)
S3method(IRT.itemfit, reglca)
S3method(IRT.itemfit, slca)
S3method(IRT.jackknife, gdina)
S3method(IRT.likelihood, din)
S3method(IRT.likelihood, gdina)
S3method(IRT.likelihood, gdm)
S3method(IRT.likelihood, mcdina)
S3method(IRT.likelihood, reglca)
S3method(IRT.likelihood, slca)
S3method(IRT.modelfit, din)
S3method(IRT.modelfit, gdina)
S3method(IRT.marginal_posterior, din)
S3method(IRT.marginal_posterior, gdina)
S3method(IRT.marginal_posterior, mcdina)
S3method(IRT.posterior, din)
S3method(IRT.posterior, gdina)
S3method(IRT.posterior, gdm)
S3method(IRT.posterior, mcdina)
S3method(IRT.posterior, slca)
S3method(IRT.posterior, reglca)
S3method(IRT.se, din)
S3method(logLik, din)
S3method(logLik, gdina)
S3method(logLik, gdm)
S3method(logLik, mcdina)
S3method(logLik, slca)
S3method(logLik, reglca)
S3method(plot, din)
S3method(plot, gdina)
S3method(plot, gdm)
S3method(plot, itemfit.sx2)
S3method(plot, personfit.appropriateness)
S3method(plot, slca)
S3method(plot_item_mastery, din)
S3method(plot_item_mastery, gdina)
S3method(predict,din)
S3method(predict,gdina)
S3method(predict,gdm)
S3method(predict,mcdina)
S3method(predict,slca)
S3method(print, din)
S3method(print, gdina)
S3method(print, gdm)
S3method(print, mcdina)
S3method(print, slca)
S3method(print, summary.din)
S3method(summary, cdi.kli)
S3method(summary, din)
S3method(summary, din_identifiability)
S3method(summary, discrim.index)
S3method(summary, entropy.lca)
S3method(summary, gdina)
S3method(summary, gdina.dif)
S3method(summary, gdina.wald)
S3method(summary, gdm)
S3method(summary, IRT.compareModels)
S3method(summary, IRT.jackknife)
S3method(summary, IRT.RMSD)
S3method(summary, itemfit.sx2)
S3method(summary, mcdina)
S3method(summary, modelfit.cor.din)
S3method(summary, personfit.appropriateness)
S3method(summary, reglca)
S3method(summary, slca)
S3method(vcov, din)
S3method(vcov, IRT.jackknife)
