// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#include <Rcpp.h>

using namespace Rcpp;

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

// matMultinom
IntegerVector matMultinom(NumericMatrix probmatrix);
RcppExport SEXP _simstudy_matMultinom(SEXP probmatrixSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type probmatrix(probmatrixSEXP);
    rcpp_result_gen = Rcpp::wrap(matMultinom(probmatrix));
    return rcpp_result_gen;
END_RCPP
}
// markovChains
IntegerMatrix markovChains(int nchains, NumericMatrix P, int chainLen, IntegerVector state0);
RcppExport SEXP _simstudy_markovChains(SEXP nchainsSEXP, SEXP PSEXP, SEXP chainLenSEXP, SEXP state0SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type nchains(nchainsSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type P(PSEXP);
    Rcpp::traits::input_parameter< int >::type chainLen(chainLenSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type state0(state0SEXP);
    rcpp_result_gen = Rcpp::wrap(markovChains(nchains, P, chainLen, state0));
    return rcpp_result_gen;
END_RCPP
}
// clipVec
IntegerVector clipVec(IntegerVector id, IntegerVector seq, IntegerVector event);
RcppExport SEXP _simstudy_clipVec(SEXP idSEXP, SEXP seqSEXP, SEXP eventSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type id(idSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type seq(seqSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type event(eventSEXP);
    rcpp_result_gen = Rcpp::wrap(clipVec(id, seq, event));
    return rcpp_result_gen;
END_RCPP
}
// chkNonIncreasing
bool chkNonIncreasing(NumericMatrix adjmatrix);
RcppExport SEXP _simstudy_chkNonIncreasing(SEXP adjmatrixSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type adjmatrix(adjmatrixSEXP);
    rcpp_result_gen = Rcpp::wrap(chkNonIncreasing(adjmatrix));
    return rcpp_result_gen;
END_RCPP
}
// checkBoundsBin
void checkBoundsBin(double p1, double p2, double d);
RcppExport SEXP _simstudy_checkBoundsBin(SEXP p1SEXP, SEXP p2SEXP, SEXP dSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type p1(p1SEXP);
    Rcpp::traits::input_parameter< double >::type p2(p2SEXP);
    Rcpp::traits::input_parameter< double >::type d(dSEXP);
    checkBoundsBin(p1, p2, d);
    return R_NilValue;
END_RCPP
}
// findRhoBin
double findRhoBin(double p1, double p2, double d);
RcppExport SEXP _simstudy_findRhoBin(SEXP p1SEXP, SEXP p2SEXP, SEXP dSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type p1(p1SEXP);
    Rcpp::traits::input_parameter< double >::type p2(p2SEXP);
    Rcpp::traits::input_parameter< double >::type d(dSEXP);
    rcpp_result_gen = Rcpp::wrap(findRhoBin(p1, p2, d));
    return rcpp_result_gen;
END_RCPP
}
// getRhoMat
NumericMatrix getRhoMat(int N, NumericVector P, NumericMatrix TCORR);
RcppExport SEXP _simstudy_getRhoMat(SEXP NSEXP, SEXP PSEXP, SEXP TCORRSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type N(NSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type P(PSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type TCORR(TCORRSEXP);
    rcpp_result_gen = Rcpp::wrap(getRhoMat(N, P, TCORR));
    return rcpp_result_gen;
END_RCPP
}
// getBeta0
double getBeta0(NumericVector lvec, double popPrev, double tolerance);
RcppExport SEXP _simstudy_getBeta0(SEXP lvecSEXP, SEXP popPrevSEXP, SEXP toleranceSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type lvec(lvecSEXP);
    Rcpp::traits::input_parameter< double >::type popPrev(popPrevSEXP);
    Rcpp::traits::input_parameter< double >::type tolerance(toleranceSEXP);
    rcpp_result_gen = Rcpp::wrap(getBeta0(lvec, popPrev, tolerance));
    return rcpp_result_gen;
END_RCPP
}
// estAUC
double estAUC(NumericMatrix dmatrix, NumericVector y);
RcppExport SEXP _simstudy_estAUC(SEXP dmatrixSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type dmatrix(dmatrixSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(estAUC(dmatrix, y));
    return rcpp_result_gen;
END_RCPP
}
// getBeta_auc
NumericVector getBeta_auc(NumericMatrix covmat, NumericVector coefs, double auc, double popPrev, double tolerance);
RcppExport SEXP _simstudy_getBeta_auc(SEXP covmatSEXP, SEXP coefsSEXP, SEXP aucSEXP, SEXP popPrevSEXP, SEXP toleranceSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type covmat(covmatSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type coefs(coefsSEXP);
    Rcpp::traits::input_parameter< double >::type auc(aucSEXP);
    Rcpp::traits::input_parameter< double >::type popPrev(popPrevSEXP);
    Rcpp::traits::input_parameter< double >::type tolerance(toleranceSEXP);
    rcpp_result_gen = Rcpp::wrap(getBeta_auc(covmat, coefs, auc, popPrev, tolerance));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_simstudy_matMultinom", (DL_FUNC) &_simstudy_matMultinom, 1},
    {"_simstudy_markovChains", (DL_FUNC) &_simstudy_markovChains, 4},
    {"_simstudy_clipVec", (DL_FUNC) &_simstudy_clipVec, 3},
    {"_simstudy_chkNonIncreasing", (DL_FUNC) &_simstudy_chkNonIncreasing, 1},
    {"_simstudy_checkBoundsBin", (DL_FUNC) &_simstudy_checkBoundsBin, 3},
    {"_simstudy_findRhoBin", (DL_FUNC) &_simstudy_findRhoBin, 3},
    {"_simstudy_getRhoMat", (DL_FUNC) &_simstudy_getRhoMat, 3},
    {"_simstudy_getBeta0", (DL_FUNC) &_simstudy_getBeta0, 3},
    {"_simstudy_estAUC", (DL_FUNC) &_simstudy_estAUC, 2},
    {"_simstudy_getBeta_auc", (DL_FUNC) &_simstudy_getBeta_auc, 5},
    {NULL, NULL, 0}
};

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