//// File Name: RcppExports.cpp
//// File Version: 4.002133
// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <RcppArmadillo.h>

using namespace Rcpp; using namespace arma;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// gooijer_csn_table
Rcpp::List gooijer_csn_table(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_perm, int RR, int NS, int progress, Rcpp::NumericVector progress_vec, Rcpp::NumericMatrix score_index);
RcppExport SEXP _sirt_gooijer_csn_table(SEXP datSEXP, SEXP dat_permSEXP, SEXP RRSEXP, SEXP NSSEXP, SEXP progressSEXP, SEXP progress_vecSEXP, SEXP score_indexSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_perm(dat_permSEXP);
    Rcpp::traits::input_parameter< int >::type RR(RRSEXP);
    Rcpp::traits::input_parameter< int >::type NS(NSSEXP);
    Rcpp::traits::input_parameter< int >::type progress(progressSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type progress_vec(progress_vecSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type score_index(score_indexSEXP);
    rcpp_result_gen = Rcpp::wrap(gooijer_csn_table(dat, dat_perm, RR, NS, progress, progress_vec, score_index));
    return rcpp_result_gen;
END_RCPP
}
// isop_tests_C
Rcpp::List isop_tests_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericVector weights, Rcpp::NumericVector jackunits, int JJ);
RcppExport SEXP _sirt_isop_tests_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP weightsSEXP, SEXP jackunitsSEXP, SEXP JJSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type jackunits(jackunitsSEXP);
    Rcpp::traits::input_parameter< int >::type JJ(JJSEXP);
    rcpp_result_gen = Rcpp::wrap(isop_tests_C(dat, dat_resp, weights, jackunits, JJ));
    return rcpp_result_gen;
END_RCPP
}
// interval_index_C
Rcpp::NumericVector interval_index_C(Rcpp::NumericMatrix MATR, Rcpp::NumericVector RN);
RcppExport SEXP _sirt_interval_index_C(SEXP MATRSEXP, SEXP RNSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type MATR(MATRSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type RN(RNSEXP);
    rcpp_result_gen = Rcpp::wrap(interval_index_C(MATR, RN));
    return rcpp_result_gen;
END_RCPP
}
// rowCumsums2_source
Rcpp::NumericMatrix rowCumsums2_source(Rcpp::NumericMatrix input);
RcppExport SEXP _sirt_rowCumsums2_source(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(rowCumsums2_source(input));
    return rcpp_result_gen;
END_RCPP
}
// rowKSmallest_C
Rcpp::List rowKSmallest_C(Rcpp::NumericMatrix MATR, Rcpp::IntegerVector KK1, Rcpp::NumericMatrix INDEXMATR, Rcpp::NumericMatrix RNMATR);
RcppExport SEXP _sirt_rowKSmallest_C(SEXP MATRSEXP, SEXP KK1SEXP, SEXP INDEXMATRSEXP, SEXP RNMATRSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type MATR(MATRSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type KK1(KK1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type INDEXMATR(INDEXMATRSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type RNMATR(RNMATRSEXP);
    rcpp_result_gen = Rcpp::wrap(rowKSmallest_C(MATR, KK1, INDEXMATR, RNMATR));
    return rcpp_result_gen;
END_RCPP
}
// rowMaxsCPP_source
Rcpp::List rowMaxsCPP_source(Rcpp::NumericMatrix MATR);
RcppExport SEXP _sirt_rowMaxsCPP_source(SEXP MATRSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type MATR(MATRSEXP);
    rcpp_result_gen = Rcpp::wrap(rowMaxsCPP_source(MATR));
    return rcpp_result_gen;
END_RCPP
}
// rowmins2_bundle_C
Rcpp::NumericMatrix rowmins2_bundle_C(Rcpp::NumericMatrix m1, Rcpp::NumericVector v1);
RcppExport SEXP _sirt_rowmins2_bundle_C(SEXP m1SEXP, SEXP v1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type m1(m1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type v1(v1SEXP);
    rcpp_result_gen = Rcpp::wrap(rowmins2_bundle_C(m1, v1));
    return rcpp_result_gen;
END_RCPP
}
// calc_copula_itemcluster_C
Rcpp::List calc_copula_itemcluster_C(Rcpp::NumericVector DD, Rcpp::NumericMatrix res);
RcppExport SEXP _sirt_calc_copula_itemcluster_C(SEXP DDSEXP, SEXP resSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DD(DDSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type res(resSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_copula_itemcluster_C(DD, res));
    return rcpp_result_gen;
END_RCPP
}
// md_pattern_csource
Rcpp::List md_pattern_csource(Rcpp::NumericMatrix dat);
RcppExport SEXP _sirt_md_pattern_csource(SEXP datSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    rcpp_result_gen = Rcpp::wrap(md_pattern_csource(dat));
    return rcpp_result_gen;
END_RCPP
}
// mle_pcm_group_C
Rcpp::List mle_pcm_group_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericMatrix groupM, Rcpp::NumericMatrix b, Rcpp::NumericVector a, Rcpp::NumericVector maxK, Rcpp::NumericVector theta0, double conv, int maxiter);
RcppExport SEXP _sirt_mle_pcm_group_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP groupMSEXP, SEXP bSEXP, SEXP aSEXP, SEXP maxKSEXP, SEXP theta0SEXP, SEXP convSEXP, SEXP maxiterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type groupM(groupMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type maxK(maxKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta0(theta0SEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< int >::type maxiter(maxiterSEXP);
    rcpp_result_gen = Rcpp::wrap(mle_pcm_group_C(dat, dat_resp, groupM, b, a, maxK, theta0, conv, maxiter));
    return rcpp_result_gen;
END_RCPP
}
// mle_pcm_C
Rcpp::List mle_pcm_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericMatrix b, Rcpp::NumericVector a, Rcpp::NumericVector maxK, Rcpp::NumericVector theta0, double conv, int maxiter);
RcppExport SEXP _sirt_mle_pcm_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP bSEXP, SEXP aSEXP, SEXP maxKSEXP, SEXP theta0SEXP, SEXP convSEXP, SEXP maxiterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type maxK(maxKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta0(theta0SEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< int >::type maxiter(maxiterSEXP);
    rcpp_result_gen = Rcpp::wrap(mle_pcm_C(dat, dat_resp, b, a, maxK, theta0, conv, maxiter));
    return rcpp_result_gen;
END_RCPP
}
// probs_pcm_groups_C
Rcpp::List probs_pcm_groups_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericVector group, Rcpp::NumericMatrix probs, int CC, int TP);
RcppExport SEXP _sirt_probs_pcm_groups_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP groupSEXP, SEXP probsSEXP, SEXP CCSEXP, SEXP TPSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type group(groupSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    rcpp_result_gen = Rcpp::wrap(probs_pcm_groups_C(dat, dat_resp, group, probs, CC, TP));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_probs_pcm_groups_C
Rcpp::NumericMatrix sirt_rcpp_probs_pcm_groups_C(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp, Rcpp::IntegerVector group, Rcpp::NumericMatrix probs, int CC, int TP);
RcppExport SEXP _sirt_sirt_rcpp_probs_pcm_groups_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP groupSEXP, SEXP probsSEXP, SEXP CCSEXP, SEXP TPSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type group(groupSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_probs_pcm_groups_C(dat, dat_resp, group, probs, CC, TP));
    return rcpp_result_gen;
END_RCPP
}
// probs_pcm_nogroups_C
Rcpp::List probs_pcm_nogroups_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericMatrix probs, int CC, int TP);
RcppExport SEXP _sirt_probs_pcm_nogroups_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP probsSEXP, SEXP CCSEXP, SEXP TPSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    rcpp_result_gen = Rcpp::wrap(probs_pcm_nogroups_C(dat, dat_resp, probs, CC, TP));
    return rcpp_result_gen;
END_RCPP
}
// calccounts_pcm_groups_C
Rcpp::List calccounts_pcm_groups_C(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericVector group, Rcpp::NumericMatrix fyiqk, Rcpp::NumericMatrix pik, int CC, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_calccounts_pcm_groups_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP groupSEXP, SEXP fyiqkSEXP, SEXP pikSEXP, SEXP CCSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type group(groupSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fyiqk(fyiqkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type pik(pikSEXP);
    Rcpp::traits::input_parameter< int >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(calccounts_pcm_groups_C(dat, dat_resp, group, fyiqk, pik, CC, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_calccounts_pcm_groups_C
Rcpp::List sirt_rcpp_calccounts_pcm_groups_C(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp, Rcpp::IntegerVector group, Rcpp::NumericMatrix fyiqk, Rcpp::NumericMatrix pik, int CC, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_calccounts_pcm_groups_C(SEXP datSEXP, SEXP dat_respSEXP, SEXP groupSEXP, SEXP fyiqkSEXP, SEXP pikSEXP, SEXP CCSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type group(groupSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fyiqk(fyiqkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type pik(pikSEXP);
    Rcpp::traits::input_parameter< int >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_calccounts_pcm_groups_C(dat, dat_resp, group, fyiqk, pik, CC, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_array_mult
Rcpp::NumericMatrix sirt_rcpp_array_mult(Rcpp::NumericMatrix AA, Rcpp::NumericVector dimAA, Rcpp::NumericMatrix BB, Rcpp::NumericVector dimBB);
RcppExport SEXP _sirt_sirt_rcpp_array_mult(SEXP AASEXP, SEXP dimAASEXP, SEXP BBSEXP, SEXP dimBBSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type AA(AASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type dimAA(dimAASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type BB(BBSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type dimBB(dimBBSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_array_mult(AA, dimAA, BB, dimBB));
    return rcpp_result_gen;
END_RCPP
}
// RM_CALCPOST
Rcpp::List RM_CALCPOST(Rcpp::NumericMatrix DAT2, Rcpp::NumericMatrix DAT2RESP, Rcpp::NumericMatrix PROBS, Rcpp::NumericVector KK);
RcppExport SEXP _sirt_RM_CALCPOST(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP, SEXP KKSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type KK(KKSEXP);
    rcpp_result_gen = Rcpp::wrap(RM_CALCPOST(DAT2, DAT2RESP, PROBS, KK));
    return rcpp_result_gen;
END_RCPP
}
// rm_probraterfct1
Rcpp::List rm_probraterfct1(Rcpp::NumericMatrix CRA, Rcpp::NumericVector DRA, Rcpp::IntegerVector dimAA, Rcpp::NumericMatrix BB, Rcpp::IntegerVector dimBB);
RcppExport SEXP _sirt_rm_probraterfct1(SEXP CRASEXP, SEXP DRASEXP, SEXP dimAASEXP, SEXP BBSEXP, SEXP dimBBSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type CRA(CRASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DRA(DRASEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type dimAA(dimAASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type BB(BBSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type dimBB(dimBBSEXP);
    rcpp_result_gen = Rcpp::wrap(rm_probraterfct1(CRA, DRA, dimAA, BB, dimBB));
    return rcpp_result_gen;
END_RCPP
}
// rm_facets_calcprobs_cpp
Rcpp::NumericMatrix rm_facets_calcprobs_cpp(Rcpp::NumericVector b_item, Rcpp::NumericVector b_rater, Rcpp::NumericMatrix Qmatrix, Rcpp::NumericMatrix tau_item, int K, int I, int TP, Rcpp::NumericVector a_item, Rcpp::NumericVector a_rater, Rcpp::NumericVector item_index, Rcpp::NumericVector rater_index, Rcpp::NumericVector theta_k);
RcppExport SEXP _sirt_rm_facets_calcprobs_cpp(SEXP b_itemSEXP, SEXP b_raterSEXP, SEXP QmatrixSEXP, SEXP tau_itemSEXP, SEXP KSEXP, SEXP ISEXP, SEXP TPSEXP, SEXP a_itemSEXP, SEXP a_raterSEXP, SEXP item_indexSEXP, SEXP rater_indexSEXP, SEXP theta_kSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b_item(b_itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b_rater(b_raterSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Qmatrix(QmatrixSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type tau_item(tau_itemSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a_item(a_itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a_rater(a_raterSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type item_index(item_indexSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rater_index(rater_indexSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta_k(theta_kSEXP);
    rcpp_result_gen = Rcpp::wrap(rm_facets_calcprobs_cpp(b_item, b_rater, Qmatrix, tau_item, K, I, TP, a_item, a_rater, item_index, rater_index, theta_k));
    return rcpp_result_gen;
END_RCPP
}
// SMIRT_CALCPOST
Rcpp::List SMIRT_CALCPOST(Rcpp::IntegerMatrix DAT2, Rcpp::IntegerMatrix DAT2RESP, Rcpp::NumericMatrix PROBS, Rcpp::NumericMatrix DAT2IND, Rcpp::NumericVector PIK, Rcpp::NumericVector KK1);
RcppExport SEXP _sirt_SMIRT_CALCPOST(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP, SEXP DAT2INDSEXP, SEXP PIKSEXP, SEXP KK1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2IND(DAT2INDSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type PIK(PIKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type KK1(KK1SEXP);
    rcpp_result_gen = Rcpp::wrap(SMIRT_CALCPOST(DAT2, DAT2RESP, PROBS, DAT2IND, PIK, KK1));
    return rcpp_result_gen;
END_RCPP
}
// SMIRT_CALCPROB_COMP
Rcpp::NumericMatrix SMIRT_CALCPROB_COMP(Rcpp::NumericMatrix A, Rcpp::NumericVector B, Rcpp::NumericMatrix QQ, Rcpp::NumericMatrix THETA, Rcpp::NumericVector CC, Rcpp::NumericVector DD);
RcppExport SEXP _sirt_SMIRT_CALCPROB_COMP(SEXP ASEXP, SEXP BSEXP, SEXP QQSEXP, SEXP THETASEXP, SEXP CCSEXP, SEXP DDSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type B(BSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type QQ(QQSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type THETA(THETASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DD(DDSEXP);
    rcpp_result_gen = Rcpp::wrap(SMIRT_CALCPROB_COMP(A, B, QQ, THETA, CC, DD));
    return rcpp_result_gen;
END_RCPP
}
// SMIRT_CALCPROB_NONCOMP
Rcpp::NumericMatrix SMIRT_CALCPROB_NONCOMP(Rcpp::NumericMatrix A, Rcpp::NumericMatrix B, Rcpp::NumericMatrix QQ, Rcpp::NumericMatrix THETA, Rcpp::NumericVector CC, Rcpp::NumericVector DD);
RcppExport SEXP _sirt_SMIRT_CALCPROB_NONCOMP(SEXP ASEXP, SEXP BSEXP, SEXP QQSEXP, SEXP THETASEXP, SEXP CCSEXP, SEXP DDSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type B(BSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type QQ(QQSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type THETA(THETASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DD(DDSEXP);
    rcpp_result_gen = Rcpp::wrap(SMIRT_CALCPROB_NONCOMP(A, B, QQ, THETA, CC, DD));
    return rcpp_result_gen;
END_RCPP
}
// SMIRT_CALCPROB_PARTCOMP
Rcpp::NumericMatrix SMIRT_CALCPROB_PARTCOMP(Rcpp::NumericMatrix A, Rcpp::NumericMatrix B, Rcpp::NumericMatrix QQ, Rcpp::NumericMatrix THETA, Rcpp::NumericVector CC, Rcpp::NumericVector DD, Rcpp::NumericVector MUI);
RcppExport SEXP _sirt_SMIRT_CALCPROB_PARTCOMP(SEXP ASEXP, SEXP BSEXP, SEXP QQSEXP, SEXP THETASEXP, SEXP CCSEXP, SEXP DDSEXP, SEXP MUISEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type B(BSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type QQ(QQSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type THETA(THETASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type CC(CCSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DD(DDSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type MUI(MUISEXP);
    rcpp_result_gen = Rcpp::wrap(SMIRT_CALCPROB_PARTCOMP(A, B, QQ, THETA, CC, DD, MUI));
    return rcpp_result_gen;
END_RCPP
}
// MML2_RASCHTYPE_COUNTS
Rcpp::List MML2_RASCHTYPE_COUNTS(Rcpp::NumericMatrix DAT2, Rcpp::NumericMatrix DAT2RESP, Rcpp::NumericVector DAT1, Rcpp::NumericMatrix FQKYI, Rcpp::NumericVector PIK, Rcpp::NumericMatrix FYIQK);
RcppExport SEXP _sirt_MML2_RASCHTYPE_COUNTS(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP DAT1SEXP, SEXP FQKYISEXP, SEXP PIKSEXP, SEXP FYIQKSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type DAT1(DAT1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type FQKYI(FQKYISEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type PIK(PIKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type FYIQK(FYIQKSEXP);
    rcpp_result_gen = Rcpp::wrap(MML2_RASCHTYPE_COUNTS(DAT2, DAT2RESP, DAT1, FQKYI, PIK, FYIQK));
    return rcpp_result_gen;
END_RCPP
}
// MML2_CALCPOST_V1
Rcpp::List MML2_CALCPOST_V1(Rcpp::NumericMatrix DAT2, Rcpp::NumericMatrix DAT2RESP, Rcpp::NumericMatrix PROBS);
RcppExport SEXP _sirt_MML2_CALCPOST_V1(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    rcpp_result_gen = Rcpp::wrap(MML2_CALCPOST_V1(DAT2, DAT2RESP, PROBS));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rasch_mml2_calcpost_pseudoll
Rcpp::List sirt_rcpp_rasch_mml2_calcpost_pseudoll(Rcpp::NumericMatrix DAT2, Rcpp::NumericMatrix DAT2RESP, Rcpp::NumericMatrix PROBS);
RcppExport SEXP _sirt_sirt_rcpp_rasch_mml2_calcpost_pseudoll(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rasch_mml2_calcpost_pseudoll(DAT2, DAT2RESP, PROBS));
    return rcpp_result_gen;
END_RCPP
}
// MML2_CALCPOST_V3
Rcpp::List MML2_CALCPOST_V3(Rcpp::NumericMatrix DAT2, Rcpp::NumericMatrix DAT2RESP, Rcpp::NumericMatrix PROBS);
RcppExport SEXP _sirt_MML2_CALCPOST_V3(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    rcpp_result_gen = Rcpp::wrap(MML2_CALCPOST_V3(DAT2, DAT2RESP, PROBS));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_ccov_np_compute_ccov_sum_score
Rcpp::NumericVector sirt_rcpp_ccov_np_compute_ccov_sum_score(Rcpp::IntegerVector index, int NS, Rcpp::NumericMatrix data);
RcppExport SEXP _sirt_sirt_rcpp_ccov_np_compute_ccov_sum_score(SEXP indexSEXP, SEXP NSSEXP, SEXP dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index(indexSEXP);
    Rcpp::traits::input_parameter< int >::type NS(NSSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type data(dataSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_ccov_np_compute_ccov_sum_score(index, NS, data));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_discrete_inverse
Rcpp::List sirt_rcpp_discrete_inverse(Rcpp::NumericVector x0, Rcpp::NumericVector y0, Rcpp::NumericVector y);
RcppExport SEXP _sirt_sirt_rcpp_discrete_inverse(SEXP x0SEXP, SEXP y0SEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x0(x0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y0(y0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_discrete_inverse(x0, y0, y));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_first_eigenvalue
Rcpp::List sirt_rcpp_first_eigenvalue(arma::mat X, int maxit, double conv, double K);
RcppExport SEXP _sirt_sirt_rcpp_first_eigenvalue(SEXP XSEXP, SEXP maxitSEXP, SEXP convSEXP, SEXP KSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type X(XSEXP);
    Rcpp::traits::input_parameter< int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< double >::type K(KSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_first_eigenvalue(X, maxit, conv, K));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_D_eigenvalues
Rcpp::List sirt_rcpp_D_eigenvalues(Rcpp::NumericMatrix Xr, int D, int maxit, double conv);
RcppExport SEXP _sirt_sirt_rcpp_D_eigenvalues(SEXP XrSEXP, SEXP DSEXP, SEXP maxitSEXP, SEXP convSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Xr(XrSEXP);
    Rcpp::traits::input_parameter< int >::type D(DSEXP);
    Rcpp::traits::input_parameter< int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_D_eigenvalues(Xr, D, maxit, conv));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_choppin_row_averaging
Rcpp::NumericVector sirt_rcpp_choppin_row_averaging(arma::mat B, int I, double priorweight);
RcppExport SEXP _sirt_sirt_rcpp_choppin_row_averaging(SEXP BSEXP, SEXP ISEXP, SEXP priorweightSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type B(BSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< double >::type priorweight(priorweightSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_choppin_row_averaging(B, I, priorweight));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_evm_compute
Rcpp::List sirt_rcpp_evm_compute(arma::mat B, int I, int powD, int maxit, double conv, double K);
RcppExport SEXP _sirt_sirt_rcpp_evm_compute(SEXP BSEXP, SEXP ISEXP, SEXP powDSEXP, SEXP maxitSEXP, SEXP convSEXP, SEXP KSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type B(BSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type powD(powDSEXP);
    Rcpp::traits::input_parameter< int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< double >::type K(KSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_evm_compute(B, I, powD, maxit, conv, K));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_evm_comp_poly
Rcpp::List sirt_rcpp_evm_comp_poly(Rcpp::NumericMatrix dat, Rcpp::NumericMatrix dat_resp, Rcpp::NumericVector weights, int JJ, Rcpp::NumericVector jackunits, int powD, int progress_, Rcpp::NumericMatrix row_index, Rcpp::NumericMatrix col_index);
RcppExport SEXP _sirt_sirt_rcpp_evm_comp_poly(SEXP datSEXP, SEXP dat_respSEXP, SEXP weightsSEXP, SEXP JJSEXP, SEXP jackunitsSEXP, SEXP powDSEXP, SEXP progress_SEXP, SEXP row_indexSEXP, SEXP col_indexSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat_resp(dat_respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< int >::type JJ(JJSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type jackunits(jackunitsSEXP);
    Rcpp::traits::input_parameter< int >::type powD(powDSEXP);
    Rcpp::traits::input_parameter< int >::type progress_(progress_SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type row_index(row_indexSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type col_index(col_indexSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_evm_comp_poly(dat, dat_resp, weights, JJ, jackunits, powD, progress_, row_index, col_index));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_gom_em_calcpost
Rcpp::List sirt_rcpp_gom_em_calcpost(Rcpp::IntegerMatrix DAT2, Rcpp::IntegerMatrix DAT2RESP, Rcpp::NumericMatrix PROBS, Rcpp::NumericMatrix DAT2IND, Rcpp::NumericVector PIK, Rcpp::NumericVector KK1, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_gom_em_calcpost(SEXP DAT2SEXP, SEXP DAT2RESPSEXP, SEXP PROBSSEXP, SEXP DAT2INDSEXP, SEXP PIKSEXP, SEXP KK1SEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type DAT2(DAT2SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type DAT2RESP(DAT2RESPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PROBS(PROBSSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type DAT2IND(DAT2INDSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type PIK(PIKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type KK1(KK1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_gom_em_calcpost(DAT2, DAT2RESP, PROBS, DAT2IND, PIK, KK1, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_gom_em_likelihood
Rcpp::NumericMatrix sirt_rcpp_gom_em_likelihood(Rcpp::NumericVector probs, int ncat, int TP, Rcpp::IntegerMatrix dat2, Rcpp::LogicalMatrix dat2resp);
RcppExport SEXP _sirt_sirt_rcpp_gom_em_likelihood(SEXP probsSEXP, SEXP ncatSEXP, SEXP TPSEXP, SEXP dat2SEXP, SEXP dat2respSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type ncat(ncatSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat2(dat2SEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat2resp(dat2respSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_gom_em_likelihood(probs, ncat, TP, dat2, dat2resp));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_gom_em_log_likelihood
double sirt_rcpp_gom_em_log_likelihood(Rcpp::NumericMatrix fyiqk, Rcpp::NumericVector pik, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_gom_em_log_likelihood(SEXP fyiqkSEXP, SEXP pikSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fyiqk(fyiqkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type pik(pikSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_gom_em_log_likelihood(fyiqk, pik, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_gom_em_loglike_gradient
Rcpp::NumericVector sirt_rcpp_gom_em_loglike_gradient(Rcpp::NumericVector probs, Rcpp::NumericVector probs_h, int ncat, int TP, Rcpp::IntegerMatrix dat2, Rcpp::LogicalMatrix dat2resp, Rcpp::NumericVector pik, Rcpp::IntegerVector items, Rcpp::NumericMatrix fyiqk, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_gom_em_loglike_gradient(SEXP probsSEXP, SEXP probs_hSEXP, SEXP ncatSEXP, SEXP TPSEXP, SEXP dat2SEXP, SEXP dat2respSEXP, SEXP pikSEXP, SEXP itemsSEXP, SEXP fyiqkSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs_h(probs_hSEXP);
    Rcpp::traits::input_parameter< int >::type ncat(ncatSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat2(dat2SEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat2resp(dat2respSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type pik(pikSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type items(itemsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fyiqk(fyiqkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_gom_em_loglike_gradient(probs, probs_h, ncat, TP, dat2, dat2resp, pik, items, fyiqk, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_inference_jackknife
Rcpp::List sirt_rcpp_inference_jackknife(Rcpp::NumericMatrix PARS);
RcppExport SEXP _sirt_sirt_rcpp_inference_jackknife(SEXP PARSSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PARS(PARSSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_inference_jackknife(PARS));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_lambda_transformed
Rcpp::NumericMatrix sirt_rcpp_invariance_alignment_lambda_transformed(Rcpp::NumericMatrix lambda, Rcpp::NumericVector psi0, int meth);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_lambda_transformed(SEXP lambdaSEXP, SEXP psi0SEXP, SEXP methSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type psi0(psi0SEXP);
    Rcpp::traits::input_parameter< int >::type meth(methSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_lambda_transformed(lambda, psi0, meth));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_nu_transformed
Rcpp::NumericMatrix sirt_rcpp_invariance_alignment_nu_transformed(Rcpp::NumericMatrix nu, Rcpp::NumericMatrix lambda, Rcpp::NumericVector alpha0, Rcpp::NumericVector psi0, bool reparam, int meth);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_nu_transformed(SEXP nuSEXP, SEXP lambdaSEXP, SEXP alpha0SEXP, SEXP psi0SEXP, SEXP reparamSEXP, SEXP methSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type alpha0(alpha0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type psi0(psi0SEXP);
    Rcpp::traits::input_parameter< bool >::type reparam(reparamSEXP);
    Rcpp::traits::input_parameter< int >::type meth(methSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_nu_transformed(nu, lambda, alpha0, psi0, reparam, meth));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_simplicity_function_value
double sirt_rcpp_invariance_alignment_simplicity_function_value(Rcpp::CharacterVector type, double parm1, double parm2, double scale, double power, double eps);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_simplicity_function_value(SEXP typeSEXP, SEXP parm1SEXP, SEXP parm2SEXP, SEXP scaleSEXP, SEXP powerSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type type(typeSEXP);
    Rcpp::traits::input_parameter< double >::type parm1(parm1SEXP);
    Rcpp::traits::input_parameter< double >::type parm2(parm2SEXP);
    Rcpp::traits::input_parameter< double >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type power(powerSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_simplicity_function_value(type, parm1, parm2, scale, power, eps));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_opt_fct
Rcpp::List sirt_rcpp_invariance_alignment_opt_fct(Rcpp::NumericMatrix nu, Rcpp::NumericMatrix lambda, Rcpp::NumericVector alpha0, Rcpp::NumericVector psi0, Rcpp::IntegerMatrix group_combis, Rcpp::NumericMatrix wgt, Rcpp::NumericVector align_scale, Rcpp::NumericVector align_pow, double eps, Rcpp::NumericMatrix wgt_combi, Rcpp::CharacterVector type, bool reparam, int meth);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_opt_fct(SEXP nuSEXP, SEXP lambdaSEXP, SEXP alpha0SEXP, SEXP psi0SEXP, SEXP group_combisSEXP, SEXP wgtSEXP, SEXP align_scaleSEXP, SEXP align_powSEXP, SEXP epsSEXP, SEXP wgt_combiSEXP, SEXP typeSEXP, SEXP reparamSEXP, SEXP methSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type alpha0(alpha0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type psi0(psi0SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type group_combis(group_combisSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgt(wgtSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type align_scale(align_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type align_pow(align_powSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgt_combi(wgt_combiSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type type(typeSEXP);
    Rcpp::traits::input_parameter< bool >::type reparam(reparamSEXP);
    Rcpp::traits::input_parameter< int >::type meth(methSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_opt_fct(nu, lambda, alpha0, psi0, group_combis, wgt, align_scale, align_pow, eps, wgt_combi, type, reparam, meth));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_simplicity_function_gradient
double sirt_rcpp_invariance_alignment_simplicity_function_gradient(Rcpp::CharacterVector type, double parm1, double parm2, double scale, double power, double eps);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_simplicity_function_gradient(SEXP typeSEXP, SEXP parm1SEXP, SEXP parm2SEXP, SEXP scaleSEXP, SEXP powerSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type type(typeSEXP);
    Rcpp::traits::input_parameter< double >::type parm1(parm1SEXP);
    Rcpp::traits::input_parameter< double >::type parm2(parm2SEXP);
    Rcpp::traits::input_parameter< double >::type scale(scaleSEXP);
    Rcpp::traits::input_parameter< double >::type power(powerSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_simplicity_function_gradient(type, parm1, parm2, scale, power, eps));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_invariance_alignment_opt_grad
Rcpp::NumericVector sirt_rcpp_invariance_alignment_opt_grad(Rcpp::NumericMatrix nu, Rcpp::NumericMatrix lambda, Rcpp::NumericVector alpha0, Rcpp::NumericVector psi0, Rcpp::IntegerMatrix group_combis, Rcpp::NumericMatrix wgt, Rcpp::NumericVector align_scale, Rcpp::NumericVector align_pow, double eps, Rcpp::NumericMatrix wgt_combi, Rcpp::CharacterVector type, bool reparam, int meth);
RcppExport SEXP _sirt_sirt_rcpp_invariance_alignment_opt_grad(SEXP nuSEXP, SEXP lambdaSEXP, SEXP alpha0SEXP, SEXP psi0SEXP, SEXP group_combisSEXP, SEXP wgtSEXP, SEXP align_scaleSEXP, SEXP align_powSEXP, SEXP epsSEXP, SEXP wgt_combiSEXP, SEXP typeSEXP, SEXP reparamSEXP, SEXP methSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type nu(nuSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type alpha0(alpha0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type psi0(psi0SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type group_combis(group_combisSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgt(wgtSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type align_scale(align_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type align_pow(align_powSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgt_combi(wgt_combiSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type type(typeSEXP);
    Rcpp::traits::input_parameter< bool >::type reparam(reparamSEXP);
    Rcpp::traits::input_parameter< int >::type meth(methSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_invariance_alignment_opt_grad(nu, lambda, alpha0, psi0, group_combis, wgt, align_scale, align_pow, eps, wgt_combi, type, reparam, meth));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_linking_haebara_fct_optim_one_item
double sirt_rcpp_linking_haebara_fct_optim_one_item(Rcpp::NumericVector theta, Rcpp::NumericVector prob_theta, Rcpp::NumericMatrix aM, Rcpp::NumericMatrix bM, Rcpp::NumericVector a, Rcpp::NumericVector b, Rcpp::NumericVector mu, Rcpp::NumericVector sigma, int ii, int ss, Rcpp::CharacterVector dist, double eps, double pow);
RcppExport SEXP _sirt_sirt_rcpp_linking_haebara_fct_optim_one_item(SEXP thetaSEXP, SEXP prob_thetaSEXP, SEXP aMSEXP, SEXP bMSEXP, SEXP aSEXP, SEXP bSEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP iiSEXP, SEXP ssSEXP, SEXP distSEXP, SEXP epsSEXP, SEXP powSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_theta(prob_thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type aM(aMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type bM(bMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type mu(muSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< int >::type ii(iiSEXP);
    Rcpp::traits::input_parameter< int >::type ss(ssSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type dist(distSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< double >::type pow(powSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_linking_haebara_fct_optim_one_item(theta, prob_theta, aM, bM, a, b, mu, sigma, ii, ss, dist, eps, pow));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_linking_haebara_fct_optim
double sirt_rcpp_linking_haebara_fct_optim(int NI, int NS, Rcpp::CharacterVector dist, Rcpp::NumericMatrix aM, Rcpp::NumericMatrix bM, Rcpp::NumericVector theta, Rcpp::NumericVector prob_theta, Rcpp::LogicalMatrix est_pars, Rcpp::NumericMatrix wgtM, Rcpp::NumericVector a, Rcpp::NumericVector b, Rcpp::NumericVector mu, Rcpp::NumericVector sigma, double eps, double pow);
RcppExport SEXP _sirt_sirt_rcpp_linking_haebara_fct_optim(SEXP NISEXP, SEXP NSSEXP, SEXP distSEXP, SEXP aMSEXP, SEXP bMSEXP, SEXP thetaSEXP, SEXP prob_thetaSEXP, SEXP est_parsSEXP, SEXP wgtMSEXP, SEXP aSEXP, SEXP bSEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP epsSEXP, SEXP powSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type NI(NISEXP);
    Rcpp::traits::input_parameter< int >::type NS(NSSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type dist(distSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type aM(aMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type bM(bMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_theta(prob_thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type est_pars(est_parsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgtM(wgtMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type mu(muSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< double >::type pow(powSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_linking_haebara_fct_optim(NI, NS, dist, aM, bM, theta, prob_theta, est_pars, wgtM, a, b, mu, sigma, eps, pow));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_linking_haebara_grad_optim_one_item
Rcpp::NumericVector sirt_rcpp_linking_haebara_grad_optim_one_item(Rcpp::NumericVector theta, Rcpp::NumericVector prob_theta, Rcpp::NumericMatrix aM, Rcpp::NumericMatrix bM, Rcpp::NumericVector a, Rcpp::NumericVector b, Rcpp::NumericVector mu, Rcpp::NumericVector sigma, int ii, int ss, Rcpp::CharacterVector dist, double eps, int NI, int NS, Rcpp::IntegerVector index_a, Rcpp::IntegerVector index_b, Rcpp::IntegerVector index_mu, Rcpp::IntegerVector index_sigma, Rcpp::NumericMatrix wgtM, Rcpp::NumericVector grad0, double pow);
RcppExport SEXP _sirt_sirt_rcpp_linking_haebara_grad_optim_one_item(SEXP thetaSEXP, SEXP prob_thetaSEXP, SEXP aMSEXP, SEXP bMSEXP, SEXP aSEXP, SEXP bSEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP iiSEXP, SEXP ssSEXP, SEXP distSEXP, SEXP epsSEXP, SEXP NISEXP, SEXP NSSEXP, SEXP index_aSEXP, SEXP index_bSEXP, SEXP index_muSEXP, SEXP index_sigmaSEXP, SEXP wgtMSEXP, SEXP grad0SEXP, SEXP powSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_theta(prob_thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type aM(aMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type bM(bMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type mu(muSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< int >::type ii(iiSEXP);
    Rcpp::traits::input_parameter< int >::type ss(ssSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type dist(distSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< int >::type NI(NISEXP);
    Rcpp::traits::input_parameter< int >::type NS(NSSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_a(index_aSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_b(index_bSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_mu(index_muSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_sigma(index_sigmaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgtM(wgtMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type grad0(grad0SEXP);
    Rcpp::traits::input_parameter< double >::type pow(powSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_linking_haebara_grad_optim_one_item(theta, prob_theta, aM, bM, a, b, mu, sigma, ii, ss, dist, eps, NI, NS, index_a, index_b, index_mu, index_sigma, wgtM, grad0, pow));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_linking_haebara_grad_optim
Rcpp::NumericVector sirt_rcpp_linking_haebara_grad_optim(int NI, int NS, Rcpp::CharacterVector dist, Rcpp::NumericMatrix aM, Rcpp::NumericMatrix bM, Rcpp::NumericVector theta, Rcpp::NumericVector prob_theta, Rcpp::LogicalMatrix est_pars, Rcpp::NumericMatrix wgtM, Rcpp::NumericVector a, Rcpp::NumericVector b, Rcpp::NumericVector mu, Rcpp::NumericVector sigma, double eps, Rcpp::IntegerVector index_a, Rcpp::IntegerVector index_b, Rcpp::IntegerVector index_mu, Rcpp::IntegerVector index_sigma, Rcpp::CharacterVector parnames, int NP, double pow);
RcppExport SEXP _sirt_sirt_rcpp_linking_haebara_grad_optim(SEXP NISEXP, SEXP NSSEXP, SEXP distSEXP, SEXP aMSEXP, SEXP bMSEXP, SEXP thetaSEXP, SEXP prob_thetaSEXP, SEXP est_parsSEXP, SEXP wgtMSEXP, SEXP aSEXP, SEXP bSEXP, SEXP muSEXP, SEXP sigmaSEXP, SEXP epsSEXP, SEXP index_aSEXP, SEXP index_bSEXP, SEXP index_muSEXP, SEXP index_sigmaSEXP, SEXP parnamesSEXP, SEXP NPSEXP, SEXP powSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type NI(NISEXP);
    Rcpp::traits::input_parameter< int >::type NS(NSSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type dist(distSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type aM(aMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type bM(bMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_theta(prob_thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type est_pars(est_parsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgtM(wgtMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type b(bSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type mu(muSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type sigma(sigmaSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_a(index_aSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_b(index_bSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_mu(index_muSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_sigma(index_sigmaSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type parnames(parnamesSEXP);
    Rcpp::traits::input_parameter< int >::type NP(NPSEXP);
    Rcpp::traits::input_parameter< double >::type pow(powSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_linking_haebara_grad_optim(NI, NS, dist, aM, bM, theta, prob_theta, est_pars, wgtM, a, b, mu, sigma, eps, index_a, index_b, index_mu, index_sigma, parnames, NP, pow));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_lq_fit_analyze_matrix
Rcpp::NumericMatrix sirt_rcpp_lq_fit_analyze_matrix(Rcpp::NumericMatrix X);
RcppExport SEXP _sirt_sirt_rcpp_lq_fit_analyze_matrix(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_lq_fit_analyze_matrix(X));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_lq_fit_sparse_matrix_derivative
Rcpp::NumericVector sirt_rcpp_lq_fit_sparse_matrix_derivative(Rcpp::NumericMatrix Z, Rcpp::NumericVector h1, int px);
RcppExport SEXP _sirt_sirt_rcpp_lq_fit_sparse_matrix_derivative(SEXP ZSEXP, SEXP h1SEXP, SEXP pxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type h1(h1SEXP);
    Rcpp::traits::input_parameter< int >::type px(pxSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_lq_fit_sparse_matrix_derivative(Z, h1, px));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_lq_fit_matrix_mult
Rcpp::NumericVector sirt_rcpp_lq_fit_matrix_mult(Rcpp::NumericMatrix Z, Rcpp::NumericVector y, Rcpp::NumericVector beta);
RcppExport SEXP _sirt_sirt_rcpp_lq_fit_matrix_mult(SEXP ZSEXP, SEXP ySEXP, SEXP betaSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type beta(betaSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_lq_fit_matrix_mult(Z, y, beta));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_lq_fit_fct_optim
double sirt_rcpp_lq_fit_fct_optim(Rcpp::NumericMatrix Z, Rcpp::NumericVector y, Rcpp::NumericVector beta, double pow, Rcpp::NumericVector w, double eps);
RcppExport SEXP _sirt_sirt_rcpp_lq_fit_fct_optim(SEXP ZSEXP, SEXP ySEXP, SEXP betaSEXP, SEXP powSEXP, SEXP wSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Z(ZSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< double >::type pow(powSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type w(wSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_lq_fit_fct_optim(Z, y, beta, pow, w, eps));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_quadform
double sirt_rcpp_mgsem_quadform(Rcpp::NumericMatrix y, Rcpp::NumericMatrix A);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_quadform(SEXP ySEXP, SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_quadform(y, A));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_quadform_logical
double sirt_rcpp_mgsem_quadform_logical(Rcpp::NumericMatrix y, Rcpp::NumericMatrix A, Rcpp::LogicalMatrix A_logical);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_quadform_logical(SEXP ySEXP, SEXP ASEXP, SEXP A_logicalSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type A_logical(A_logicalSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_quadform_logical(y, A, A_logical));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_trace_product
double sirt_rcpp_mgsem_trace_product(Rcpp::NumericMatrix A, Rcpp::NumericMatrix B);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_trace_product(SEXP ASEXP, SEXP BSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type B(BSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_trace_product(A, B));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_trace_product_logical
double sirt_rcpp_mgsem_trace_product_logical(Rcpp::NumericMatrix A, Rcpp::NumericMatrix B, Rcpp::LogicalMatrix B_logical);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_trace_product_logical(SEXP ASEXP, SEXP BSEXP, SEXP B_logicalSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type B(BSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type B_logical(B_logicalSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_trace_product_logical(A, B, B_logical));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_loglike_derivative_parameters
double sirt_rcpp_mgsem_loglike_derivative_parameters(Rcpp::NumericMatrix S1, Rcpp::NumericMatrix S3, Rcpp::NumericVector y, Rcpp::NumericMatrix Sigma_der, Rcpp::LogicalMatrix Sigma_der_logical);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_loglike_derivative_parameters(SEXP S1SEXP, SEXP S3SEXP, SEXP ySEXP, SEXP Sigma_derSEXP, SEXP Sigma_der_logicalSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type S1(S1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type S3(S3SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Sigma_der(Sigma_derSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type Sigma_der_logical(Sigma_der_logicalSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_loglike_derivative_parameters(S1, S3, y, Sigma_der, Sigma_der_logical));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_compute_cov
Rcpp::NumericMatrix sirt_rcpp_mgsem_compute_cov(Rcpp::NumericMatrix LAM, Rcpp::NumericMatrix PHI, Rcpp::NumericMatrix PSI);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_compute_cov(SEXP LAMSEXP, SEXP PHISEXP, SEXP PSISEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type LAM(LAMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PHI(PHISEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type PSI(PSISEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_compute_cov(LAM, PHI, PSI));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_sumproduct_logical
double sirt_rcpp_mgsem_sumproduct_logical(Rcpp::NumericVector x, Rcpp::NumericVector y, Rcpp::LogicalVector y_logical);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_sumproduct_logical(SEXP xSEXP, SEXP ySEXP, SEXP y_logicalSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalVector >::type y_logical(y_logicalSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_sumproduct_logical(x, y, y_logical));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_vech_numeric
Rcpp::NumericVector sirt_rcpp_mgsem_vech_numeric(Rcpp::NumericMatrix A);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_vech_numeric(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_vech_numeric(A));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_vech_logical
Rcpp::LogicalVector sirt_rcpp_mgsem_vech_logical(Rcpp::LogicalMatrix A);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_vech_logical(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_vech_logical(A));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_pen_lp_lasso
double sirt_rcpp_mgsem_eval_pen_lp_lasso(double y, double eps_approx, double p, double regul_fac);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso(SEXP ySEXP, SEXP eps_approxSEXP, SEXP pSEXP, SEXP regul_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type regul_fac(regul_facSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_pen_lp_lasso(y, eps_approx, p, regul_fac));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_pen_lp_scad
double sirt_rcpp_mgsem_eval_pen_lp_scad(double y, double eps_approx, double p, double regul_fac, double a_scad);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_pen_lp_scad(SEXP ySEXP, SEXP eps_approxSEXP, SEXP pSEXP, SEXP regul_facSEXP, SEXP a_scadSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type regul_fac(regul_facSEXP);
    Rcpp::traits::input_parameter< double >::type a_scad(a_scadSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_pen_lp_scad(y, eps_approx, p, regul_fac, a_scad));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv
double sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv(double y, double eps_approx, double p, double regul_fac);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv(SEXP ySEXP, SEXP eps_approxSEXP, SEXP pSEXP, SEXP regul_facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type regul_fac(regul_facSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv(y, eps_approx, p, regul_fac));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_lp_penalty
Rcpp::NumericVector sirt_rcpp_mgsem_eval_lp_penalty(Rcpp::NumericVector x, Rcpp::NumericVector fac, Rcpp::NumericVector n, double p, double eps_approx, bool deriv, Rcpp::CharacterVector pen_type, double a_scad, double h);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_lp_penalty(SEXP xSEXP, SEXP facSEXP, SEXP nSEXP, SEXP pSEXP, SEXP eps_approxSEXP, SEXP derivSEXP, SEXP pen_typeSEXP, SEXP a_scadSEXP, SEXP hSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type fac(facSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type n(nSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< bool >::type deriv(derivSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type pen_type(pen_typeSEXP);
    Rcpp::traits::input_parameter< double >::type a_scad(a_scadSEXP);
    Rcpp::traits::input_parameter< double >::type h(hSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_lp_penalty(x, fac, n, p, eps_approx, deriv, pen_type, a_scad, h));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_lpdiff_penalty
double sirt_rcpp_mgsem_eval_lpdiff_penalty(Rcpp::NumericVector x, Rcpp::NumericMatrix fac, Rcpp::LogicalMatrix fac_logical, double p, double eps_approx, double a_scad, Rcpp::CharacterVector pen_type, Rcpp::NumericMatrix n);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty(SEXP xSEXP, SEXP facSEXP, SEXP fac_logicalSEXP, SEXP pSEXP, SEXP eps_approxSEXP, SEXP a_scadSEXP, SEXP pen_typeSEXP, SEXP nSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fac(facSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type fac_logical(fac_logicalSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< double >::type a_scad(a_scadSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type pen_type(pen_typeSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type n(nSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_lpdiff_penalty(x, fac, fac_logical, p, eps_approx, a_scad, pen_type, n));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv
Rcpp::NumericVector sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv(Rcpp::NumericVector x, Rcpp::NumericMatrix fac, Rcpp::NumericMatrix n, Rcpp::LogicalMatrix fac_logical, double p, double eps_approx, double h, double a_scad, Rcpp::CharacterVector pen_type);
RcppExport SEXP _sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv(SEXP xSEXP, SEXP facSEXP, SEXP nSEXP, SEXP fac_logicalSEXP, SEXP pSEXP, SEXP eps_approxSEXP, SEXP hSEXP, SEXP a_scadSEXP, SEXP pen_typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type fac(facSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type n(nSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type fac_logical(fac_logicalSEXP);
    Rcpp::traits::input_parameter< double >::type p(pSEXP);
    Rcpp::traits::input_parameter< double >::type eps_approx(eps_approxSEXP);
    Rcpp::traits::input_parameter< double >::type h(hSEXP);
    Rcpp::traits::input_parameter< double >::type a_scad(a_scadSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type pen_type(pen_typeSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv(x, fac, n, fac_logical, p, eps_approx, h, a_scad, pen_type));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_monoreg_rowwise
Rcpp::NumericMatrix sirt_rcpp_monoreg_rowwise(Rcpp::NumericMatrix YM, Rcpp::NumericMatrix WM);
RcppExport SEXP _sirt_sirt_rcpp_monoreg_rowwise(SEXP YMSEXP, SEXP WMSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type YM(YMSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type WM(WMSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_monoreg_rowwise(YM, WM));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_noharm_sirt_optim_fn_rcpp
double sirt_rcpp_noharm_sirt_optim_fn_rcpp(Rcpp::NumericMatrix gamma_val, Rcpp::NumericVector delta, int I, Rcpp::NumericMatrix wgtm, Rcpp::NumericMatrix pm, Rcpp::NumericMatrix b0_jk, Rcpp::NumericMatrix b1_jk, Rcpp::NumericMatrix b2_jk, Rcpp::NumericMatrix b3_jk);
RcppExport SEXP _sirt_sirt_rcpp_noharm_sirt_optim_fn_rcpp(SEXP gamma_valSEXP, SEXP deltaSEXP, SEXP ISEXP, SEXP wgtmSEXP, SEXP pmSEXP, SEXP b0_jkSEXP, SEXP b1_jkSEXP, SEXP b2_jkSEXP, SEXP b3_jkSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type gamma_val(gamma_valSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgtm(wgtmSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type pm(pmSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b0_jk(b0_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b1_jk(b1_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b2_jk(b2_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b3_jk(b3_jkSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_noharm_sirt_optim_fn_rcpp(gamma_val, delta, I, wgtm, pm, b0_jk, b1_jk, b2_jk, b3_jk));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_noharm_sirt_optim_gr_rcpp
Rcpp::List sirt_rcpp_noharm_sirt_optim_gr_rcpp(Rcpp::NumericMatrix gamma_val, int NH, int I, Rcpp::NumericMatrix wgtm, Rcpp::NumericMatrix pm, Rcpp::NumericMatrix b0_jk, Rcpp::NumericMatrix b1_jk, Rcpp::NumericMatrix b2_jk, Rcpp::NumericMatrix b3_jk, int npar, Rcpp::IntegerVector pt_matid, Rcpp::IntegerVector pt_index, Rcpp::IntegerVector pt_row, Rcpp::IntegerVector pt_col, Rcpp::NumericMatrix FP, Rcpp::NumericMatrix Fmat, Rcpp::NumericMatrix Pmat, Rcpp::NumericMatrix Psimat);
RcppExport SEXP _sirt_sirt_rcpp_noharm_sirt_optim_gr_rcpp(SEXP gamma_valSEXP, SEXP NHSEXP, SEXP ISEXP, SEXP wgtmSEXP, SEXP pmSEXP, SEXP b0_jkSEXP, SEXP b1_jkSEXP, SEXP b2_jkSEXP, SEXP b3_jkSEXP, SEXP nparSEXP, SEXP pt_matidSEXP, SEXP pt_indexSEXP, SEXP pt_rowSEXP, SEXP pt_colSEXP, SEXP FPSEXP, SEXP FmatSEXP, SEXP PmatSEXP, SEXP PsimatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type gamma_val(gamma_valSEXP);
    Rcpp::traits::input_parameter< int >::type NH(NHSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type wgtm(wgtmSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type pm(pmSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b0_jk(b0_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b1_jk(b1_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b2_jk(b2_jkSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type b3_jk(b3_jkSEXP);
    Rcpp::traits::input_parameter< int >::type npar(nparSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pt_matid(pt_matidSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pt_index(pt_indexSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pt_row(pt_rowSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pt_col(pt_colSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type FP(FPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Fmat(FmatSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Pmat(PmatSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Psimat(PsimatSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_noharm_sirt_optim_gr_rcpp(gamma_val, NH, I, wgtm, pm, b0_jk, b1_jk, b2_jk, b3_jk, npar, pt_matid, pt_index, pt_row, pt_col, FP, Fmat, Pmat, Psimat));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_pnorm0
double sirt_rcpp_pnorm0(double z);
RcppExport SEXP _sirt_sirt_rcpp_pnorm0(SEXP zSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type z(zSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_pnorm0(z));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_pnorm
Rcpp::NumericVector sirt_rcpp_pnorm(Rcpp::NumericVector x);
RcppExport SEXP _sirt_sirt_rcpp_pnorm(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_pnorm(x));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_pbvnorm0
double sirt_rcpp_pbvnorm0(double h1, double hk, double r);
RcppExport SEXP _sirt_sirt_rcpp_pbvnorm0(SEXP h1SEXP, SEXP hkSEXP, SEXP rSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type h1(h1SEXP);
    Rcpp::traits::input_parameter< double >::type hk(hkSEXP);
    Rcpp::traits::input_parameter< double >::type r(rSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_pbvnorm0(h1, hk, r));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_pbvnorm
Rcpp::NumericVector sirt_rcpp_pbvnorm(Rcpp::NumericVector x, Rcpp::NumericVector y, Rcpp::NumericVector rho);
RcppExport SEXP _sirt_sirt_rcpp_pbvnorm(SEXP xSEXP, SEXP ySEXP, SEXP rhoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rho(rhoSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_pbvnorm(x, y, rho));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_dbvnorm0
double sirt_rcpp_dbvnorm0(double x, double y, double rho, bool use_log);
RcppExport SEXP _sirt_sirt_rcpp_dbvnorm0(SEXP xSEXP, SEXP ySEXP, SEXP rhoSEXP, SEXP use_logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< bool >::type use_log(use_logSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_dbvnorm0(x, y, rho, use_log));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_dbvnorm
Rcpp::NumericVector sirt_rcpp_dbvnorm(Rcpp::NumericVector x, Rcpp::NumericVector y, Rcpp::NumericVector rho, bool use_log);
RcppExport SEXP _sirt_sirt_rcpp_dbvnorm(SEXP xSEXP, SEXP ySEXP, SEXP rhoSEXP, SEXP use_logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< bool >::type use_log(use_logSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_dbvnorm(x, y, rho, use_log));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_pbivnorm2
Rcpp::NumericVector sirt_rcpp_pbivnorm2(Rcpp::NumericVector x, Rcpp::NumericVector y, Rcpp::NumericVector rho1);
RcppExport SEXP _sirt_sirt_rcpp_pbivnorm2(SEXP xSEXP, SEXP ySEXP, SEXP rho1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rho1(rho1SEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_pbivnorm2(x, y, rho1));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_dmvnorm_2dim
double sirt_rcpp_dmvnorm_2dim(double x, double y, double rho);
RcppExport SEXP _sirt_sirt_rcpp_dmvnorm_2dim(SEXP xSEXP, SEXP ySEXP, SEXP rhoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type y(ySEXP);
    Rcpp::traits::input_parameter< double >::type rho(rhoSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_dmvnorm_2dim(x, y, rho));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_polychoric2_pbivnorm
double sirt_rcpp_polychoric2_pbivnorm(Rcpp::NumericVector x, Rcpp::NumericVector y, Rcpp::NumericVector rho, int use_pbv);
RcppExport SEXP _sirt_sirt_rcpp_polychoric2_pbivnorm(SEXP xSEXP, SEXP ySEXP, SEXP rhoSEXP, SEXP use_pbvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< int >::type use_pbv(use_pbvSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_polychoric2_pbivnorm(x, y, rho, use_pbv));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_polychoric2_estimating_equation
Rcpp::NumericVector sirt_rcpp_polychoric2_estimating_equation(Rcpp::NumericMatrix frtab, int maxK, Rcpp::NumericVector rho, Rcpp::NumericVector thresh1n, Rcpp::NumericVector thresh2n, int maxK1, int maxK2, int use_pbv);
RcppExport SEXP _sirt_sirt_rcpp_polychoric2_estimating_equation(SEXP frtabSEXP, SEXP maxKSEXP, SEXP rhoSEXP, SEXP thresh1nSEXP, SEXP thresh2nSEXP, SEXP maxK1SEXP, SEXP maxK2SEXP, SEXP use_pbvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type frtab(frtabSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type rho(rhoSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type thresh1n(thresh1nSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type thresh2n(thresh2nSEXP);
    Rcpp::traits::input_parameter< int >::type maxK1(maxK1SEXP);
    Rcpp::traits::input_parameter< int >::type maxK2(maxK2SEXP);
    Rcpp::traits::input_parameter< int >::type use_pbv(use_pbvSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_polychoric2_estimating_equation(frtab, maxK, rho, thresh1n, thresh2n, maxK1, maxK2, use_pbv));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_polychoric2_est_itempair
Rcpp::List sirt_rcpp_polychoric2_est_itempair(Rcpp::NumericVector v1, Rcpp::NumericVector v2, int maxK_, int maxiter, int use_pbv, double conv, double rho_init, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_polychoric2_est_itempair(SEXP v1SEXP, SEXP v2SEXP, SEXP maxK_SEXP, SEXP maxiterSEXP, SEXP use_pbvSEXP, SEXP convSEXP, SEXP rho_initSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type v1(v1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type v2(v2SEXP);
    Rcpp::traits::input_parameter< int >::type maxK_(maxK_SEXP);
    Rcpp::traits::input_parameter< int >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< int >::type use_pbv(use_pbvSEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< double >::type rho_init(rho_initSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_polychoric2_est_itempair(v1, v2, maxK_, maxiter, use_pbv, conv, rho_init, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_polychoric2
Rcpp::List sirt_rcpp_polychoric2(Rcpp::NumericMatrix dat, int maxK, int maxiter, int use_pbv, double conv, Rcpp::IntegerMatrix rho_init, Rcpp::NumericVector weights);
RcppExport SEXP _sirt_sirt_rcpp_polychoric2(SEXP datSEXP, SEXP maxKSEXP, SEXP maxiterSEXP, SEXP use_pbvSEXP, SEXP convSEXP, SEXP rho_initSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    Rcpp::traits::input_parameter< int >::type maxiter(maxiterSEXP);
    Rcpp::traits::input_parameter< int >::type use_pbv(use_pbvSEXP);
    Rcpp::traits::input_parameter< double >::type conv(convSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type rho_init(rho_initSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_polychoric2(dat, maxK, maxiter, use_pbv, conv, rho_init, weights));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_tetrachoric2_rcpp
Rcpp::NumericVector sirt_rcpp_tetrachoric2_rcpp(Rcpp::NumericMatrix dfr, double h, int maxiter);
RcppExport SEXP _sirt_sirt_rcpp_tetrachoric2_rcpp(SEXP dfrSEXP, SEXP hSEXP, SEXP maxiterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dfr(dfrSEXP);
    Rcpp::traits::input_parameter< double >::type h(hSEXP);
    Rcpp::traits::input_parameter< int >::type maxiter(maxiterSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_tetrachoric2_rcpp(dfr, h, maxiter));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_proc_datasets_na_indicators
Rcpp::List sirt_rcpp_rm_proc_datasets_na_indicators(Rcpp::NumericMatrix dat, int K);
RcppExport SEXP _sirt_sirt_rcpp_rm_proc_datasets_na_indicators(SEXP datSEXP, SEXP KSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_proc_datasets_na_indicators(dat, K));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_proc_expand_dataset
Rcpp::NumericMatrix sirt_rcpp_rm_proc_expand_dataset(Rcpp::NumericMatrix dat, Rcpp::IntegerVector rater0, Rcpp::IntegerVector pid0, int N, int R);
RcppExport SEXP _sirt_sirt_rcpp_rm_proc_expand_dataset(SEXP datSEXP, SEXP rater0SEXP, SEXP pid0SEXP, SEXP NSEXP, SEXP RSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type rater0(rater0SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pid0(pid0SEXP);
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    Rcpp::traits::input_parameter< int >::type R(RSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_proc_expand_dataset(dat, rater0, pid0, N, R));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_posterior
Rcpp::List sirt_rcpp_rm_sdt_posterior(Rcpp::NumericVector prob_item, Rcpp::NumericVector prob_rater, int I0, int K1, int TP, Rcpp::IntegerVector item_index, Rcpp::IntegerMatrix dat2, Rcpp::LogicalMatrix dat2_resp, int I, Rcpp::NumericVector pi_k0);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_posterior(SEXP prob_itemSEXP, SEXP prob_raterSEXP, SEXP I0SEXP, SEXP K1SEXP, SEXP TPSEXP, SEXP item_indexSEXP, SEXP dat2SEXP, SEXP dat2_respSEXP, SEXP ISEXP, SEXP pi_k0SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_item(prob_itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob_rater(prob_raterSEXP);
    Rcpp::traits::input_parameter< int >::type I0(I0SEXP);
    Rcpp::traits::input_parameter< int >::type K1(K1SEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type item_index(item_indexSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat2(dat2SEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat2_resp(dat2_respSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type pi_k0(pi_k0SEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_posterior(prob_item, prob_rater, I0, K1, TP, item_index, dat2, dat2_resp, I, pi_k0));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a(Rcpp::NumericVector prob0, Rcpp::IntegerVector prob_D1_dim, Rcpp::NumericVector theta_k);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a(SEXP prob0SEXP, SEXP prob_D1_dimSEXP, SEXP theta_kSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob0(prob0SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type prob_D1_dim(prob_D1_dimSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta_k(theta_kSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a(prob0, prob_D1_dim, theta_k));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau(Rcpp::NumericVector prob0, Rcpp::IntegerVector prob_D1_dim, int cat_pp);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau(SEXP prob0SEXP, SEXP prob_D1_dimSEXP, SEXP cat_ppSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prob0(prob0SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type prob_D1_dim(prob_D1_dimSEXP);
    Rcpp::traits::input_parameter< int >::type cat_pp(cat_ppSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau(prob0, prob_D1_dim, cat_pp));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad(Rcpp::NumericVector logprob_D1, Rcpp::IntegerVector prob_D1_dim, Rcpp::NumericVector nik_item);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad(SEXP logprob_D1SEXP, SEXP prob_D1_dimSEXP, SEXP nik_itemSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type logprob_D1(logprob_D1SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type prob_D1_dim(prob_D1_dimSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type nik_item(nik_itemSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad(logprob_D1, prob_D1_dim, nik_item));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_squeeze_eps
Rcpp::NumericVector sirt_rcpp_squeeze_eps(Rcpp::NumericVector x, double eps);
RcppExport SEXP _sirt_sirt_rcpp_squeeze_eps(SEXP xSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_squeeze_eps(x, eps));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_log
Rcpp::NumericVector sirt_rcpp_log(Rcpp::NumericVector x);
RcppExport SEXP _sirt_sirt_rcpp_log(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_log(x));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_plogis
double sirt_rcpp_plogis(double x);
RcppExport SEXP _sirt_sirt_rcpp_plogis(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_plogis(x));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_probs_gpcm
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_probs_gpcm(Rcpp::NumericVector a, Rcpp::NumericMatrix tau, Rcpp::NumericVector theta_k, int VV, int K1, int TP, double eps, bool use_log);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_probs_gpcm(SEXP aSEXP, SEXP tauSEXP, SEXP theta_kSEXP, SEXP VVSEXP, SEXP K1SEXP, SEXP TPSEXP, SEXP epsSEXP, SEXP use_logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type tau(tauSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta_k(theta_kSEXP);
    Rcpp::traits::input_parameter< int >::type VV(VVSEXP);
    Rcpp::traits::input_parameter< int >::type K1(K1SEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< bool >::type use_log(use_logSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_probs_gpcm(a, tau, theta_k, VV, K1, TP, eps, use_log));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_probs_grm_rater
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_probs_grm_rater(Rcpp::NumericMatrix c_rater, Rcpp::NumericVector d_rater, int I, int K, double eps, bool use_log);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_probs_grm_rater(SEXP c_raterSEXP, SEXP d_raterSEXP, SEXP ISEXP, SEXP KSEXP, SEXP epsSEXP, SEXP use_logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type c_rater(c_raterSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type d_rater(d_raterSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< bool >::type use_log(use_logSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_probs_grm_rater(c_rater, d_rater, I, K, eps, use_log));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_rm_sdt_calc_probs_grm_item
Rcpp::NumericVector sirt_rcpp_rm_sdt_calc_probs_grm_item(Rcpp::NumericMatrix tau_item, Rcpp::NumericVector a_item, Rcpp::NumericVector theta_k, int VV, int K, int TP, double eps, bool use_log);
RcppExport SEXP _sirt_sirt_rcpp_rm_sdt_calc_probs_grm_item(SEXP tau_itemSEXP, SEXP a_itemSEXP, SEXP theta_kSEXP, SEXP VVSEXP, SEXP KSEXP, SEXP TPSEXP, SEXP epsSEXP, SEXP use_logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type tau_item(tau_itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type a_item(a_itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta_k(theta_kSEXP);
    Rcpp::traits::input_parameter< int >::type VV(VVSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< bool >::type use_log(use_logSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_rm_sdt_calc_probs_grm_item(tau_item, a_item, theta_k, VV, K, TP, eps, use_log));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_compute_posterior_expected_counts
Rcpp::NumericMatrix sirt_rcpp_xxirt_compute_posterior_expected_counts(Rcpp::LogicalMatrix dat1_resp_gg, Rcpp::NumericMatrix p_aj_xi_gg, Rcpp::NumericVector weights_gg);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_compute_posterior_expected_counts(SEXP dat1_resp_ggSEXP, SEXP p_aj_xi_ggSEXP, SEXP weights_ggSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat1_resp_gg(dat1_resp_ggSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type p_aj_xi_gg(p_aj_xi_ggSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights_gg(weights_ggSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_compute_posterior_expected_counts(dat1_resp_gg, p_aj_xi_gg, weights_gg));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_compute_likelihood
Rcpp::NumericMatrix sirt_rcpp_xxirt_compute_likelihood(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp_bool, Rcpp::NumericMatrix probs, int TP, int maxK);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_compute_likelihood(SEXP datSEXP, SEXP dat_resp_boolSEXP, SEXP probsSEXP, SEXP TPSEXP, SEXP maxKSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp_bool(dat_resp_boolSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_compute_likelihood(dat, dat_resp_bool, probs, TP, maxK));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_compute_likelihood_person_covariates
Rcpp::NumericMatrix sirt_rcpp_xxirt_compute_likelihood_person_covariates(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp_bool, Rcpp::NumericVector probs, int TP, int maxK);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_compute_likelihood_person_covariates(SEXP datSEXP, SEXP dat_resp_boolSEXP, SEXP probsSEXP, SEXP TPSEXP, SEXP maxKSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp_bool(dat_resp_boolSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_compute_likelihood_person_covariates(dat, dat_resp_bool, probs, TP, maxK));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_compute_loglike_case_theta_covariates
Rcpp::NumericMatrix sirt_rcpp_xxirt_compute_loglike_case_theta_covariates(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp_bool, Rcpp::NumericVector logprobs, int TP, int maxK);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_compute_loglike_case_theta_covariates(SEXP datSEXP, SEXP dat_resp_boolSEXP, SEXP logprobsSEXP, SEXP TPSEXP, SEXP maxKSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp_bool(dat_resp_boolSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type logprobs(logprobsSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_compute_loglike_case_theta_covariates(dat, dat_resp_bool, logprobs, TP, maxK));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_hessian_reduced_probs
Rcpp::NumericMatrix sirt_rcpp_xxirt_hessian_reduced_probs(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp_bool, Rcpp::NumericMatrix probs_ratio, int TP, int maxK, int itemnr, int itemnr2, bool use_itemnr2, Rcpp::NumericMatrix p_xi_aj);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_hessian_reduced_probs(SEXP datSEXP, SEXP dat_resp_boolSEXP, SEXP probs_ratioSEXP, SEXP TPSEXP, SEXP maxKSEXP, SEXP itemnrSEXP, SEXP itemnr2SEXP, SEXP use_itemnr2SEXP, SEXP p_xi_ajSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp_bool(dat_resp_boolSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type probs_ratio(probs_ratioSEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type maxK(maxKSEXP);
    Rcpp::traits::input_parameter< int >::type itemnr(itemnrSEXP);
    Rcpp::traits::input_parameter< int >::type itemnr2(itemnr2SEXP);
    Rcpp::traits::input_parameter< bool >::type use_itemnr2(use_itemnr2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type p_xi_aj(p_xi_ajSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_hessian_reduced_probs(dat, dat_resp_bool, probs_ratio, TP, maxK, itemnr, itemnr2, use_itemnr2, p_xi_aj));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_newton_raphson_derivative_par
double sirt_rcpp_xxirt_newton_raphson_derivative_par(Rcpp::IntegerMatrix dat, Rcpp::LogicalMatrix dat_resp_bool, Rcpp::NumericMatrix ratio, Rcpp::NumericMatrix p_xi_aj, int item, Rcpp::NumericMatrix prior_Theta, Rcpp::IntegerVector group0, Rcpp::NumericVector weights, Rcpp::NumericVector ll_case0, double eps, bool person_covariates, bool person_covariates_items);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_newton_raphson_derivative_par(SEXP datSEXP, SEXP dat_resp_boolSEXP, SEXP ratioSEXP, SEXP p_xi_ajSEXP, SEXP itemSEXP, SEXP prior_ThetaSEXP, SEXP group0SEXP, SEXP weightsSEXP, SEXP ll_case0SEXP, SEXP epsSEXP, SEXP person_covariatesSEXP, SEXP person_covariates_itemsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat(datSEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp_bool(dat_resp_boolSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type ratio(ratioSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type p_xi_aj(p_xi_ajSEXP);
    Rcpp::traits::input_parameter< int >::type item(itemSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type prior_Theta(prior_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type group0(group0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ll_case0(ll_case0SEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< bool >::type person_covariates(person_covariatesSEXP);
    Rcpp::traits::input_parameter< bool >::type person_covariates_items(person_covariates_itemsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_newton_raphson_derivative_par(dat, dat_resp_bool, ratio, p_xi_aj, item, prior_Theta, group0, weights, ll_case0, eps, person_covariates, person_covariates_items));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_nr_pml_opt_fun
Rcpp::List sirt_rcpp_xxirt_nr_pml_opt_fun(Rcpp::NumericVector prior_Theta, Rcpp::NumericVector probs_items, Rcpp::NumericVector freq1, Rcpp::NumericVector freq2, Rcpp::NumericVector W1, Rcpp::NumericMatrix W2_long, int G, int K, int I, int TP, int NI2, double eps);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_nr_pml_opt_fun(SEXP prior_ThetaSEXP, SEXP probs_itemsSEXP, SEXP freq1SEXP, SEXP freq2SEXP, SEXP W1SEXP, SEXP W2_longSEXP, SEXP GSEXP, SEXP KSEXP, SEXP ISEXP, SEXP TPSEXP, SEXP NI2SEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prior_Theta(prior_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs_items(probs_itemsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type freq1(freq1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type freq2(freq2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type W1(W1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type W2_long(W2_longSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type NI2(NI2SEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_nr_pml_opt_fun(prior_Theta, probs_items, freq1, freq2, W1, W2_long, G, K, I, TP, NI2, eps));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_nr_pml_grad_fun_eval
double sirt_rcpp_xxirt_nr_pml_grad_fun_eval(Rcpp::NumericVector prior_Theta, Rcpp::NumericVector probs_items, Rcpp::NumericVector freq1, Rcpp::NumericVector freq2, Rcpp::NumericVector W1, Rcpp::NumericMatrix W2_long, int G, int K, int I, int TP, int NI2, double eps, int NP, Rcpp::NumericVector der_prior_Theta, Rcpp::NumericVector val1, Rcpp::NumericVector val2, bool pp_Theta, Rcpp::NumericVector der_probs_items, Rcpp::IntegerVector index_freq1, Rcpp::IntegerVector index_freq2);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_nr_pml_grad_fun_eval(SEXP prior_ThetaSEXP, SEXP probs_itemsSEXP, SEXP freq1SEXP, SEXP freq2SEXP, SEXP W1SEXP, SEXP W2_longSEXP, SEXP GSEXP, SEXP KSEXP, SEXP ISEXP, SEXP TPSEXP, SEXP NI2SEXP, SEXP epsSEXP, SEXP NPSEXP, SEXP der_prior_ThetaSEXP, SEXP val1SEXP, SEXP val2SEXP, SEXP pp_ThetaSEXP, SEXP der_probs_itemsSEXP, SEXP index_freq1SEXP, SEXP index_freq2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prior_Theta(prior_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs_items(probs_itemsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type freq1(freq1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type freq2(freq2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type W1(W1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type W2_long(W2_longSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type NI2(NI2SEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< int >::type NP(NPSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type der_prior_Theta(der_prior_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type val1(val1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type val2(val2SEXP);
    Rcpp::traits::input_parameter< bool >::type pp_Theta(pp_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type der_probs_items(der_probs_itemsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_freq1(index_freq1SEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type index_freq2(index_freq2SEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_nr_pml_grad_fun_eval(prior_Theta, probs_items, freq1, freq2, W1, W2_long, G, K, I, TP, NI2, eps, NP, der_prior_Theta, val1, val2, pp_Theta, der_probs_items, index_freq1, index_freq2));
    return rcpp_result_gen;
END_RCPP
}
// sirt_rcpp_xxirt_nr_pml_casewise_opt_fun
Rcpp::List sirt_rcpp_xxirt_nr_pml_casewise_opt_fun(Rcpp::NumericVector prior_Theta, Rcpp::NumericVector probs_items, Rcpp::NumericVector W1, Rcpp::NumericMatrix W2_long, int G, int K, int I, int TP, int NI2, double eps, Rcpp::IntegerVector group0, Rcpp::NumericVector weights, Rcpp::IntegerMatrix dat1, Rcpp::LogicalMatrix dat_resp);
RcppExport SEXP _sirt_sirt_rcpp_xxirt_nr_pml_casewise_opt_fun(SEXP prior_ThetaSEXP, SEXP probs_itemsSEXP, SEXP W1SEXP, SEXP W2_longSEXP, SEXP GSEXP, SEXP KSEXP, SEXP ISEXP, SEXP TPSEXP, SEXP NI2SEXP, SEXP epsSEXP, SEXP group0SEXP, SEXP weightsSEXP, SEXP dat1SEXP, SEXP dat_respSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prior_Theta(prior_ThetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type probs_items(probs_itemsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type W1(W1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type W2_long(W2_longSEXP);
    Rcpp::traits::input_parameter< int >::type G(GSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    Rcpp::traits::input_parameter< int >::type I(ISEXP);
    Rcpp::traits::input_parameter< int >::type TP(TPSEXP);
    Rcpp::traits::input_parameter< int >::type NI2(NI2SEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type group0(group0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerMatrix >::type dat1(dat1SEXP);
    Rcpp::traits::input_parameter< Rcpp::LogicalMatrix >::type dat_resp(dat_respSEXP);
    rcpp_result_gen = Rcpp::wrap(sirt_rcpp_xxirt_nr_pml_casewise_opt_fun(prior_Theta, probs_items, W1, W2_long, G, K, I, TP, NI2, eps, group0, weights, dat1, dat_resp));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_sirt_gooijer_csn_table", (DL_FUNC) &_sirt_gooijer_csn_table, 7},
    {"_sirt_isop_tests_C", (DL_FUNC) &_sirt_isop_tests_C, 5},
    {"_sirt_interval_index_C", (DL_FUNC) &_sirt_interval_index_C, 2},
    {"_sirt_rowCumsums2_source", (DL_FUNC) &_sirt_rowCumsums2_source, 1},
    {"_sirt_rowKSmallest_C", (DL_FUNC) &_sirt_rowKSmallest_C, 4},
    {"_sirt_rowMaxsCPP_source", (DL_FUNC) &_sirt_rowMaxsCPP_source, 1},
    {"_sirt_rowmins2_bundle_C", (DL_FUNC) &_sirt_rowmins2_bundle_C, 2},
    {"_sirt_calc_copula_itemcluster_C", (DL_FUNC) &_sirt_calc_copula_itemcluster_C, 2},
    {"_sirt_md_pattern_csource", (DL_FUNC) &_sirt_md_pattern_csource, 1},
    {"_sirt_mle_pcm_group_C", (DL_FUNC) &_sirt_mle_pcm_group_C, 9},
    {"_sirt_mle_pcm_C", (DL_FUNC) &_sirt_mle_pcm_C, 8},
    {"_sirt_probs_pcm_groups_C", (DL_FUNC) &_sirt_probs_pcm_groups_C, 6},
    {"_sirt_sirt_rcpp_probs_pcm_groups_C", (DL_FUNC) &_sirt_sirt_rcpp_probs_pcm_groups_C, 6},
    {"_sirt_probs_pcm_nogroups_C", (DL_FUNC) &_sirt_probs_pcm_nogroups_C, 5},
    {"_sirt_calccounts_pcm_groups_C", (DL_FUNC) &_sirt_calccounts_pcm_groups_C, 7},
    {"_sirt_sirt_rcpp_calccounts_pcm_groups_C", (DL_FUNC) &_sirt_sirt_rcpp_calccounts_pcm_groups_C, 7},
    {"_sirt_sirt_rcpp_array_mult", (DL_FUNC) &_sirt_sirt_rcpp_array_mult, 4},
    {"_sirt_RM_CALCPOST", (DL_FUNC) &_sirt_RM_CALCPOST, 4},
    {"_sirt_rm_probraterfct1", (DL_FUNC) &_sirt_rm_probraterfct1, 5},
    {"_sirt_rm_facets_calcprobs_cpp", (DL_FUNC) &_sirt_rm_facets_calcprobs_cpp, 12},
    {"_sirt_SMIRT_CALCPOST", (DL_FUNC) &_sirt_SMIRT_CALCPOST, 6},
    {"_sirt_SMIRT_CALCPROB_COMP", (DL_FUNC) &_sirt_SMIRT_CALCPROB_COMP, 6},
    {"_sirt_SMIRT_CALCPROB_NONCOMP", (DL_FUNC) &_sirt_SMIRT_CALCPROB_NONCOMP, 6},
    {"_sirt_SMIRT_CALCPROB_PARTCOMP", (DL_FUNC) &_sirt_SMIRT_CALCPROB_PARTCOMP, 7},
    {"_sirt_MML2_RASCHTYPE_COUNTS", (DL_FUNC) &_sirt_MML2_RASCHTYPE_COUNTS, 6},
    {"_sirt_MML2_CALCPOST_V1", (DL_FUNC) &_sirt_MML2_CALCPOST_V1, 3},
    {"_sirt_sirt_rcpp_rasch_mml2_calcpost_pseudoll", (DL_FUNC) &_sirt_sirt_rcpp_rasch_mml2_calcpost_pseudoll, 3},
    {"_sirt_MML2_CALCPOST_V3", (DL_FUNC) &_sirt_MML2_CALCPOST_V3, 3},
    {"_sirt_sirt_rcpp_ccov_np_compute_ccov_sum_score", (DL_FUNC) &_sirt_sirt_rcpp_ccov_np_compute_ccov_sum_score, 3},
    {"_sirt_sirt_rcpp_discrete_inverse", (DL_FUNC) &_sirt_sirt_rcpp_discrete_inverse, 3},
    {"_sirt_sirt_rcpp_first_eigenvalue", (DL_FUNC) &_sirt_sirt_rcpp_first_eigenvalue, 4},
    {"_sirt_sirt_rcpp_D_eigenvalues", (DL_FUNC) &_sirt_sirt_rcpp_D_eigenvalues, 4},
    {"_sirt_sirt_rcpp_choppin_row_averaging", (DL_FUNC) &_sirt_sirt_rcpp_choppin_row_averaging, 3},
    {"_sirt_sirt_rcpp_evm_compute", (DL_FUNC) &_sirt_sirt_rcpp_evm_compute, 6},
    {"_sirt_sirt_rcpp_evm_comp_poly", (DL_FUNC) &_sirt_sirt_rcpp_evm_comp_poly, 9},
    {"_sirt_sirt_rcpp_gom_em_calcpost", (DL_FUNC) &_sirt_sirt_rcpp_gom_em_calcpost, 7},
    {"_sirt_sirt_rcpp_gom_em_likelihood", (DL_FUNC) &_sirt_sirt_rcpp_gom_em_likelihood, 5},
    {"_sirt_sirt_rcpp_gom_em_log_likelihood", (DL_FUNC) &_sirt_sirt_rcpp_gom_em_log_likelihood, 3},
    {"_sirt_sirt_rcpp_gom_em_loglike_gradient", (DL_FUNC) &_sirt_sirt_rcpp_gom_em_loglike_gradient, 10},
    {"_sirt_sirt_rcpp_inference_jackknife", (DL_FUNC) &_sirt_sirt_rcpp_inference_jackknife, 1},
    {"_sirt_sirt_rcpp_invariance_alignment_lambda_transformed", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_lambda_transformed, 3},
    {"_sirt_sirt_rcpp_invariance_alignment_nu_transformed", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_nu_transformed, 6},
    {"_sirt_sirt_rcpp_invariance_alignment_simplicity_function_value", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_simplicity_function_value, 6},
    {"_sirt_sirt_rcpp_invariance_alignment_opt_fct", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_opt_fct, 13},
    {"_sirt_sirt_rcpp_invariance_alignment_simplicity_function_gradient", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_simplicity_function_gradient, 6},
    {"_sirt_sirt_rcpp_invariance_alignment_opt_grad", (DL_FUNC) &_sirt_sirt_rcpp_invariance_alignment_opt_grad, 13},
    {"_sirt_sirt_rcpp_linking_haebara_fct_optim_one_item", (DL_FUNC) &_sirt_sirt_rcpp_linking_haebara_fct_optim_one_item, 13},
    {"_sirt_sirt_rcpp_linking_haebara_fct_optim", (DL_FUNC) &_sirt_sirt_rcpp_linking_haebara_fct_optim, 15},
    {"_sirt_sirt_rcpp_linking_haebara_grad_optim_one_item", (DL_FUNC) &_sirt_sirt_rcpp_linking_haebara_grad_optim_one_item, 21},
    {"_sirt_sirt_rcpp_linking_haebara_grad_optim", (DL_FUNC) &_sirt_sirt_rcpp_linking_haebara_grad_optim, 21},
    {"_sirt_sirt_rcpp_lq_fit_analyze_matrix", (DL_FUNC) &_sirt_sirt_rcpp_lq_fit_analyze_matrix, 1},
    {"_sirt_sirt_rcpp_lq_fit_sparse_matrix_derivative", (DL_FUNC) &_sirt_sirt_rcpp_lq_fit_sparse_matrix_derivative, 3},
    {"_sirt_sirt_rcpp_lq_fit_matrix_mult", (DL_FUNC) &_sirt_sirt_rcpp_lq_fit_matrix_mult, 3},
    {"_sirt_sirt_rcpp_lq_fit_fct_optim", (DL_FUNC) &_sirt_sirt_rcpp_lq_fit_fct_optim, 6},
    {"_sirt_sirt_rcpp_mgsem_quadform", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_quadform, 2},
    {"_sirt_sirt_rcpp_mgsem_quadform_logical", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_quadform_logical, 3},
    {"_sirt_sirt_rcpp_mgsem_trace_product", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_trace_product, 2},
    {"_sirt_sirt_rcpp_mgsem_trace_product_logical", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_trace_product_logical, 3},
    {"_sirt_sirt_rcpp_mgsem_loglike_derivative_parameters", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_loglike_derivative_parameters, 5},
    {"_sirt_sirt_rcpp_mgsem_compute_cov", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_compute_cov, 3},
    {"_sirt_sirt_rcpp_mgsem_sumproduct_logical", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_sumproduct_logical, 3},
    {"_sirt_sirt_rcpp_mgsem_vech_numeric", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_vech_numeric, 1},
    {"_sirt_sirt_rcpp_mgsem_vech_logical", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_vech_logical, 1},
    {"_sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso, 4},
    {"_sirt_sirt_rcpp_mgsem_eval_pen_lp_scad", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_pen_lp_scad, 5},
    {"_sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_pen_lp_lasso_deriv, 4},
    {"_sirt_sirt_rcpp_mgsem_eval_lp_penalty", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_lp_penalty, 9},
    {"_sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty, 8},
    {"_sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv", (DL_FUNC) &_sirt_sirt_rcpp_mgsem_eval_lpdiff_penalty_deriv, 9},
    {"_sirt_sirt_rcpp_monoreg_rowwise", (DL_FUNC) &_sirt_sirt_rcpp_monoreg_rowwise, 2},
    {"_sirt_sirt_rcpp_noharm_sirt_optim_fn_rcpp", (DL_FUNC) &_sirt_sirt_rcpp_noharm_sirt_optim_fn_rcpp, 9},
    {"_sirt_sirt_rcpp_noharm_sirt_optim_gr_rcpp", (DL_FUNC) &_sirt_sirt_rcpp_noharm_sirt_optim_gr_rcpp, 18},
    {"_sirt_sirt_rcpp_pnorm0", (DL_FUNC) &_sirt_sirt_rcpp_pnorm0, 1},
    {"_sirt_sirt_rcpp_pnorm", (DL_FUNC) &_sirt_sirt_rcpp_pnorm, 1},
    {"_sirt_sirt_rcpp_pbvnorm0", (DL_FUNC) &_sirt_sirt_rcpp_pbvnorm0, 3},
    {"_sirt_sirt_rcpp_pbvnorm", (DL_FUNC) &_sirt_sirt_rcpp_pbvnorm, 3},
    {"_sirt_sirt_rcpp_dbvnorm0", (DL_FUNC) &_sirt_sirt_rcpp_dbvnorm0, 4},
    {"_sirt_sirt_rcpp_dbvnorm", (DL_FUNC) &_sirt_sirt_rcpp_dbvnorm, 4},
    {"_sirt_sirt_rcpp_pbivnorm2", (DL_FUNC) &_sirt_sirt_rcpp_pbivnorm2, 3},
    {"_sirt_sirt_rcpp_dmvnorm_2dim", (DL_FUNC) &_sirt_sirt_rcpp_dmvnorm_2dim, 3},
    {"_sirt_sirt_rcpp_polychoric2_pbivnorm", (DL_FUNC) &_sirt_sirt_rcpp_polychoric2_pbivnorm, 4},
    {"_sirt_sirt_rcpp_polychoric2_estimating_equation", (DL_FUNC) &_sirt_sirt_rcpp_polychoric2_estimating_equation, 8},
    {"_sirt_sirt_rcpp_polychoric2_est_itempair", (DL_FUNC) &_sirt_sirt_rcpp_polychoric2_est_itempair, 8},
    {"_sirt_sirt_rcpp_polychoric2", (DL_FUNC) &_sirt_sirt_rcpp_polychoric2, 7},
    {"_sirt_sirt_rcpp_tetrachoric2_rcpp", (DL_FUNC) &_sirt_sirt_rcpp_tetrachoric2_rcpp, 3},
    {"_sirt_sirt_rcpp_rm_proc_datasets_na_indicators", (DL_FUNC) &_sirt_sirt_rcpp_rm_proc_datasets_na_indicators, 2},
    {"_sirt_sirt_rcpp_rm_proc_expand_dataset", (DL_FUNC) &_sirt_sirt_rcpp_rm_proc_expand_dataset, 5},
    {"_sirt_sirt_rcpp_rm_sdt_posterior", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_posterior, 10},
    {"_sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_a, 3},
    {"_sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_gradient_item_deriv_tau, 3},
    {"_sirt_sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_gradient_likelihood_item_llgrad, 3},
    {"_sirt_sirt_rcpp_squeeze_eps", (DL_FUNC) &_sirt_sirt_rcpp_squeeze_eps, 2},
    {"_sirt_sirt_rcpp_log", (DL_FUNC) &_sirt_sirt_rcpp_log, 1},
    {"_sirt_sirt_rcpp_plogis", (DL_FUNC) &_sirt_sirt_rcpp_plogis, 1},
    {"_sirt_sirt_rcpp_rm_sdt_calc_probs_gpcm", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_probs_gpcm, 8},
    {"_sirt_sirt_rcpp_rm_sdt_calc_probs_grm_rater", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_probs_grm_rater, 6},
    {"_sirt_sirt_rcpp_rm_sdt_calc_probs_grm_item", (DL_FUNC) &_sirt_sirt_rcpp_rm_sdt_calc_probs_grm_item, 8},
    {"_sirt_sirt_rcpp_xxirt_compute_posterior_expected_counts", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_compute_posterior_expected_counts, 3},
    {"_sirt_sirt_rcpp_xxirt_compute_likelihood", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_compute_likelihood, 5},
    {"_sirt_sirt_rcpp_xxirt_compute_likelihood_person_covariates", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_compute_likelihood_person_covariates, 5},
    {"_sirt_sirt_rcpp_xxirt_compute_loglike_case_theta_covariates", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_compute_loglike_case_theta_covariates, 5},
    {"_sirt_sirt_rcpp_xxirt_hessian_reduced_probs", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_hessian_reduced_probs, 9},
    {"_sirt_sirt_rcpp_xxirt_newton_raphson_derivative_par", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_newton_raphson_derivative_par, 12},
    {"_sirt_sirt_rcpp_xxirt_nr_pml_opt_fun", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_nr_pml_opt_fun, 12},
    {"_sirt_sirt_rcpp_xxirt_nr_pml_grad_fun_eval", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_nr_pml_grad_fun_eval, 20},
    {"_sirt_sirt_rcpp_xxirt_nr_pml_casewise_opt_fun", (DL_FUNC) &_sirt_sirt_rcpp_xxirt_nr_pml_casewise_opt_fun, 14},
    {NULL, NULL, 0}
};

RcppExport void R_init_sirt(DllInfo *dll) {
    R_registerRoutines(dll, NULL, CallEntries, NULL, NULL);
    R_useDynamicSymbols(dll, FALSE);
}
