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

#include "survPen_types.h"
#include <RcppEigen.h>
#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

// multmat
MatrixXd multmat(const Map<MatrixXd> Mat1, const Map<MatrixXd> Mat2);
RcppExport SEXP _survPen_multmat(SEXP Mat1SEXP, SEXP Mat2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Mat1(Mat1SEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Mat2(Mat2SEXP);
    rcpp_result_gen = Rcpp::wrap(multmat(Mat1, Mat2));
    return rcpp_result_gen;
END_RCPP
}
// multcross
MatrixXd multcross(const Map<MatrixXd> Mat1, const Map<MatrixXd> Mat2);
RcppExport SEXP _survPen_multcross(SEXP Mat1SEXP, SEXP Mat2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Mat1(Mat1SEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Mat2(Mat2SEXP);
    rcpp_result_gen = Rcpp::wrap(multcross(Mat1, Mat2));
    return rcpp_result_gen;
END_RCPP
}
// multvec
VectorXd multvec(const Map<MatrixXd> Mat, const Map<VectorXd> vec);
RcppExport SEXP _survPen_multvec(SEXP MatSEXP, SEXP vecSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Mat(MatSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type vec(vecSEXP);
    rcpp_result_gen = Rcpp::wrap(multvec(Mat, vec));
    return rcpp_result_gen;
END_RCPP
}
// colSums2
VectorXd colSums2(Map<MatrixXd> Mat);
RcppExport SEXP _survPen_colSums2(SEXP MatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Map<MatrixXd> >::type Mat(MatSEXP);
    rcpp_result_gen = Rcpp::wrap(colSums2(Mat));
    return rcpp_result_gen;
END_RCPP
}
// deriv_R
List deriv_R(const List deriv_Vp, const int p, const Map<MatrixXd> R1);
RcppExport SEXP _survPen_deriv_R(SEXP deriv_VpSEXP, SEXP pSEXP, SEXP R1SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List >::type deriv_Vp(deriv_VpSEXP);
    Rcpp::traits::input_parameter< const int >::type p(pSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type R1(R1SEXP);
    rcpp_result_gen = Rcpp::wrap(deriv_R(deriv_Vp, p, R1));
    return rcpp_result_gen;
END_RCPP
}
// grad_rho
List grad_rho(const List X_GL, const List GL_temp, const List haz_GL, const Map<MatrixXd> deriv_rho_beta, const Map<VectorXd> weights, const Map<VectorXd> tm, const int nb_smooth, const int p, const int n_legendre, const List S_list, const List temp_LAML, const Map<MatrixXd> Vp, const List S_beta, const Map<VectorXd> beta, const Map<MatrixXd> inverse_new_S, const Map<MatrixXd> X, const Map<MatrixXd> temp_deriv3, const Map<VectorXd> event, const Map<VectorXd> expected, const String type, const Map<MatrixXd> Ve, const Map<MatrixXd> mat_temp, const String method);
RcppExport SEXP _survPen_grad_rho(SEXP X_GLSEXP, SEXP GL_tempSEXP, SEXP haz_GLSEXP, SEXP deriv_rho_betaSEXP, SEXP weightsSEXP, SEXP tmSEXP, SEXP nb_smoothSEXP, SEXP pSEXP, SEXP n_legendreSEXP, SEXP S_listSEXP, SEXP temp_LAMLSEXP, SEXP VpSEXP, SEXP S_betaSEXP, SEXP betaSEXP, SEXP inverse_new_SSEXP, SEXP XSEXP, SEXP temp_deriv3SEXP, SEXP eventSEXP, SEXP expectedSEXP, SEXP typeSEXP, SEXP VeSEXP, SEXP mat_tempSEXP, SEXP methodSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List >::type X_GL(X_GLSEXP);
    Rcpp::traits::input_parameter< const List >::type GL_temp(GL_tempSEXP);
    Rcpp::traits::input_parameter< const List >::type haz_GL(haz_GLSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type deriv_rho_beta(deriv_rho_betaSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type tm(tmSEXP);
    Rcpp::traits::input_parameter< const int >::type nb_smooth(nb_smoothSEXP);
    Rcpp::traits::input_parameter< const int >::type p(pSEXP);
    Rcpp::traits::input_parameter< const int >::type n_legendre(n_legendreSEXP);
    Rcpp::traits::input_parameter< const List >::type S_list(S_listSEXP);
    Rcpp::traits::input_parameter< const List >::type temp_LAML(temp_LAMLSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Vp(VpSEXP);
    Rcpp::traits::input_parameter< const List >::type S_beta(S_betaSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type inverse_new_S(inverse_new_SSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type temp_deriv3(temp_deriv3SEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type event(eventSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type expected(expectedSEXP);
    Rcpp::traits::input_parameter< const String >::type type(typeSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Ve(VeSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type mat_temp(mat_tempSEXP);
    Rcpp::traits::input_parameter< const String >::type method(methodSEXP);
    rcpp_result_gen = Rcpp::wrap(grad_rho(X_GL, GL_temp, haz_GL, deriv_rho_beta, weights, tm, nb_smooth, p, n_legendre, S_list, temp_LAML, Vp, S_beta, beta, inverse_new_S, X, temp_deriv3, event, expected, type, Ve, mat_temp, method));
    return rcpp_result_gen;
END_RCPP
}
// Hess_rho
MatrixXd Hess_rho(const List X_GL, const List X_GL_Q, const List GL_temp, const List haz_GL, const List deriv2_rho_beta, const Map<MatrixXd> deriv_rho_beta, const Map<VectorXd> weights, const Map<VectorXd> tm, const int nb_smooth, const int p, const int n_legendre, const List deriv_rho_inv_Hess_beta, const List deriv_rho_Hess_unpen_beta, const List S_list, const Map<VectorXd> minus_eigen_inv_Hess_beta, const List temp_LAML, const List temp_LAML2, const Map<MatrixXd> Vp, const List S_beta, const Map<VectorXd> beta, const Map<MatrixXd> inverse_new_S, const Map<MatrixXd> X, const Map<MatrixXd> X_Q, const Map<MatrixXd> temp_deriv3, const Map<MatrixXd> temp_deriv4, const Map<VectorXd> event, const Map<VectorXd> expected, const String type, const Map<MatrixXd> Ve, const List deriv_rho_Ve, const Map<MatrixXd> mat_temp, const List deriv_mat_temp, const Map<VectorXd> eigen_mat_temp, const String method);
RcppExport SEXP _survPen_Hess_rho(SEXP X_GLSEXP, SEXP X_GL_QSEXP, SEXP GL_tempSEXP, SEXP haz_GLSEXP, SEXP deriv2_rho_betaSEXP, SEXP deriv_rho_betaSEXP, SEXP weightsSEXP, SEXP tmSEXP, SEXP nb_smoothSEXP, SEXP pSEXP, SEXP n_legendreSEXP, SEXP deriv_rho_inv_Hess_betaSEXP, SEXP deriv_rho_Hess_unpen_betaSEXP, SEXP S_listSEXP, SEXP minus_eigen_inv_Hess_betaSEXP, SEXP temp_LAMLSEXP, SEXP temp_LAML2SEXP, SEXP VpSEXP, SEXP S_betaSEXP, SEXP betaSEXP, SEXP inverse_new_SSEXP, SEXP XSEXP, SEXP X_QSEXP, SEXP temp_deriv3SEXP, SEXP temp_deriv4SEXP, SEXP eventSEXP, SEXP expectedSEXP, SEXP typeSEXP, SEXP VeSEXP, SEXP deriv_rho_VeSEXP, SEXP mat_tempSEXP, SEXP deriv_mat_tempSEXP, SEXP eigen_mat_tempSEXP, SEXP methodSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List >::type X_GL(X_GLSEXP);
    Rcpp::traits::input_parameter< const List >::type X_GL_Q(X_GL_QSEXP);
    Rcpp::traits::input_parameter< const List >::type GL_temp(GL_tempSEXP);
    Rcpp::traits::input_parameter< const List >::type haz_GL(haz_GLSEXP);
    Rcpp::traits::input_parameter< const List >::type deriv2_rho_beta(deriv2_rho_betaSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type deriv_rho_beta(deriv_rho_betaSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type tm(tmSEXP);
    Rcpp::traits::input_parameter< const int >::type nb_smooth(nb_smoothSEXP);
    Rcpp::traits::input_parameter< const int >::type p(pSEXP);
    Rcpp::traits::input_parameter< const int >::type n_legendre(n_legendreSEXP);
    Rcpp::traits::input_parameter< const List >::type deriv_rho_inv_Hess_beta(deriv_rho_inv_Hess_betaSEXP);
    Rcpp::traits::input_parameter< const List >::type deriv_rho_Hess_unpen_beta(deriv_rho_Hess_unpen_betaSEXP);
    Rcpp::traits::input_parameter< const List >::type S_list(S_listSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type minus_eigen_inv_Hess_beta(minus_eigen_inv_Hess_betaSEXP);
    Rcpp::traits::input_parameter< const List >::type temp_LAML(temp_LAMLSEXP);
    Rcpp::traits::input_parameter< const List >::type temp_LAML2(temp_LAML2SEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Vp(VpSEXP);
    Rcpp::traits::input_parameter< const List >::type S_beta(S_betaSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type inverse_new_S(inverse_new_SSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type X_Q(X_QSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type temp_deriv3(temp_deriv3SEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type temp_deriv4(temp_deriv4SEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type event(eventSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type expected(expectedSEXP);
    Rcpp::traits::input_parameter< const String >::type type(typeSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type Ve(VeSEXP);
    Rcpp::traits::input_parameter< const List >::type deriv_rho_Ve(deriv_rho_VeSEXP);
    Rcpp::traits::input_parameter< const Map<MatrixXd> >::type mat_temp(mat_tempSEXP);
    Rcpp::traits::input_parameter< const List >::type deriv_mat_temp(deriv_mat_tempSEXP);
    Rcpp::traits::input_parameter< const Map<VectorXd> >::type eigen_mat_temp(eigen_mat_tempSEXP);
    Rcpp::traits::input_parameter< const String >::type method(methodSEXP);
    rcpp_result_gen = Rcpp::wrap(Hess_rho(X_GL, X_GL_Q, GL_temp, haz_GL, deriv2_rho_beta, deriv_rho_beta, weights, tm, nb_smooth, p, n_legendre, deriv_rho_inv_Hess_beta, deriv_rho_Hess_unpen_beta, S_list, minus_eigen_inv_Hess_beta, temp_LAML, temp_LAML2, Vp, S_beta, beta, inverse_new_S, X, X_Q, temp_deriv3, temp_deriv4, event, expected, type, Ve, deriv_rho_Ve, mat_temp, deriv_mat_temp, eigen_mat_temp, method));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_survPen_multmat", (DL_FUNC) &_survPen_multmat, 2},
    {"_survPen_multcross", (DL_FUNC) &_survPen_multcross, 2},
    {"_survPen_multvec", (DL_FUNC) &_survPen_multvec, 2},
    {"_survPen_colSums2", (DL_FUNC) &_survPen_colSums2, 1},
    {"_survPen_deriv_R", (DL_FUNC) &_survPen_deriv_R, 3},
    {"_survPen_grad_rho", (DL_FUNC) &_survPen_grad_rho, 23},
    {"_survPen_Hess_rho", (DL_FUNC) &_survPen_Hess_rho, 34},
    {NULL, NULL, 0}
};

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