useDynLib(TAM)

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

export(designMatrices, .A.matrix, designMatrices.mfr,
       tam.fit, 
       tam.jml,
       tam.mml.fit , 
       tam.jml.WLE, 
       tam.jml2, 
       tam.pv, 
       tam, tam.mml, tam.mml.2pl, tam.mml.mfr, 
       tam.se, tam.wle , .A.PCM2 , .A.PCM3 , 
       tam.threshold , tam ,
       tam.ctt , tam.mml.wle , tam.mml.wle2 ,
       tam.ctt2 , tam.fa ,
       plotDevianceTAM , tam.ctt3 , tam.mml.3pl ,
       designMatrices.mfr2 ,
       tam.modelfit ,
       plotctt ,
       lavaanify.IRT ,
       tamaan , 
       tamaanify ,
       doparse,
       tampv2datalist,
       tam.latreg ,
       cfa.extract.itempars,
       IRTLikelihood.cfa ,
       tam.modelfit.IRT ,
       tam.modelfit.args ,
       msq.itemfit ,
       IRT.linearCFA ,
       IRT.threshold ,
       IRT.WrightMap
       )




# internal functions; not intended to be visible to users
# export(calc_exp_TK, calc_posterior.v2, calc_prob.v5, 
#        mstep.regression, Mstep_slope, Mstep_slope.v2,
#        print.designMatrices, resp.pattern3, rowcumsums, rowMaxs,
#        stud_prior.v2, tam.jml.xsi, tam.jml.xsi2, theta.sq)


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

#### anova
S3method(anova, tam.mml )
S3method(anova, tam )
S3method(anova, tam.mml.3pl)
S3method(anova, tamaan)
S3method(anova, tam.latreg)


#### logLik
S3method(logLik, tam.mml )
S3method(logLik, tam )
S3method(logLik, tam.mml.3pl)
S3method(logLik, tamaan )
S3method(logLik, tam.latreg )


#### plot
S3method( plot , tam )
S3method( plot , tam.mml )
S3method( plot , tam.jml )

#### predict
S3method(predict, tam.mml )
S3method(predict, tam.mml.3pl )
S3method(predict, tamaan )

#### print
S3method(print, IRT.threshold)

#### summary
S3method(summary, tam )
S3method(summary, tam.mml )
S3method(summary, tam.mml.3pl )
S3method(summary, tam.modelfit )
S3method(summary, tam.jml )
S3method(summary, tamaan )
S3method(summary, tam.latreg )
S3method(summary, tam.fit )
S3method(summary, IRT.modelfit.tam.mml )
S3method(summary, IRT.modelfit.tam.mml.3pl )
S3method(summary, IRT.modelfit.tamaan )
S3method(summary, IRT.linearCFA)


########################################
###### S3 methods IRT.xx ###############


#### IRT.data
S3method(IRT.data, tam.mml )
S3method(IRT.data, tam.mml.3pl)
S3method(IRT.data, tamaan )



#### IRT.expectedCounts
S3method(IRT.expectedCounts, tam.mml )
S3method(IRT.expectedCounts, tam )
S3method(IRT.expectedCounts, tam.mml.3pl)
S3method(IRT.expectedCounts, tamaan )


#### IRT.factor.scores
S3method(IRT.factor.scores, tam.mml )
S3method(IRT.factor.scores, tam )
S3method(IRT.factor.scores, tam.mml.3pl)
S3method(IRT.factor.scores, tamaan )


#### IRT.irfprob
S3method(IRT.irfprob, tam.mml )
S3method(IRT.irfprob, tam )
S3method(IRT.irfprob, tam.mml.3pl)
S3method(IRT.irfprob, tamaan )


#### IRT.likelihood
S3method(IRT.likelihood, tam.mml )
S3method(IRT.likelihood, tam )
S3method(IRT.likelihood, tam.mml.3pl)
S3method(IRT.likelihood, tamaan )
S3method(IRT.likelihood, tam.latreg )

#### IRT.modelfit
S3method(IRT.modelfit, tam.mml )
S3method(IRT.modelfit, tam.mml.3pl)
S3method(IRT.modelfit, tamaan )


#### IRT.posterior
S3method(IRT.posterior, tam.mml )
S3method(IRT.posterior, tam )
S3method(IRT.posterior, tam.mml.3pl)
S3method(IRT.posterior, tamaan)
S3method(IRT.posterior, tam.latreg)


#### IRT.WrightMap
S3method(IRT.WrightMap, tam.mml )
S3method(IRT.WrightMap, tamaan)
S3method(IRT.WrightMap, IRT.threshold)



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

import(mvtnorm)
import(tensor)
import(MASS)
import(GPArotation)
importFrom( sfsmisc , QUnif  )
importFrom( psych , schmid )
importFrom( Rcpp , evalCpp )
import(CDM)
import(lattice)
import(mirt)
import(lavaan)
importFrom(utils,packageDescription)
importFrom(msm,dtnorm)
importFrom(msm,rtnorm)
importFrom(WrightMap,wrightMap)
