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

#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

// compute_treeshap
Eigen::MatrixXd compute_treeshap(const Eigen::MatrixXd& x, const Eigen::VectorXi& children_left, const Eigen::VectorXi& children_right, const Eigen::VectorXi& feature, const Eigen::VectorXd& threshold, const Eigen::VectorXd& value, const Eigen::VectorXd& n_node_samples);
RcppExport SEXP _qshap_compute_treeshap(SEXP xSEXP, SEXP children_leftSEXP, SEXP children_rightSEXP, SEXP featureSEXP, SEXP thresholdSEXP, SEXP valueSEXP, SEXP n_node_samplesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Eigen::MatrixXd& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXi& >::type children_left(children_leftSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXi& >::type children_right(children_rightSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXi& >::type feature(featureSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXd& >::type threshold(thresholdSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXd& >::type value(valueSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXd& >::type n_node_samples(n_node_samplesSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_treeshap(x, children_left, children_right, feature, threshold, value, n_node_samples));
    return rcpp_result_gen;
END_RCPP
}
// T2
Eigen::MatrixXd T2(const Eigen::MatrixXd& x, const Rcpp::List& tree_summary, const Eigen::MatrixXcd& store_v_invc, const Eigen::MatrixXcd& store_z, bool parallel);
RcppExport SEXP _qshap_T2(SEXP xSEXP, SEXP tree_summarySEXP, SEXP store_v_invcSEXP, SEXP store_zSEXP, SEXP parallelSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Eigen::MatrixXd& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type tree_summary(tree_summarySEXP);
    Rcpp::traits::input_parameter< const Eigen::MatrixXcd& >::type store_v_invc(store_v_invcSEXP);
    Rcpp::traits::input_parameter< const Eigen::MatrixXcd& >::type store_z(store_zSEXP);
    Rcpp::traits::input_parameter< bool >::type parallel(parallelSEXP);
    rcpp_result_gen = Rcpp::wrap(T2(x, tree_summary, store_v_invc, store_z, parallel));
    return rcpp_result_gen;
END_RCPP
}
// loss_treeshap
Eigen::MatrixXd loss_treeshap(const Eigen::MatrixXd& x, const Eigen::VectorXd& y, const Rcpp::List& tree_summary, const Eigen::MatrixXcd& store_v_invc, const Eigen::MatrixXcd& store_z, const Eigen::MatrixXd& T0_x, double learning_rate);
RcppExport SEXP _qshap_loss_treeshap(SEXP xSEXP, SEXP ySEXP, SEXP tree_summarySEXP, SEXP store_v_invcSEXP, SEXP store_zSEXP, SEXP T0_xSEXP, SEXP learning_rateSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Eigen::MatrixXd& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Eigen::VectorXd& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type tree_summary(tree_summarySEXP);
    Rcpp::traits::input_parameter< const Eigen::MatrixXcd& >::type store_v_invc(store_v_invcSEXP);
    Rcpp::traits::input_parameter< const Eigen::MatrixXcd& >::type store_z(store_zSEXP);
    Rcpp::traits::input_parameter< const Eigen::MatrixXd& >::type T0_x(T0_xSEXP);
    Rcpp::traits::input_parameter< double >::type learning_rate(learning_rateSEXP);
    rcpp_result_gen = Rcpp::wrap(loss_treeshap(x, y, tree_summary, store_v_invc, store_z, T0_x, learning_rate));
    return rcpp_result_gen;
END_RCPP
}
// store_complex_v_invc
Eigen::MatrixXcd store_complex_v_invc(int d);
RcppExport SEXP _qshap_store_complex_v_invc(SEXP dSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type d(dSEXP);
    rcpp_result_gen = Rcpp::wrap(store_complex_v_invc(d));
    return rcpp_result_gen;
END_RCPP
}
// store_complex_root
Eigen::MatrixXcd store_complex_root(int d);
RcppExport SEXP _qshap_store_complex_root(SEXP dSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type d(dSEXP);
    rcpp_result_gen = Rcpp::wrap(store_complex_root(d));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_qshap_compute_treeshap", (DL_FUNC) &_qshap_compute_treeshap, 7},
    {"_qshap_T2", (DL_FUNC) &_qshap_T2, 5},
    {"_qshap_loss_treeshap", (DL_FUNC) &_qshap_loss_treeshap, 7},
    {"_qshap_store_complex_v_invc", (DL_FUNC) &_qshap_store_complex_v_invc, 1},
    {"_qshap_store_complex_root", (DL_FUNC) &_qshap_store_complex_root, 1},
    {NULL, NULL, 0}
};

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