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

#ifndef RCPP_updog_RCPPEXPORTS_H_GEN_
#define RCPP_updog_RCPPEXPORTS_H_GEN_

#include <RcppArmadillo.h>
#include <Rcpp.h>

namespace updog {

    using namespace Rcpp;

    namespace {
        void validateSignature(const char* sig) {
            Rcpp::Function require = Rcpp::Environment::base_env()["require"];
            require("updog", Rcpp::Named("quietly") = true);
            typedef int(*Ptr_validate)(const char*);
            static Ptr_validate p_validate = (Ptr_validate)
                R_GetCCallable("updog", "_updog_RcppExport_validate");
            if (!p_validate(sig)) {
                throw Rcpp::function_not_exported(
                    "C++ function with signature '" + std::string(sig) + "' not found in updog");
            }
        }
    }

    inline double dbetabinom_alpha_beta_double(int x, int size, double alpha, double beta, bool log) {
        typedef SEXP(*Ptr_dbetabinom_alpha_beta_double)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_dbetabinom_alpha_beta_double p_dbetabinom_alpha_beta_double = NULL;
        if (p_dbetabinom_alpha_beta_double == NULL) {
            validateSignature("double(*dbetabinom_alpha_beta_double)(int,int,double,double,bool)");
            p_dbetabinom_alpha_beta_double = (Ptr_dbetabinom_alpha_beta_double)R_GetCCallable("updog", "_updog_dbetabinom_alpha_beta_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_dbetabinom_alpha_beta_double(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(alpha)), Shield<SEXP>(Rcpp::wrap(beta)), Shield<SEXP>(Rcpp::wrap(log)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double dbernbinom(int x, int size, double mu, bool log) {
        typedef SEXP(*Ptr_dbernbinom)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_dbernbinom p_dbernbinom = NULL;
        if (p_dbernbinom == NULL) {
            validateSignature("double(*dbernbinom)(int,int,double,bool)");
            p_dbernbinom = (Ptr_dbernbinom)R_GetCCallable("updog", "_updog_dbernbinom");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_dbernbinom(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(log)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double dbetabinom_double(int x, int size, double mu, double rho, bool log) {
        typedef SEXP(*Ptr_dbetabinom_double)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_dbetabinom_double p_dbetabinom_double = NULL;
        if (p_dbetabinom_double == NULL) {
            validateSignature("double(*dbetabinom_double)(int,int,double,double,bool)");
            p_dbetabinom_double = (Ptr_dbetabinom_double)R_GetCCallable("updog", "_updog_dbetabinom_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_dbetabinom_double(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(log)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector dbetabinom(IntegerVector x, IntegerVector size, NumericVector mu, NumericVector rho, LogicalVector log) {
        typedef SEXP(*Ptr_dbetabinom)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_dbetabinom p_dbetabinom = NULL;
        if (p_dbetabinom == NULL) {
            validateSignature("NumericVector(*dbetabinom)(IntegerVector,IntegerVector,NumericVector,NumericVector,LogicalVector)");
            p_dbetabinom = (Ptr_dbetabinom)R_GetCCallable("updog", "_updog_dbetabinom");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_dbetabinom(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(log)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double pbetabinom_double(int q, int size, double mu, double rho, bool log_p) {
        typedef SEXP(*Ptr_pbetabinom_double)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_pbetabinom_double p_pbetabinom_double = NULL;
        if (p_pbetabinom_double == NULL) {
            validateSignature("double(*pbetabinom_double)(int,int,double,double,bool)");
            p_pbetabinom_double = (Ptr_pbetabinom_double)R_GetCCallable("updog", "_updog_pbetabinom_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_pbetabinom_double(Shield<SEXP>(Rcpp::wrap(q)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(log_p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector pbetabinom(IntegerVector q, IntegerVector size, NumericVector mu, NumericVector rho, LogicalVector log_p) {
        typedef SEXP(*Ptr_pbetabinom)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_pbetabinom p_pbetabinom = NULL;
        if (p_pbetabinom == NULL) {
            validateSignature("NumericVector(*pbetabinom)(IntegerVector,IntegerVector,NumericVector,NumericVector,LogicalVector)");
            p_pbetabinom = (Ptr_pbetabinom)R_GetCCallable("updog", "_updog_pbetabinom");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_pbetabinom(Shield<SEXP>(Rcpp::wrap(q)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)), Shield<SEXP>(Rcpp::wrap(log_p)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline int qbetabinom_double(double p, int size, double mu, double rho) {
        typedef SEXP(*Ptr_qbetabinom_double)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_qbetabinom_double p_qbetabinom_double = NULL;
        if (p_qbetabinom_double == NULL) {
            validateSignature("int(*qbetabinom_double)(double,int,double,double)");
            p_qbetabinom_double = (Ptr_qbetabinom_double)R_GetCCallable("updog", "_updog_qbetabinom_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_qbetabinom_double(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline IntegerVector qbetabinom(NumericVector p, IntegerVector size, NumericVector mu, NumericVector rho) {
        typedef SEXP(*Ptr_qbetabinom)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_qbetabinom p_qbetabinom = NULL;
        if (p_qbetabinom == NULL) {
            validateSignature("IntegerVector(*qbetabinom)(NumericVector,IntegerVector,NumericVector,NumericVector)");
            p_qbetabinom = (Ptr_qbetabinom)R_GetCCallable("updog", "_updog_qbetabinom");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_qbetabinom(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<IntegerVector >(rcpp_result_gen);
    }

    inline int rbetabinom_int(int size, double mu, double rho) {
        typedef SEXP(*Ptr_rbetabinom_int)(SEXP,SEXP,SEXP);
        static Ptr_rbetabinom_int p_rbetabinom_int = NULL;
        if (p_rbetabinom_int == NULL) {
            validateSignature("int(*rbetabinom_int)(int,double,double)");
            p_rbetabinom_int = (Ptr_rbetabinom_int)R_GetCCallable("updog", "_updog_rbetabinom_int");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_rbetabinom_int(Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline IntegerVector rbetabinom(int n, IntegerVector size, NumericVector mu, NumericVector rho) {
        typedef SEXP(*Ptr_rbetabinom)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_rbetabinom p_rbetabinom = NULL;
        if (p_rbetabinom == NULL) {
            validateSignature("IntegerVector(*rbetabinom)(int,IntegerVector,NumericVector,NumericVector)");
            p_rbetabinom = (Ptr_rbetabinom)R_GetCCallable("updog", "_updog_rbetabinom");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_rbetabinom(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(size)), Shield<SEXP>(Rcpp::wrap(mu)), Shield<SEXP>(Rcpp::wrap(rho)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<IntegerVector >(rcpp_result_gen);
    }

    inline double oracle_mis(int n, int ploidy, double seq, double bias, double od, NumericVector dist) {
        typedef SEXP(*Ptr_oracle_mis)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_oracle_mis p_oracle_mis = NULL;
        if (p_oracle_mis == NULL) {
            validateSignature("double(*oracle_mis)(int,int,double,double,double,NumericVector)");
            p_oracle_mis = (Ptr_oracle_mis)R_GetCCallable("updog", "_updog_oracle_mis");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_oracle_mis(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(ploidy)), Shield<SEXP>(Rcpp::wrap(seq)), Shield<SEXP>(Rcpp::wrap(bias)), Shield<SEXP>(Rcpp::wrap(od)), Shield<SEXP>(Rcpp::wrap(dist)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector oracle_mis_vec(int n, int ploidy, double seq, double bias, double od, NumericVector dist) {
        typedef SEXP(*Ptr_oracle_mis_vec)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_oracle_mis_vec p_oracle_mis_vec = NULL;
        if (p_oracle_mis_vec == NULL) {
            validateSignature("NumericVector(*oracle_mis_vec)(int,int,double,double,double,NumericVector)");
            p_oracle_mis_vec = (Ptr_oracle_mis_vec)R_GetCCallable("updog", "_updog_oracle_mis_vec");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_oracle_mis_vec(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(ploidy)), Shield<SEXP>(Rcpp::wrap(seq)), Shield<SEXP>(Rcpp::wrap(bias)), Shield<SEXP>(Rcpp::wrap(od)), Shield<SEXP>(Rcpp::wrap(dist)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericMatrix oracle_joint(int n, int ploidy, double seq, double bias, double od, NumericVector dist) {
        typedef SEXP(*Ptr_oracle_joint)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_oracle_joint p_oracle_joint = NULL;
        if (p_oracle_joint == NULL) {
            validateSignature("NumericMatrix(*oracle_joint)(int,int,double,double,double,NumericVector)");
            p_oracle_joint = (Ptr_oracle_joint)R_GetCCallable("updog", "_updog_oracle_joint");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_oracle_joint(Shield<SEXP>(Rcpp::wrap(n)), Shield<SEXP>(Rcpp::wrap(ploidy)), Shield<SEXP>(Rcpp::wrap(seq)), Shield<SEXP>(Rcpp::wrap(bias)), Shield<SEXP>(Rcpp::wrap(od)), Shield<SEXP>(Rcpp::wrap(dist)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericMatrix >(rcpp_result_gen);
    }

    inline NumericVector dist_from_p(IntegerVector p, int ploidy) {
        typedef SEXP(*Ptr_dist_from_p)(SEXP,SEXP);
        static Ptr_dist_from_p p_dist_from_p = NULL;
        if (p_dist_from_p == NULL) {
            validateSignature("NumericVector(*dist_from_p)(IntegerVector,int)");
            p_dist_from_p = (Ptr_dist_from_p)R_GetCCallable("updog", "_updog_dist_from_p");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_dist_from_p(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(ploidy)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline int num_pairs(int ell, int ploidy) {
        typedef SEXP(*Ptr_num_pairs)(SEXP,SEXP);
        static Ptr_num_pairs p_num_pairs = NULL;
        if (p_num_pairs == NULL) {
            validateSignature("int(*num_pairs)(int,int)");
            p_num_pairs = (Ptr_num_pairs)R_GetCCallable("updog", "_updog_num_pairs");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_num_pairs(Shield<SEXP>(Rcpp::wrap(ell)), Shield<SEXP>(Rcpp::wrap(ploidy)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline std::string get_pname(IntegerVector pvec) {
        typedef SEXP(*Ptr_get_pname)(SEXP);
        static Ptr_get_pname p_get_pname = NULL;
        if (p_get_pname == NULL) {
            validateSignature("std::string(*get_pname)(IntegerVector)");
            p_get_pname = (Ptr_get_pname)R_GetCCallable("updog", "_updog_get_pname");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_get_pname(Shield<SEXP>(Rcpp::wrap(pvec)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<std::string >(rcpp_result_gen);
    }

    inline List get_bivalent_probs(int ploidy) {
        typedef SEXP(*Ptr_get_bivalent_probs)(SEXP);
        static Ptr_get_bivalent_probs p_get_bivalent_probs = NULL;
        if (p_get_bivalent_probs == NULL) {
            validateSignature("List(*get_bivalent_probs)(int)");
            p_get_bivalent_probs = (Ptr_get_bivalent_probs)R_GetCCallable("updog", "_updog_get_bivalent_probs");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_get_bivalent_probs(Shield<SEXP>(Rcpp::wrap(ploidy)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline int count_pairings(int ploidy) {
        typedef SEXP(*Ptr_count_pairings)(SEXP);
        static Ptr_count_pairings p_count_pairings = NULL;
        if (p_count_pairings == NULL) {
            validateSignature("int(*count_pairings)(int)");
            p_count_pairings = (Ptr_count_pairings)R_GetCCallable("updog", "_updog_count_pairings");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_count_pairings(Shield<SEXP>(Rcpp::wrap(ploidy)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline int count_doubles(int ell, int p2) {
        typedef SEXP(*Ptr_count_doubles)(SEXP,SEXP);
        static Ptr_count_doubles p_count_doubles = NULL;
        if (p_count_doubles == NULL) {
            validateSignature("int(*count_doubles)(int,int)");
            p_count_doubles = (Ptr_count_doubles)R_GetCCallable("updog", "_updog_count_doubles");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_count_doubles(Shield<SEXP>(Rcpp::wrap(ell)), Shield<SEXP>(Rcpp::wrap(p2)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline int count_pairings_given_p(int ploidy, IntegerVector pvec) {
        typedef SEXP(*Ptr_count_pairings_given_p)(SEXP,SEXP);
        static Ptr_count_pairings_given_p p_count_pairings_given_p = NULL;
        if (p_count_pairings_given_p == NULL) {
            validateSignature("int(*count_pairings_given_p)(int,IntegerVector)");
            p_count_pairings_given_p = (Ptr_count_pairings_given_p)R_GetCCallable("updog", "_updog_count_pairings_given_p");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_count_pairings_given_p(Shield<SEXP>(Rcpp::wrap(ploidy)), Shield<SEXP>(Rcpp::wrap(pvec)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<int >(rcpp_result_gen);
    }

    inline List get_hyper_weights(int ploidy, int ell) {
        typedef SEXP(*Ptr_get_hyper_weights)(SEXP,SEXP);
        static Ptr_get_hyper_weights p_get_hyper_weights = NULL;
        if (p_get_hyper_weights == NULL) {
            validateSignature("List(*get_hyper_weights)(int,int)");
            p_get_hyper_weights = (Ptr_get_hyper_weights)R_GetCCallable("updog", "_updog_get_hyper_weights");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_get_hyper_weights(Shield<SEXP>(Rcpp::wrap(ploidy)), Shield<SEXP>(Rcpp::wrap(ell)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline double eta_double(double p, double eps) {
        typedef SEXP(*Ptr_eta_double)(SEXP,SEXP);
        static Ptr_eta_double p_eta_double = NULL;
        if (p_eta_double == NULL) {
            validateSignature("double(*eta_double)(double,double)");
            p_eta_double = (Ptr_eta_double)R_GetCCallable("updog", "_updog_eta_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_eta_double(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(eps)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector eta_fun(NumericVector p, NumericVector eps) {
        typedef SEXP(*Ptr_eta_fun)(SEXP,SEXP);
        static Ptr_eta_fun p_eta_fun = NULL;
        if (p_eta_fun == NULL) {
            validateSignature("NumericVector(*eta_fun)(NumericVector,NumericVector)");
            p_eta_fun = (Ptr_eta_fun)R_GetCCallable("updog", "_updog_eta_fun");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_eta_fun(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(eps)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double xi_double(double p, double eps, double h) {
        typedef SEXP(*Ptr_xi_double)(SEXP,SEXP,SEXP);
        static Ptr_xi_double p_xi_double = NULL;
        if (p_xi_double == NULL) {
            validateSignature("double(*xi_double)(double,double,double)");
            p_xi_double = (Ptr_xi_double)R_GetCCallable("updog", "_updog_xi_double");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_xi_double(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(eps)), Shield<SEXP>(Rcpp::wrap(h)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector xi_fun(NumericVector p, NumericVector eps, NumericVector h) {
        typedef SEXP(*Ptr_xi_fun)(SEXP,SEXP,SEXP);
        static Ptr_xi_fun p_xi_fun = NULL;
        if (p_xi_fun == NULL) {
            validateSignature("NumericVector(*xi_fun)(NumericVector,NumericVector,NumericVector)");
            p_xi_fun = (Ptr_xi_fun)R_GetCCallable("updog", "_updog_xi_fun");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_xi_fun(Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(eps)), Shield<SEXP>(Rcpp::wrap(h)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double log_sum_exp(NumericVector x) {
        typedef SEXP(*Ptr_log_sum_exp)(SEXP);
        static Ptr_log_sum_exp p_log_sum_exp = NULL;
        if (p_log_sum_exp == NULL) {
            validateSignature("double(*log_sum_exp)(NumericVector)");
            p_log_sum_exp = (Ptr_log_sum_exp)R_GetCCallable("updog", "_updog_log_sum_exp");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_sum_exp(Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double log_sum_exp_2(double x, double y) {
        typedef SEXP(*Ptr_log_sum_exp_2)(SEXP,SEXP);
        static Ptr_log_sum_exp_2 p_log_sum_exp_2 = NULL;
        if (p_log_sum_exp_2 == NULL) {
            validateSignature("double(*log_sum_exp_2)(double,double)");
            p_log_sum_exp_2 = (Ptr_log_sum_exp_2)R_GetCCallable("updog", "_updog_log_sum_exp_2");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_log_sum_exp_2(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(y)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double logit(double x) {
        typedef SEXP(*Ptr_logit)(SEXP);
        static Ptr_logit p_logit = NULL;
        if (p_logit == NULL) {
            validateSignature("double(*logit)(double)");
            p_logit = (Ptr_logit)R_GetCCallable("updog", "_updog_logit");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_logit(Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double expit(double x) {
        typedef SEXP(*Ptr_expit)(SEXP);
        static Ptr_expit p_expit = NULL;
        if (p_expit == NULL) {
            validateSignature("double(*expit)(double)");
            p_expit = (Ptr_expit)R_GetCCallable("updog", "_updog_expit");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_expit(Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

}

#endif // RCPP_updog_RCPPEXPORTS_H_GEN_
