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

// solve_QP
Rcpp::List solve_QP(Rcpp::NumericMatrix Sigma, double bound, int max_iter, Rcpp::NumericVector theta, Rcpp::NumericVector linear_func, Rcpp::NumericVector gradient, Rcpp::IntegerVector ever_active, Rcpp::IntegerVector nactive, double kkt_tol, double objective_tol, double parameter_tol, int max_active, int kkt_stop, int objective_stop, int param_stop);
RcppExport SEXP _selectiveInference_solve_QP(SEXP SigmaSEXP, SEXP boundSEXP, SEXP max_iterSEXP, SEXP thetaSEXP, SEXP linear_funcSEXP, SEXP gradientSEXP, SEXP ever_activeSEXP, SEXP nactiveSEXP, SEXP kkt_tolSEXP, SEXP objective_tolSEXP, SEXP parameter_tolSEXP, SEXP max_activeSEXP, SEXP kkt_stopSEXP, SEXP objective_stopSEXP, SEXP param_stopSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Sigma(SigmaSEXP);
    Rcpp::traits::input_parameter< double >::type bound(boundSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type linear_func(linear_funcSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type gradient(gradientSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type ever_active(ever_activeSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type nactive(nactiveSEXP);
    Rcpp::traits::input_parameter< double >::type kkt_tol(kkt_tolSEXP);
    Rcpp::traits::input_parameter< double >::type objective_tol(objective_tolSEXP);
    Rcpp::traits::input_parameter< double >::type parameter_tol(parameter_tolSEXP);
    Rcpp::traits::input_parameter< int >::type max_active(max_activeSEXP);
    Rcpp::traits::input_parameter< int >::type kkt_stop(kkt_stopSEXP);
    Rcpp::traits::input_parameter< int >::type objective_stop(objective_stopSEXP);
    Rcpp::traits::input_parameter< int >::type param_stop(param_stopSEXP);
    rcpp_result_gen = Rcpp::wrap(solve_QP(Sigma, bound, max_iter, theta, linear_func, gradient, ever_active, nactive, kkt_tol, objective_tol, parameter_tol, max_active, kkt_stop, objective_stop, param_stop));
    return rcpp_result_gen;
END_RCPP
}
// solve_QP_wide
Rcpp::List solve_QP_wide(Rcpp::NumericMatrix X, Rcpp::NumericVector bound, double ridge_term, int max_iter, Rcpp::NumericVector theta, Rcpp::NumericVector linear_func, Rcpp::NumericVector gradient, Rcpp::NumericVector X_theta, Rcpp::IntegerVector ever_active, Rcpp::IntegerVector nactive, double kkt_tol, double objective_tol, double parameter_tol, int max_active, int kkt_stop, int objective_stop, int param_stop);
RcppExport SEXP _selectiveInference_solve_QP_wide(SEXP XSEXP, SEXP boundSEXP, SEXP ridge_termSEXP, SEXP max_iterSEXP, SEXP thetaSEXP, SEXP linear_funcSEXP, SEXP gradientSEXP, SEXP X_thetaSEXP, SEXP ever_activeSEXP, SEXP nactiveSEXP, SEXP kkt_tolSEXP, SEXP objective_tolSEXP, SEXP parameter_tolSEXP, SEXP max_activeSEXP, SEXP kkt_stopSEXP, SEXP objective_stopSEXP, SEXP param_stopSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type X(XSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type bound(boundSEXP);
    Rcpp::traits::input_parameter< double >::type ridge_term(ridge_termSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type linear_func(linear_funcSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type gradient(gradientSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type X_theta(X_thetaSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type ever_active(ever_activeSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type nactive(nactiveSEXP);
    Rcpp::traits::input_parameter< double >::type kkt_tol(kkt_tolSEXP);
    Rcpp::traits::input_parameter< double >::type objective_tol(objective_tolSEXP);
    Rcpp::traits::input_parameter< double >::type parameter_tol(parameter_tolSEXP);
    Rcpp::traits::input_parameter< int >::type max_active(max_activeSEXP);
    Rcpp::traits::input_parameter< int >::type kkt_stop(kkt_stopSEXP);
    Rcpp::traits::input_parameter< int >::type objective_stop(objective_stopSEXP);
    Rcpp::traits::input_parameter< int >::type param_stop(param_stopSEXP);
    rcpp_result_gen = Rcpp::wrap(solve_QP_wide(X, bound, ridge_term, max_iter, theta, linear_func, gradient, X_theta, ever_active, nactive, kkt_tol, objective_tol, parameter_tol, max_active, kkt_stop, objective_stop, param_stop));
    return rcpp_result_gen;
END_RCPP
}
// update1_
Rcpp::List update1_(Rcpp::NumericMatrix Q2, Rcpp::NumericVector w, int m, int k);
RcppExport SEXP _selectiveInference_update1_(SEXP Q2SEXP, SEXP wSEXP, SEXP mSEXP, SEXP kSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Q2(Q2SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type w(wSEXP);
    Rcpp::traits::input_parameter< int >::type m(mSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    rcpp_result_gen = Rcpp::wrap(update1_(Q2, w, m, k));
    return rcpp_result_gen;
END_RCPP
}
// downdate1_
Rcpp::List downdate1_(Rcpp::NumericMatrix Q1, Rcpp::NumericMatrix R, int j0, int m, int n);
RcppExport SEXP _selectiveInference_downdate1_(SEXP Q1SEXP, SEXP RSEXP, SEXP j0SEXP, SEXP mSEXP, SEXP nSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type Q1(Q1SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type R(RSEXP);
    Rcpp::traits::input_parameter< int >::type j0(j0SEXP);
    Rcpp::traits::input_parameter< int >::type m(mSEXP);
    Rcpp::traits::input_parameter< int >::type n(nSEXP);
    rcpp_result_gen = Rcpp::wrap(downdate1_(Q1, R, j0, m, n));
    return rcpp_result_gen;
END_RCPP
}
// log_density_gaussian_
Rcpp::NumericVector log_density_gaussian_(double noise_scale, Rcpp::NumericMatrix internal_linear, Rcpp::NumericMatrix internal_state, Rcpp::NumericMatrix optimization_linear, Rcpp::NumericMatrix optimization_state, Rcpp::NumericVector offset);
RcppExport SEXP _selectiveInference_log_density_gaussian_(SEXP noise_scaleSEXP, SEXP internal_linearSEXP, SEXP internal_stateSEXP, SEXP optimization_linearSEXP, SEXP optimization_stateSEXP, SEXP offsetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type noise_scale(noise_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type internal_linear(internal_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type internal_state(internal_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_linear(optimization_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_state(optimization_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type offset(offsetSEXP);
    rcpp_result_gen = Rcpp::wrap(log_density_gaussian_(noise_scale, internal_linear, internal_state, optimization_linear, optimization_state, offset));
    return rcpp_result_gen;
END_RCPP
}
// log_density_gaussian_conditional_
Rcpp::NumericVector log_density_gaussian_conditional_(double noise_scale, Rcpp::NumericMatrix optimization_linear, Rcpp::NumericMatrix optimization_state, Rcpp::NumericVector offset);
RcppExport SEXP _selectiveInference_log_density_gaussian_conditional_(SEXP noise_scaleSEXP, SEXP optimization_linearSEXP, SEXP optimization_stateSEXP, SEXP offsetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type noise_scale(noise_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_linear(optimization_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_state(optimization_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type offset(offsetSEXP);
    rcpp_result_gen = Rcpp::wrap(log_density_gaussian_conditional_(noise_scale, optimization_linear, optimization_state, offset));
    return rcpp_result_gen;
END_RCPP
}
// log_density_laplace_
Rcpp::NumericVector log_density_laplace_(double noise_scale, Rcpp::NumericMatrix internal_linear, Rcpp::NumericMatrix internal_state, Rcpp::NumericMatrix optimization_linear, Rcpp::NumericMatrix optimization_state, Rcpp::NumericVector offset);
RcppExport SEXP _selectiveInference_log_density_laplace_(SEXP noise_scaleSEXP, SEXP internal_linearSEXP, SEXP internal_stateSEXP, SEXP optimization_linearSEXP, SEXP optimization_stateSEXP, SEXP offsetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type noise_scale(noise_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type internal_linear(internal_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type internal_state(internal_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_linear(optimization_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_state(optimization_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type offset(offsetSEXP);
    rcpp_result_gen = Rcpp::wrap(log_density_laplace_(noise_scale, internal_linear, internal_state, optimization_linear, optimization_state, offset));
    return rcpp_result_gen;
END_RCPP
}
// log_density_laplace_conditional_
Rcpp::NumericVector log_density_laplace_conditional_(double noise_scale, Rcpp::NumericMatrix optimization_linear, Rcpp::NumericMatrix optimization_state, Rcpp::NumericVector offset);
RcppExport SEXP _selectiveInference_log_density_laplace_conditional_(SEXP noise_scaleSEXP, SEXP optimization_linearSEXP, SEXP optimization_stateSEXP, SEXP offsetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type noise_scale(noise_scaleSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_linear(optimization_linearSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type optimization_state(optimization_stateSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type offset(offsetSEXP);
    rcpp_result_gen = Rcpp::wrap(log_density_laplace_conditional_(noise_scale, optimization_linear, optimization_state, offset));
    return rcpp_result_gen;
END_RCPP
}
// solve_barrier_
Rcpp::List solve_barrier_(Rcpp::NumericVector conjugate_arg, Rcpp::NumericMatrix precision, Rcpp::NumericVector feasible_point, int max_iter, int min_iter, double value_tol, double initial_step);
RcppExport SEXP _selectiveInference_solve_barrier_(SEXP conjugate_argSEXP, SEXP precisionSEXP, SEXP feasible_pointSEXP, SEXP max_iterSEXP, SEXP min_iterSEXP, SEXP value_tolSEXP, SEXP initial_stepSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type conjugate_arg(conjugate_argSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type precision(precisionSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type feasible_point(feasible_pointSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    Rcpp::traits::input_parameter< int >::type min_iter(min_iterSEXP);
    Rcpp::traits::input_parameter< double >::type value_tol(value_tolSEXP);
    Rcpp::traits::input_parameter< double >::type initial_step(initial_stepSEXP);
    rcpp_result_gen = Rcpp::wrap(solve_barrier_(conjugate_arg, precision, feasible_point, max_iter, min_iter, value_tol, initial_step));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_selectiveInference_solve_QP", (DL_FUNC) &_selectiveInference_solve_QP, 15},
    {"_selectiveInference_solve_QP_wide", (DL_FUNC) &_selectiveInference_solve_QP_wide, 17},
    {"_selectiveInference_update1_", (DL_FUNC) &_selectiveInference_update1_, 4},
    {"_selectiveInference_downdate1_", (DL_FUNC) &_selectiveInference_downdate1_, 5},
    {"_selectiveInference_log_density_gaussian_", (DL_FUNC) &_selectiveInference_log_density_gaussian_, 6},
    {"_selectiveInference_log_density_gaussian_conditional_", (DL_FUNC) &_selectiveInference_log_density_gaussian_conditional_, 4},
    {"_selectiveInference_log_density_laplace_", (DL_FUNC) &_selectiveInference_log_density_laplace_, 6},
    {"_selectiveInference_log_density_laplace_conditional_", (DL_FUNC) &_selectiveInference_log_density_laplace_conditional_, 4},
    {"_selectiveInference_solve_barrier_", (DL_FUNC) &_selectiveInference_solve_barrier_, 7},
    {NULL, NULL, 0}
};

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