// 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

// poisson_deviance_by_folder_cols
NumericMatrix poisson_deviance_by_folder_cols(List log_hazard_cols, NumericVector tij, IntegerVector delta, IntegerVector folder, int nfold, double eps);
RcppExport SEXP _poissonsuperlearner_poisson_deviance_by_folder_cols(SEXP log_hazard_colsSEXP, SEXP tijSEXP, SEXP deltaSEXP, SEXP folderSEXP, SEXP nfoldSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type log_hazard_cols(log_hazard_colsSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type tij(tijSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type folder(folderSEXP);
    Rcpp::traits::input_parameter< int >::type nfold(nfoldSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(poisson_deviance_by_folder_cols(log_hazard_cols, tij, delta, folder, nfold, eps));
    return rcpp_result_gen;
END_RCPP
}
// inter2_cpp
IntegerVector inter2_cpp(IntegerVector a, IntegerVector b);
RcppExport SEXP _poissonsuperlearner_inter2_cpp(SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type a(aSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type b(bSEXP);
    rcpp_result_gen = Rcpp::wrap(inter2_cpp(a, b));
    return rcpp_result_gen;
END_RCPP
}
// interN_cpp
IntegerVector interN_cpp(List lst);
RcppExport SEXP _poissonsuperlearner_interN_cpp(SEXP lstSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lst(lstSEXP);
    rcpp_result_gen = Rcpp::wrap(interN_cpp(lst));
    return rcpp_result_gen;
END_RCPP
}
// mk_main_numeric_cpp
List mk_main_numeric_cpp(NumericVector x, int K);
RcppExport SEXP _poissonsuperlearner_mk_main_numeric_cpp(SEXP xSEXP, SEXP KSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type K(KSEXP);
    rcpp_result_gen = Rcpp::wrap(mk_main_numeric_cpp(x, K));
    return rcpp_result_gen;
END_RCPP
}
// mk_main_factor_cpp
List mk_main_factor_cpp(IntegerVector x_int, int n_levels);
RcppExport SEXP _poissonsuperlearner_mk_main_factor_cpp(SEXP x_intSEXP, SEXP n_levelsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type x_int(x_intSEXP);
    Rcpp::traits::input_parameter< int >::type n_levels(n_levelsSEXP);
    rcpp_result_gen = Rcpp::wrap(mk_main_factor_cpp(x_int, n_levels));
    return rcpp_result_gen;
END_RCPP
}
// add_cols_cpp
List add_cols_cpp(List idxs_list, int p_start);
RcppExport SEXP _poissonsuperlearner_add_cols_cpp(SEXP idxs_listSEXP, SEXP p_startSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type idxs_list(idxs_listSEXP);
    Rcpp::traits::input_parameter< int >::type p_start(p_startSEXP);
    rcpp_result_gen = Rcpp::wrap(add_cols_cpp(idxs_list, p_start));
    return rcpp_result_gen;
END_RCPP
}
// pch_absolute_risk
NumericVector pch_absolute_risk(IntegerVector id, NumericVector dt, NumericMatrix haz, int cause_idx, const bool one_based, const bool na_is_zero);
RcppExport SEXP _poissonsuperlearner_pch_absolute_risk(SEXP idSEXP, SEXP dtSEXP, SEXP hazSEXP, SEXP cause_idxSEXP, SEXP one_basedSEXP, SEXP na_is_zeroSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type id(idSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type dt(dtSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type haz(hazSEXP);
    Rcpp::traits::input_parameter< int >::type cause_idx(cause_idxSEXP);
    Rcpp::traits::input_parameter< const bool >::type one_based(one_basedSEXP);
    Rcpp::traits::input_parameter< const bool >::type na_is_zero(na_is_zeroSEXP);
    rcpp_result_gen = Rcpp::wrap(pch_absolute_risk(id, dt, haz, cause_idx, one_based, na_is_zero));
    return rcpp_result_gen;
END_RCPP
}
// pch_absolute_risk_euler
NumericVector pch_absolute_risk_euler(IntegerVector id, NumericVector dt, NumericMatrix haz, int cause_idx, const bool one_based, const bool na_is_zero);
RcppExport SEXP _poissonsuperlearner_pch_absolute_risk_euler(SEXP idSEXP, SEXP dtSEXP, SEXP hazSEXP, SEXP cause_idxSEXP, SEXP one_basedSEXP, SEXP na_is_zeroSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type id(idSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type dt(dtSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type haz(hazSEXP);
    Rcpp::traits::input_parameter< int >::type cause_idx(cause_idxSEXP);
    Rcpp::traits::input_parameter< const bool >::type one_based(one_basedSEXP);
    Rcpp::traits::input_parameter< const bool >::type na_is_zero(na_is_zeroSEXP);
    rcpp_result_gen = Rcpp::wrap(pch_absolute_risk_euler(id, dt, haz, cause_idx, one_based, na_is_zero));
    return rcpp_result_gen;
END_RCPP
}
// pch_survival
NumericVector pch_survival(IntegerVector id, NumericVector dt, NumericMatrix haz, const bool na_is_zero);
RcppExport SEXP _poissonsuperlearner_pch_survival(SEXP idSEXP, SEXP dtSEXP, SEXP hazSEXP, SEXP na_is_zeroSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type id(idSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type dt(dtSEXP);
    Rcpp::traits::input_parameter< NumericMatrix >::type haz(hazSEXP);
    Rcpp::traits::input_parameter< const bool >::type na_is_zero(na_is_zeroSEXP);
    rcpp_result_gen = Rcpp::wrap(pch_survival(id, dt, haz, na_is_zero));
    return rcpp_result_gen;
END_RCPP
}
// poisson_deviance_by_folder
NumericMatrix poisson_deviance_by_folder(const NumericMatrix& log_hazard, const NumericVector& tij, const IntegerVector& delta, const IntegerVector& folder, const int F, const double eps);
RcppExport SEXP _poissonsuperlearner_poisson_deviance_by_folder(SEXP log_hazardSEXP, SEXP tijSEXP, SEXP deltaSEXP, SEXP folderSEXP, SEXP FSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type log_hazard(log_hazardSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type tij(tijSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type delta(deltaSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type folder(folderSEXP);
    Rcpp::traits::input_parameter< const int >::type F(FSEXP);
    Rcpp::traits::input_parameter< const double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(poisson_deviance_by_folder(log_hazard, tij, delta, folder, F, eps));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_poissonsuperlearner_poisson_deviance_by_folder_cols", (DL_FUNC) &_poissonsuperlearner_poisson_deviance_by_folder_cols, 6},
    {"_poissonsuperlearner_inter2_cpp", (DL_FUNC) &_poissonsuperlearner_inter2_cpp, 2},
    {"_poissonsuperlearner_interN_cpp", (DL_FUNC) &_poissonsuperlearner_interN_cpp, 1},
    {"_poissonsuperlearner_mk_main_numeric_cpp", (DL_FUNC) &_poissonsuperlearner_mk_main_numeric_cpp, 2},
    {"_poissonsuperlearner_mk_main_factor_cpp", (DL_FUNC) &_poissonsuperlearner_mk_main_factor_cpp, 2},
    {"_poissonsuperlearner_add_cols_cpp", (DL_FUNC) &_poissonsuperlearner_add_cols_cpp, 2},
    {"_poissonsuperlearner_pch_absolute_risk", (DL_FUNC) &_poissonsuperlearner_pch_absolute_risk, 6},
    {"_poissonsuperlearner_pch_absolute_risk_euler", (DL_FUNC) &_poissonsuperlearner_pch_absolute_risk_euler, 6},
    {"_poissonsuperlearner_pch_survival", (DL_FUNC) &_poissonsuperlearner_pch_survival, 4},
    {"_poissonsuperlearner_poisson_deviance_by_folder", (DL_FUNC) &_poissonsuperlearner_poisson_deviance_by_folder, 6},
    {NULL, NULL, 0}
};

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