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

// arrange_genes
IntegerVector arrange_genes(const NumericVector& start, const NumericVector& end);
RcppExport SEXP _qtl2_arrange_genes(SEXP startSEXP, SEXP endSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type start(startSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type end(endSEXP);
    rcpp_result_gen = Rcpp::wrap(arrange_genes(start, end));
    return rcpp_result_gen;
END_RCPP
}
// R_bayes_int_plain
IntegerVector R_bayes_int_plain(const NumericVector& lod, const NumericVector& pos, const double prob);
RcppExport SEXP _qtl2_R_bayes_int_plain(SEXP lodSEXP, SEXP posSEXP, SEXP probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type lod(lodSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pos(posSEXP);
    Rcpp::traits::input_parameter< const double >::type prob(probSEXP);
    rcpp_result_gen = Rcpp::wrap(R_bayes_int_plain(lod, pos, prob));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg
double calc_ll_binreg(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_binreg
NumericVector calc_coef_binreg(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coef_binreg(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_binreg(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_binreg
List calc_coefSE_binreg(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coefSE_binreg(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_binreg(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit_binreg
List fit_binreg(const NumericMatrix& X, const NumericVector& y, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit_binreg(SEXP XSEXP, SEXP ySEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_binreg(X, y, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg_eigenchol
double calc_ll_binreg_eigenchol(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg_eigenchol(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg_eigenchol(X, y, maxit, tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg_eigenqr
double calc_ll_binreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg_eigenqr(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_binreg_eigenqr
NumericVector calc_coef_binreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coef_binreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_binreg_eigenqr(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_binreg_eigenqr
List calc_coefSE_binreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coefSE_binreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_binreg_eigenqr(X, y, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit_binreg_eigenqr
List fit_binreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit_binreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_binreg_eigenqr(X, y, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg_weighted
double calc_ll_binreg_weighted(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg_weighted(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg_weighted(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_binreg_weighted
NumericVector calc_coef_binreg_weighted(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coef_binreg_weighted(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_binreg_weighted(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_binreg_weighted
List calc_coefSE_binreg_weighted(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coefSE_binreg_weighted(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_binreg_weighted(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit_binreg_weighted
List fit_binreg_weighted(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit_binreg_weighted(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_binreg_weighted(X, y, weights, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg_weighted_eigenchol
double calc_ll_binreg_weighted_eigenchol(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg_weighted_eigenchol(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg_weighted_eigenchol(X, y, weights, maxit, tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_ll_binreg_weighted_eigenqr
double calc_ll_binreg_weighted_eigenqr(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_ll_binreg_weighted_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_ll_binreg_weighted_eigenqr(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_binreg_weighted_eigenqr
NumericVector calc_coef_binreg_weighted_eigenqr(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coef_binreg_weighted_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_binreg_weighted_eigenqr(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_binreg_weighted_eigenqr
List calc_coefSE_binreg_weighted_eigenqr(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_calc_coefSE_binreg_weighted_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_binreg_weighted_eigenqr(X, y, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit_binreg_weighted_eigenqr
List fit_binreg_weighted_eigenqr(const NumericMatrix& X, const NumericVector& y, const NumericVector& weights, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit_binreg_weighted_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_binreg_weighted_eigenqr(X, y, weights, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// calc_kinship
NumericMatrix calc_kinship(const NumericVector& prob_array);
RcppExport SEXP _qtl2_calc_kinship(SEXP prob_arraySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type prob_array(prob_arraySEXP);
    rcpp_result_gen = Rcpp::wrap(calc_kinship(prob_array));
    return rcpp_result_gen;
END_RCPP
}
// crosstype_supported
bool crosstype_supported(const String& crosstype);
RcppExport SEXP _qtl2_crosstype_supported(SEXP crosstypeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    rcpp_result_gen = Rcpp::wrap(crosstype_supported(crosstype));
    return rcpp_result_gen;
END_RCPP
}
// count_invalid_genotypes
IntegerVector count_invalid_genotypes(const String& crosstype, const IntegerMatrix& genotypes, const bool& is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info);
RcppExport SEXP _qtl2_count_invalid_genotypes(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const bool& >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(count_invalid_genotypes(crosstype, genotypes, is_X_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// check_crossinfo
bool check_crossinfo(const String& crosstype, const IntegerMatrix& cross_info, const bool any_x_chr);
RcppExport SEXP _qtl2_check_crossinfo(SEXP crosstypeSEXP, SEXP cross_infoSEXP, SEXP any_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const bool >::type any_x_chr(any_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(check_crossinfo(crosstype, cross_info, any_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// check_is_female_vector
bool check_is_female_vector(const String& crosstype, const LogicalVector& is_female, const bool any_x_chr);
RcppExport SEXP _qtl2_check_is_female_vector(SEXP crosstypeSEXP, SEXP is_femaleSEXP, SEXP any_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const bool >::type any_x_chr(any_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(check_is_female_vector(crosstype, is_female, any_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// check_handle_x_chr
bool check_handle_x_chr(const String& crosstype, const bool any_x_chr);
RcppExport SEXP _qtl2_check_handle_x_chr(SEXP crosstypeSEXP, SEXP any_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type any_x_chr(any_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(check_handle_x_chr(crosstype, any_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// chisq_colpairs
NumericMatrix chisq_colpairs(const IntegerMatrix& input);
RcppExport SEXP _qtl2_chisq_colpairs(SEXP inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type input(inputSEXP);
    rcpp_result_gen = Rcpp::wrap(chisq_colpairs(input));
    return rcpp_result_gen;
END_RCPP
}
// clean_genoprob
NumericVector clean_genoprob(const NumericVector& prob_array, double value_threshold, double column_threshold);
RcppExport SEXP _qtl2_clean_genoprob(SEXP prob_arraySEXP, SEXP value_thresholdSEXP, SEXP column_thresholdSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type prob_array(prob_arraySEXP);
    Rcpp::traits::input_parameter< double >::type value_threshold(value_thresholdSEXP);
    Rcpp::traits::input_parameter< double >::type column_threshold(column_thresholdSEXP);
    rcpp_result_gen = Rcpp::wrap(clean_genoprob(prob_array, value_threshold, column_threshold));
    return rcpp_result_gen;
END_RCPP
}
// compare_geno
IntegerMatrix compare_geno(const IntegerMatrix& geno);
RcppExport SEXP _qtl2_compare_geno(SEXP genoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    rcpp_result_gen = Rcpp::wrap(compare_geno(geno));
    return rcpp_result_gen;
END_RCPP
}
// count_xo
IntegerVector count_xo(const IntegerMatrix geno, const String& crosstype, const bool is_X_chr);
RcppExport SEXP _qtl2_count_xo(SEXP genoSEXP, SEXP crosstypeSEXP, SEXP is_X_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(count_xo(geno, crosstype, is_X_chr));
    return rcpp_result_gen;
END_RCPP
}
// count_xo_3d
IntegerMatrix count_xo_3d(const IntegerVector geno_array, const String& crosstype, const bool is_X_chr);
RcppExport SEXP _qtl2_count_xo_3d(SEXP geno_arraySEXP, SEXP crosstypeSEXP, SEXP is_X_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerVector >::type geno_array(geno_arraySEXP);
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(count_xo_3d(geno_array, crosstype, is_X_chr));
    return rcpp_result_gen;
END_RCPP
}
// mpp_encode_alleles
int mpp_encode_alleles(const int allele1, const int allele2, const int n_alleles, const bool phase_known);
RcppExport SEXP _qtl2_mpp_encode_alleles(SEXP allele1SEXP, SEXP allele2SEXP, SEXP n_allelesSEXP, SEXP phase_knownSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type allele1(allele1SEXP);
    Rcpp::traits::input_parameter< const int >::type allele2(allele2SEXP);
    Rcpp::traits::input_parameter< const int >::type n_alleles(n_allelesSEXP);
    Rcpp::traits::input_parameter< const bool >::type phase_known(phase_knownSEXP);
    rcpp_result_gen = Rcpp::wrap(mpp_encode_alleles(allele1, allele2, n_alleles, phase_known));
    return rcpp_result_gen;
END_RCPP
}
// mpp_decode_geno
IntegerVector mpp_decode_geno(const int true_gen, const int n_alleles, const bool phase_known);
RcppExport SEXP _qtl2_mpp_decode_geno(SEXP true_genSEXP, SEXP n_allelesSEXP, SEXP phase_knownSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type true_gen(true_genSEXP);
    Rcpp::traits::input_parameter< const int >::type n_alleles(n_allelesSEXP);
    Rcpp::traits::input_parameter< const bool >::type phase_known(phase_knownSEXP);
    rcpp_result_gen = Rcpp::wrap(mpp_decode_geno(true_gen, n_alleles, phase_known));
    return rcpp_result_gen;
END_RCPP
}
// mpp_is_het
bool mpp_is_het(const int true_gen, const int n_alleles, const bool phase_known);
RcppExport SEXP _qtl2_mpp_is_het(SEXP true_genSEXP, SEXP n_allelesSEXP, SEXP phase_knownSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type true_gen(true_genSEXP);
    Rcpp::traits::input_parameter< const int >::type n_alleles(n_allelesSEXP);
    Rcpp::traits::input_parameter< const bool >::type phase_known(phase_knownSEXP);
    rcpp_result_gen = Rcpp::wrap(mpp_is_het(true_gen, n_alleles, phase_known));
    return rcpp_result_gen;
END_RCPP
}
// mpp_geno_names
const std::vector<std::string> mpp_geno_names(const std::vector<std::string> alleles, const bool is_x_chr);
RcppExport SEXP _qtl2_mpp_geno_names(SEXP allelesSEXP, SEXP is_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const std::vector<std::string> >::type alleles(allelesSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(mpp_geno_names(alleles, is_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// invert_founder_index
IntegerVector invert_founder_index(IntegerVector cross_info);
RcppExport SEXP _qtl2_invert_founder_index(SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(invert_founder_index(cross_info));
    return rcpp_result_gen;
END_RCPP
}
// is_phase_known
bool is_phase_known(const String& crosstype);
RcppExport SEXP _qtl2_is_phase_known(SEXP crosstypeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    rcpp_result_gen = Rcpp::wrap(is_phase_known(crosstype));
    return rcpp_result_gen;
END_RCPP
}
// find_dup_markers_notexact
IntegerVector find_dup_markers_notexact(const IntegerMatrix& Geno, const IntegerVector& order, const IntegerVector& markerloc, const bool adjacent_only);
RcppExport SEXP _qtl2_find_dup_markers_notexact(SEXP GenoSEXP, SEXP orderSEXP, SEXP markerlocSEXP, SEXP adjacent_onlySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type Geno(GenoSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type order(orderSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type markerloc(markerlocSEXP);
    Rcpp::traits::input_parameter< const bool >::type adjacent_only(adjacent_onlySEXP);
    rcpp_result_gen = Rcpp::wrap(find_dup_markers_notexact(Geno, order, markerloc, adjacent_only));
    return rcpp_result_gen;
END_RCPP
}
// find_ibd_segments
NumericMatrix find_ibd_segments(const IntegerVector& g1, const IntegerVector& g2, const NumericVector& p, const double error_prob);
RcppExport SEXP _qtl2_find_ibd_segments(SEXP g1SEXP, SEXP g2SEXP, SEXP pSEXP, SEXP error_probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerVector& >::type g1(g1SEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type g2(g2SEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type p(pSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    rcpp_result_gen = Rcpp::wrap(find_ibd_segments(g1, g2, p, error_prob));
    return rcpp_result_gen;
END_RCPP
}
// R_find_peaks
List R_find_peaks(const NumericVector& lod, const double threshold, const double peakdrop);
RcppExport SEXP _qtl2_R_find_peaks(SEXP lodSEXP, SEXP thresholdSEXP, SEXP peakdropSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type lod(lodSEXP);
    Rcpp::traits::input_parameter< const double >::type threshold(thresholdSEXP);
    Rcpp::traits::input_parameter< const double >::type peakdrop(peakdropSEXP);
    rcpp_result_gen = Rcpp::wrap(R_find_peaks(lod, threshold, peakdrop));
    return rcpp_result_gen;
END_RCPP
}
// R_find_peaks_and_lodint
List R_find_peaks_and_lodint(const NumericVector& lod, const double threshold, const double peakdrop, const double drop);
RcppExport SEXP _qtl2_R_find_peaks_and_lodint(SEXP lodSEXP, SEXP thresholdSEXP, SEXP peakdropSEXP, SEXP dropSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type lod(lodSEXP);
    Rcpp::traits::input_parameter< const double >::type threshold(thresholdSEXP);
    Rcpp::traits::input_parameter< const double >::type peakdrop(peakdropSEXP);
    Rcpp::traits::input_parameter< const double >::type drop(dropSEXP);
    rcpp_result_gen = Rcpp::wrap(R_find_peaks_and_lodint(lod, threshold, peakdrop, drop));
    return rcpp_result_gen;
END_RCPP
}
// R_find_peaks_and_bayesint
List R_find_peaks_and_bayesint(const NumericVector& lod, const NumericVector& pos, const double threshold, const double peakdrop, const double prob);
RcppExport SEXP _qtl2_R_find_peaks_and_bayesint(SEXP lodSEXP, SEXP posSEXP, SEXP thresholdSEXP, SEXP peakdropSEXP, SEXP probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type lod(lodSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pos(posSEXP);
    Rcpp::traits::input_parameter< const double >::type threshold(thresholdSEXP);
    Rcpp::traits::input_parameter< const double >::type peakdrop(peakdropSEXP);
    Rcpp::traits::input_parameter< const double >::type prob(probSEXP);
    rcpp_result_gen = Rcpp::wrap(R_find_peaks_and_bayesint(lod, pos, threshold, peakdrop, prob));
    return rcpp_result_gen;
END_RCPP
}
// fit1_binary_addcovar
List fit1_binary_addcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit1_binary_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_binary_addcovar(genoprobs, pheno, addcovar, weights, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit1_binary_intcovar
List fit1_binary_intcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const bool se, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_fit1_binary_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_binary_intcovar(genoprobs, pheno, addcovar, intcovar, weights, se, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// fit1_hk_addcovar
List fit1_hk_addcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const bool se, const double tol);
RcppExport SEXP _qtl2_fit1_hk_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_hk_addcovar(genoprobs, pheno, addcovar, weights, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// fit1_hk_intcovar
List fit1_hk_intcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const bool se, const double tol);
RcppExport SEXP _qtl2_fit1_hk_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_hk_intcovar(genoprobs, pheno, addcovar, intcovar, weights, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// fit1_pg_addcovar
List fit1_pg_addcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const bool se, const double tol);
RcppExport SEXP _qtl2_fit1_pg_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_pg_addcovar(genoprobs, pheno, addcovar, eigenvec, weights, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// fit1_pg_intcovar
List fit1_pg_intcovar(const NumericMatrix& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const bool se, const double tol);
RcppExport SEXP _qtl2_fit1_pg_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit1_pg_intcovar(genoprobs, pheno, addcovar, intcovar, eigenvec, weights, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// geno_names
std::vector<std::string> geno_names(const String& crosstype, const std::vector<std::string> alleles, const bool is_x_chr);
RcppExport SEXP _qtl2_geno_names(SEXP crosstypeSEXP, SEXP allelesSEXP, SEXP is_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const std::vector<std::string> >::type alleles(allelesSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(geno_names(crosstype, alleles, is_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// nalleles
int nalleles(const String& crosstype);
RcppExport SEXP _qtl2_nalleles(SEXP crosstypeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    rcpp_result_gen = Rcpp::wrap(nalleles(crosstype));
    return rcpp_result_gen;
END_RCPP
}
// genoprob_to_alleleprob
NumericVector genoprob_to_alleleprob(const String& crosstype, const NumericVector& prob_array, const bool is_x_chr);
RcppExport SEXP _qtl2_genoprob_to_alleleprob(SEXP crosstypeSEXP, SEXP prob_arraySEXP, SEXP is_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type prob_array(prob_arraySEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(genoprob_to_alleleprob(crosstype, prob_array, is_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// get_x_covar
NumericMatrix get_x_covar(const String& crosstype, const LogicalVector& is_female, const IntegerMatrix& cross_info);
RcppExport SEXP _qtl2_get_x_covar(SEXP crosstypeSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(get_x_covar(crosstype, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// guess_phase_f2A
IntegerVector guess_phase_f2A(const IntegerMatrix& geno, bool deterministic);
RcppExport SEXP _qtl2_guess_phase_f2A(SEXP genoSEXP, SEXP deterministicSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< bool >::type deterministic(deterministicSEXP);
    rcpp_result_gen = Rcpp::wrap(guess_phase_f2A(geno, deterministic));
    return rcpp_result_gen;
END_RCPP
}
// guess_phase_f2X
IntegerVector guess_phase_f2X(const IntegerMatrix& geno, bool deterministic);
RcppExport SEXP _qtl2_guess_phase_f2X(SEXP genoSEXP, SEXP deterministicSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< bool >::type deterministic(deterministicSEXP);
    rcpp_result_gen = Rcpp::wrap(guess_phase_f2X(geno, deterministic));
    return rcpp_result_gen;
END_RCPP
}
// guess_phase_A
IntegerVector guess_phase_A(const IntegerMatrix& geno, const String& crosstype, bool deterministic);
RcppExport SEXP _qtl2_guess_phase_A(SEXP genoSEXP, SEXP crosstypeSEXP, SEXP deterministicSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< bool >::type deterministic(deterministicSEXP);
    rcpp_result_gen = Rcpp::wrap(guess_phase_A(geno, crosstype, deterministic));
    return rcpp_result_gen;
END_RCPP
}
// guess_phase_X
IntegerVector guess_phase_X(const IntegerMatrix& geno, const String& crosstype, const LogicalVector& is_female, bool deterministic);
RcppExport SEXP _qtl2_guess_phase_X(SEXP genoSEXP, SEXP crosstypeSEXP, SEXP is_femaleSEXP, SEXP deterministicSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< bool >::type deterministic(deterministicSEXP);
    rcpp_result_gen = Rcpp::wrap(guess_phase_X(geno, crosstype, is_female, deterministic));
    return rcpp_result_gen;
END_RCPP
}
// calc_errorlod
NumericMatrix calc_errorlod(const String& crosstype, const NumericVector& probs, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_calc_errorlod(SEXP crosstypeSEXP, SEXP probsSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_errorlod(crosstype, probs, genotypes, founder_geno, is_X_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// calc_genoprob
NumericVector calc_genoprob(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob);
RcppExport SEXP _qtl2_calc_genoprob(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_genoprob(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob));
    return rcpp_result_gen;
END_RCPP
}
// calc_genoprob2
NumericVector calc_genoprob2(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const bool is_female, const IntegerVector& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob);
RcppExport SEXP _qtl2_calc_genoprob2(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_genoprob2(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob));
    return rcpp_result_gen;
END_RCPP
}
// est_map
NumericVector est_map(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info, const NumericVector& rec_frac, const double error_prob, const int max_iterations, const double tol, const bool verbose);
RcppExport SEXP _qtl2_est_map(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP error_probSEXP, SEXP max_iterationsSEXP, SEXP tolSEXP, SEXP verboseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const int >::type max_iterations(max_iterationsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const bool >::type verbose(verboseSEXP);
    rcpp_result_gen = Rcpp::wrap(est_map(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, error_prob, max_iterations, tol, verbose));
    return rcpp_result_gen;
END_RCPP
}
// est_map2
NumericVector est_map2(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info, const IntegerVector& cross_group, const IntegerVector& unique_cross_group, const NumericVector& rec_frac, const double error_prob, const int max_iterations, const double tol, const bool verbose);
RcppExport SEXP _qtl2_est_map2(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP cross_groupSEXP, SEXP unique_cross_groupSEXP, SEXP rec_fracSEXP, SEXP error_probSEXP, SEXP max_iterationsSEXP, SEXP tolSEXP, SEXP verboseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_group(cross_groupSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type unique_cross_group(unique_cross_groupSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const int >::type max_iterations(max_iterationsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const bool >::type verbose(verboseSEXP);
    rcpp_result_gen = Rcpp::wrap(est_map2(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, cross_group, unique_cross_group, rec_frac, error_prob, max_iterations, tol, verbose));
    return rcpp_result_gen;
END_RCPP
}
// sim_geno
IntegerVector sim_geno(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob, const int n_draws);
RcppExport SEXP _qtl2_sim_geno(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP, SEXP n_drawsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const int >::type n_draws(n_drawsSEXP);
    rcpp_result_gen = Rcpp::wrap(sim_geno(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob, n_draws));
    return rcpp_result_gen;
END_RCPP
}
// sim_geno2
IntegerVector sim_geno2(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const bool is_female, const IntegerVector& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob, const int n_draws);
RcppExport SEXP _qtl2_sim_geno2(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP, SEXP n_drawsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const int >::type n_draws(n_drawsSEXP);
    rcpp_result_gen = Rcpp::wrap(sim_geno2(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob, n_draws));
    return rcpp_result_gen;
END_RCPP
}
// addlog
double addlog(const double a, const double b);
RcppExport SEXP _qtl2_addlog(SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const double >::type a(aSEXP);
    Rcpp::traits::input_parameter< const double >::type b(bSEXP);
    rcpp_result_gen = Rcpp::wrap(addlog(a, b));
    return rcpp_result_gen;
END_RCPP
}
// subtractlog
double subtractlog(const double a, const double b);
RcppExport SEXP _qtl2_subtractlog(SEXP aSEXP, SEXP bSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const double >::type a(aSEXP);
    Rcpp::traits::input_parameter< const double >::type b(bSEXP);
    rcpp_result_gen = Rcpp::wrap(subtractlog(a, b));
    return rcpp_result_gen;
END_RCPP
}
// viterbi
IntegerMatrix viterbi(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const LogicalVector& is_female, const IntegerMatrix& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob);
RcppExport SEXP _qtl2_viterbi(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    rcpp_result_gen = Rcpp::wrap(viterbi(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob));
    return rcpp_result_gen;
END_RCPP
}
// viterbi2
IntegerMatrix viterbi2(const String& crosstype, const IntegerMatrix& genotypes, const IntegerMatrix& founder_geno, const bool is_X_chr, const bool is_female, const IntegerVector& cross_info, const NumericVector& rec_frac, const IntegerVector& marker_index, const double error_prob);
RcppExport SEXP _qtl2_viterbi2(SEXP crosstypeSEXP, SEXP genotypesSEXP, SEXP founder_genoSEXP, SEXP is_X_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP, SEXP rec_fracSEXP, SEXP marker_indexSEXP, SEXP error_probSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type genotypes(genotypesSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type marker_index(marker_indexSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    rcpp_result_gen = Rcpp::wrap(viterbi2(crosstype, genotypes, founder_geno, is_X_chr, is_female, cross_info, rec_frac, marker_index, error_prob));
    return rcpp_result_gen;
END_RCPP
}
// interp_genoprob_onechr
NumericVector interp_genoprob_onechr(const NumericVector& genoprob, const NumericVector& map, const IntegerVector& pos_index);
RcppExport SEXP _qtl2_interp_genoprob_onechr(SEXP genoprobSEXP, SEXP mapSEXP, SEXP pos_indexSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprob(genoprobSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type map(mapSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type pos_index(pos_indexSEXP);
    rcpp_result_gen = Rcpp::wrap(interp_genoprob_onechr(genoprob, map, pos_index));
    return rcpp_result_gen;
END_RCPP
}
// interpolate_map
NumericVector interpolate_map(const NumericVector& oldpos, const NumericVector& oldmap, const NumericVector& newmap);
RcppExport SEXP _qtl2_interpolate_map(SEXP oldposSEXP, SEXP oldmapSEXP, SEXP newmapSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type oldpos(oldposSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type oldmap(oldmapSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type newmap(newmapSEXP);
    rcpp_result_gen = Rcpp::wrap(interpolate_map(oldpos, oldmap, newmap));
    return rcpp_result_gen;
END_RCPP
}
// find_intervals
IntegerMatrix find_intervals(const NumericVector& pos, const NumericVector& map, const double tol);
RcppExport SEXP _qtl2_find_intervals(SEXP posSEXP, SEXP mapSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type pos(posSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type map(mapSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(find_intervals(pos, map, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_rss_linreg
NumericVector calc_rss_linreg(const NumericMatrix& X, const NumericMatrix& Y, const double tol);
RcppExport SEXP _qtl2_calc_rss_linreg(SEXP XSEXP, SEXP YSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_rss_linreg(X, Y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_linreg
NumericVector calc_coef_linreg(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_coef_linreg(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_linreg(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_linreg
List calc_coefSE_linreg(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_coefSE_linreg(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_linreg(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_resid_linreg
NumericMatrix calc_resid_linreg(const NumericMatrix& X, const NumericMatrix& Y, const double tol);
RcppExport SEXP _qtl2_calc_resid_linreg(SEXP XSEXP, SEXP YSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_resid_linreg(X, Y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_resid_linreg_3d
NumericVector calc_resid_linreg_3d(const NumericMatrix& X, const NumericVector& P, const double tol);
RcppExport SEXP _qtl2_calc_resid_linreg_3d(SEXP XSEXP, SEXP PSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type P(PSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_resid_linreg_3d(X, P, tol));
    return rcpp_result_gen;
END_RCPP
}
// fit_linreg
List fit_linreg(const NumericMatrix& X, const NumericVector& y, const bool se, const double tol);
RcppExport SEXP _qtl2_fit_linreg(SEXP XSEXP, SEXP ySEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_linreg(X, y, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// fit_linreg_eigenchol
List fit_linreg_eigenchol(const NumericMatrix& X, const NumericVector& y, const bool se);
RcppExport SEXP _qtl2_fit_linreg_eigenchol(SEXP XSEXP, SEXP ySEXP, SEXP seSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_linreg_eigenchol(X, y, se));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_linreg_eigenchol
NumericVector calc_coef_linreg_eigenchol(const NumericMatrix& X, const NumericVector& y);
RcppExport SEXP _qtl2_calc_coef_linreg_eigenchol(SEXP XSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_linreg_eigenchol(X, y));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_linreg_eigenchol
List calc_coefSE_linreg_eigenchol(const NumericMatrix& X, const NumericVector& y);
RcppExport SEXP _qtl2_calc_coefSE_linreg_eigenchol(SEXP XSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_linreg_eigenchol(X, y));
    return rcpp_result_gen;
END_RCPP
}
// calc_rss_eigenchol
double calc_rss_eigenchol(const NumericMatrix& X, const NumericVector& y);
RcppExport SEXP _qtl2_calc_rss_eigenchol(SEXP XSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(calc_rss_eigenchol(X, y));
    return rcpp_result_gen;
END_RCPP
}
// calc_fitted_linreg_eigenchol
NumericVector calc_fitted_linreg_eigenchol(const NumericMatrix& X, const NumericVector& y);
RcppExport SEXP _qtl2_calc_fitted_linreg_eigenchol(SEXP XSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(calc_fitted_linreg_eigenchol(X, y));
    return rcpp_result_gen;
END_RCPP
}
// fit_linreg_eigenqr
List fit_linreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const bool se, const double tol);
RcppExport SEXP _qtl2_fit_linreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP seSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_linreg_eigenqr(X, y, se, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_coef_linreg_eigenqr
NumericVector calc_coef_linreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_coef_linreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coef_linreg_eigenqr(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_coefSE_linreg_eigenqr
List calc_coefSE_linreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_coefSE_linreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_coefSE_linreg_eigenqr(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_rss_eigenqr
double calc_rss_eigenqr(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_rss_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_rss_eigenqr(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_fitted_linreg_eigenqr
NumericVector calc_fitted_linreg_eigenqr(const NumericMatrix& X, const NumericVector& y, const double tol);
RcppExport SEXP _qtl2_calc_fitted_linreg_eigenqr(SEXP XSEXP, SEXP ySEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_fitted_linreg_eigenqr(X, y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_mvrss_eigenchol
NumericVector calc_mvrss_eigenchol(const NumericMatrix& X, const NumericMatrix& Y);
RcppExport SEXP _qtl2_calc_mvrss_eigenchol(SEXP XSEXP, SEXP YSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_mvrss_eigenchol(X, Y));
    return rcpp_result_gen;
END_RCPP
}
// calc_mvrss_eigenqr
NumericVector calc_mvrss_eigenqr(const NumericMatrix& X, const NumericMatrix& Y, const double tol);
RcppExport SEXP _qtl2_calc_mvrss_eigenqr(SEXP XSEXP, SEXP YSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_mvrss_eigenqr(X, Y, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_resid_eigenchol
NumericMatrix calc_resid_eigenchol(const NumericMatrix& X, const NumericMatrix& Y);
RcppExport SEXP _qtl2_calc_resid_eigenchol(SEXP XSEXP, SEXP YSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_resid_eigenchol(X, Y));
    return rcpp_result_gen;
END_RCPP
}
// calc_resid_eigenqr
NumericMatrix calc_resid_eigenqr(const NumericMatrix& X, const NumericMatrix& Y, const double tol);
RcppExport SEXP _qtl2_calc_resid_eigenqr(SEXP XSEXP, SEXP YSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_resid_eigenqr(X, Y, tol));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_eigen_decomp
List Rcpp_eigen_decomp(const NumericMatrix& A);
RcppExport SEXP _qtl2_Rcpp_eigen_decomp(SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_eigen_decomp(A));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_eigen_rotation
List Rcpp_eigen_rotation(const NumericMatrix& K, const NumericMatrix& y, const NumericMatrix& X);
RcppExport SEXP _qtl2_Rcpp_eigen_rotation(SEXP KSEXP, SEXP ySEXP, SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type K(KSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_eigen_rotation(K, y, X));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_calc_logdetXpX
double Rcpp_calc_logdetXpX(const NumericMatrix& X);
RcppExport SEXP _qtl2_Rcpp_calc_logdetXpX(SEXP XSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_calc_logdetXpX(X));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_calcLL
double Rcpp_calcLL(const double hsq, const NumericVector& Kva, const NumericVector& y, const NumericMatrix& X, const bool reml, const double logdetXpX);
RcppExport SEXP _qtl2_Rcpp_calcLL(SEXP hsqSEXP, SEXP KvaSEXP, SEXP ySEXP, SEXP XSEXP, SEXP remlSEXP, SEXP logdetXpXSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const double >::type hsq(hsqSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type Kva(KvaSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const bool >::type reml(remlSEXP);
    Rcpp::traits::input_parameter< const double >::type logdetXpX(logdetXpXSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_calcLL(hsq, Kva, y, X, reml, logdetXpX));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_calcLL_mat
NumericVector Rcpp_calcLL_mat(const NumericVector& hsq, const NumericVector& Kva, const NumericMatrix& Y, const NumericMatrix& X, const bool reml, const double logdetXpX);
RcppExport SEXP _qtl2_Rcpp_calcLL_mat(SEXP hsqSEXP, SEXP KvaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP remlSEXP, SEXP logdetXpXSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type hsq(hsqSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type Kva(KvaSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const bool >::type reml(remlSEXP);
    Rcpp::traits::input_parameter< const double >::type logdetXpX(logdetXpXSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_calcLL_mat(hsq, Kva, Y, X, reml, logdetXpX));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_fitLMM
List Rcpp_fitLMM(const NumericVector& Kva, const NumericVector& y, const NumericMatrix& X, const bool reml, const bool check_boundary, const double logdetXpX, const double tol);
RcppExport SEXP _qtl2_Rcpp_fitLMM(SEXP KvaSEXP, SEXP ySEXP, SEXP XSEXP, SEXP remlSEXP, SEXP check_boundarySEXP, SEXP logdetXpXSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type Kva(KvaSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const bool >::type reml(remlSEXP);
    Rcpp::traits::input_parameter< const bool >::type check_boundary(check_boundarySEXP);
    Rcpp::traits::input_parameter< const double >::type logdetXpX(logdetXpXSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_fitLMM(Kva, y, X, reml, check_boundary, logdetXpX, tol));
    return rcpp_result_gen;
END_RCPP
}
// Rcpp_fitLMM_mat
List Rcpp_fitLMM_mat(const NumericVector& Kva, const NumericMatrix& Y, const NumericMatrix& X, const bool reml, const bool check_boundary, const double logdetXpX, const double tol);
RcppExport SEXP _qtl2_Rcpp_fitLMM_mat(SEXP KvaSEXP, SEXP YSEXP, SEXP XSEXP, SEXP remlSEXP, SEXP check_boundarySEXP, SEXP logdetXpXSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type Kva(KvaSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const bool >::type reml(remlSEXP);
    Rcpp::traits::input_parameter< const bool >::type check_boundary(check_boundarySEXP);
    Rcpp::traits::input_parameter< const double >::type logdetXpX(logdetXpXSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(Rcpp_fitLMM_mat(Kva, Y, X, reml, check_boundary, logdetXpX, tol));
    return rcpp_result_gen;
END_RCPP
}
// locate_xo
List locate_xo(const IntegerMatrix geno, const NumericVector map, const String& crosstype, const bool is_X_chr);
RcppExport SEXP _qtl2_locate_xo(SEXP genoSEXP, SEXP mapSEXP, SEXP crosstypeSEXP, SEXP is_X_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix >::type geno(genoSEXP);
    Rcpp::traits::input_parameter< const NumericVector >::type map(mapSEXP);
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_X_chr(is_X_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(locate_xo(geno, map, crosstype, is_X_chr));
    return rcpp_result_gen;
END_RCPP
}
// R_lod_int_plain
IntegerVector R_lod_int_plain(const NumericVector& lod, const double drop);
RcppExport SEXP _qtl2_R_lod_int_plain(SEXP lodSEXP, SEXP dropSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type lod(lodSEXP);
    Rcpp::traits::input_parameter< const double >::type drop(dropSEXP);
    rcpp_result_gen = Rcpp::wrap(R_lod_int_plain(lod, drop));
    return rcpp_result_gen;
END_RCPP
}
// find_matching_cols
NumericVector find_matching_cols(const NumericMatrix& mat, const double tol);
RcppExport SEXP _qtl2_find_matching_cols(SEXP matSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type mat(matSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(find_matching_cols(mat, tol));
    return rcpp_result_gen;
END_RCPP
}
// find_lin_indep_cols
IntegerVector find_lin_indep_cols(const NumericMatrix& mat, const double tol);
RcppExport SEXP _qtl2_find_lin_indep_cols(SEXP matSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type mat(matSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(find_lin_indep_cols(mat, tol));
    return rcpp_result_gen;
END_RCPP
}
// formX_intcovar
NumericMatrix formX_intcovar(const NumericVector& probs, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const int position, const bool has_intercept);
RcppExport SEXP _qtl2_formX_intcovar(SEXP probsSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP positionSEXP, SEXP has_interceptSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const int >::type position(positionSEXP);
    Rcpp::traits::input_parameter< const bool >::type has_intercept(has_interceptSEXP);
    rcpp_result_gen = Rcpp::wrap(formX_intcovar(probs, addcovar, intcovar, position, has_intercept));
    return rcpp_result_gen;
END_RCPP
}
// expand_genoprobs_intcovar
NumericVector expand_genoprobs_intcovar(const NumericVector& probs, const NumericMatrix& intcovar);
RcppExport SEXP _qtl2_expand_genoprobs_intcovar(SEXP probsSEXP, SEXP intcovarSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type probs(probsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    rcpp_result_gen = Rcpp::wrap(expand_genoprobs_intcovar(probs, intcovar));
    return rcpp_result_gen;
END_RCPP
}
// weighted_matrix
NumericMatrix weighted_matrix(const NumericMatrix& mat, const NumericVector& weights);
RcppExport SEXP _qtl2_weighted_matrix(SEXP matSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type mat(matSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(weighted_matrix(mat, weights));
    return rcpp_result_gen;
END_RCPP
}
// weighted_3darray
NumericVector weighted_3darray(const NumericVector& array, const NumericVector& weights);
RcppExport SEXP _qtl2_weighted_3darray(SEXP arraySEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type array(arraySEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(weighted_3darray(array, weights));
    return rcpp_result_gen;
END_RCPP
}
// matrix_x_matrix
NumericMatrix matrix_x_matrix(const NumericMatrix& X, const NumericMatrix& Y);
RcppExport SEXP _qtl2_matrix_x_matrix(SEXP XSEXP, SEXP YSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type Y(YSEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_x_matrix(X, Y));
    return rcpp_result_gen;
END_RCPP
}
// matrix_x_vector
NumericVector matrix_x_vector(const NumericMatrix& X, const NumericVector& y);
RcppExport SEXP _qtl2_matrix_x_vector(SEXP XSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_x_vector(X, y));
    return rcpp_result_gen;
END_RCPP
}
// matrix_x_3darray
NumericVector matrix_x_3darray(const NumericMatrix& X, NumericVector& A);
RcppExport SEXP _qtl2_matrix_x_3darray(SEXP XSEXP, SEXP ASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< NumericVector& >::type A(ASEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_x_3darray(X, A));
    return rcpp_result_gen;
END_RCPP
}
// maxmarg
IntegerMatrix maxmarg(const NumericVector& prob_array, const double minprob, const double tol);
RcppExport SEXP _qtl2_maxmarg(SEXP prob_arraySEXP, SEXP minprobSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type prob_array(prob_arraySEXP);
    Rcpp::traits::input_parameter< const double >::type minprob(minprobSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(maxmarg(prob_array, minprob, tol));
    return rcpp_result_gen;
END_RCPP
}
// predict_snpgeno
IntegerMatrix predict_snpgeno(const IntegerMatrix& allele1, const IntegerMatrix& allele2, const IntegerMatrix& founder_geno);
RcppExport SEXP _qtl2_predict_snpgeno(SEXP allele1SEXP, SEXP allele2SEXP, SEXP founder_genoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type allele1(allele1SEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type allele2(allele2SEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    rcpp_result_gen = Rcpp::wrap(predict_snpgeno(allele1, allele2, founder_geno));
    return rcpp_result_gen;
END_RCPP
}
// random_int
IntegerVector random_int(const int n, const int low, const int high);
RcppExport SEXP _qtl2_random_int(SEXP nSEXP, SEXP lowSEXP, SEXP highSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n(nSEXP);
    Rcpp::traits::input_parameter< const int >::type low(lowSEXP);
    Rcpp::traits::input_parameter< const int >::type high(highSEXP);
    rcpp_result_gen = Rcpp::wrap(random_int(n, low, high));
    return rcpp_result_gen;
END_RCPP
}
// get_permutation
IntegerVector get_permutation(const int n);
RcppExport SEXP _qtl2_get_permutation(SEXP nSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n(nSEXP);
    rcpp_result_gen = Rcpp::wrap(get_permutation(n));
    return rcpp_result_gen;
END_RCPP
}
// permute_nvector
NumericMatrix permute_nvector(const int n_perm, const NumericVector x);
RcppExport SEXP _qtl2_permute_nvector(SEXP n_permSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_perm(n_permSEXP);
    Rcpp::traits::input_parameter< const NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(permute_nvector(n_perm, x));
    return rcpp_result_gen;
END_RCPP
}
// permute_ivector
IntegerMatrix permute_ivector(const int n_perm, const IntegerVector x);
RcppExport SEXP _qtl2_permute_ivector(SEXP n_permSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_perm(n_permSEXP);
    Rcpp::traits::input_parameter< const IntegerVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(permute_ivector(n_perm, x));
    return rcpp_result_gen;
END_RCPP
}
// permute_nvector_stratified
NumericMatrix permute_nvector_stratified(const int n_perm, const NumericVector& x, const IntegerVector& strata, int n_strata);
RcppExport SEXP _qtl2_permute_nvector_stratified(SEXP n_permSEXP, SEXP xSEXP, SEXP strataSEXP, SEXP n_strataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_perm(n_permSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type strata(strataSEXP);
    Rcpp::traits::input_parameter< int >::type n_strata(n_strataSEXP);
    rcpp_result_gen = Rcpp::wrap(permute_nvector_stratified(n_perm, x, strata, n_strata));
    return rcpp_result_gen;
END_RCPP
}
// permute_ivector_stratified
IntegerMatrix permute_ivector_stratified(const int n_perm, const IntegerVector& x, const IntegerVector& strata, int n_strata);
RcppExport SEXP _qtl2_permute_ivector_stratified(SEXP n_permSEXP, SEXP xSEXP, SEXP strataSEXP, SEXP n_strataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_perm(n_permSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type strata(strataSEXP);
    Rcpp::traits::input_parameter< int >::type n_strata(n_strataSEXP);
    rcpp_result_gen = Rcpp::wrap(permute_ivector_stratified(n_perm, x, strata, n_strata));
    return rcpp_result_gen;
END_RCPP
}
// reduce_markers
IntegerVector reduce_markers(const NumericVector& pos, const double min_dist, const NumericVector& weights);
RcppExport SEXP _qtl2_reduce_markers(SEXP posSEXP, SEXP min_distSEXP, SEXP weightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type pos(posSEXP);
    Rcpp::traits::input_parameter< const double >::type min_dist(min_distSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    rcpp_result_gen = Rcpp::wrap(reduce_markers(pos, min_dist, weights));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr
NumericMatrix scan_binary_onechr(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scan_binary_onechr(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr(genoprobs, pheno, addcovar, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr_weighted
NumericMatrix scan_binary_onechr_weighted(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scan_binary_onechr_weighted(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr_weighted(genoprobs, pheno, addcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr_intcovar_highmem
NumericMatrix scan_binary_onechr_intcovar_highmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const int maxit, const double tol, const double qr_tol);
RcppExport SEXP _qtl2_scan_binary_onechr_intcovar_highmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr_intcovar_highmem(genoprobs, pheno, addcovar, intcovar, maxit, tol, qr_tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr_intcovar_weighted_highmem
NumericMatrix scan_binary_onechr_intcovar_weighted_highmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol);
RcppExport SEXP _qtl2_scan_binary_onechr_intcovar_weighted_highmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr_intcovar_weighted_highmem(genoprobs, pheno, addcovar, intcovar, weights, maxit, tol, qr_tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr_intcovar_lowmem
NumericMatrix scan_binary_onechr_intcovar_lowmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scan_binary_onechr_intcovar_lowmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr_intcovar_lowmem(genoprobs, pheno, addcovar, intcovar, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scan_binary_onechr_intcovar_weighted_lowmem
NumericMatrix scan_binary_onechr_intcovar_weighted_lowmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scan_binary_onechr_intcovar_weighted_lowmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_binary_onechr_intcovar_weighted_lowmem(genoprobs, pheno, addcovar, intcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_nocovar
NumericMatrix scan_hk_onechr_nocovar(const NumericVector& genoprobs, const NumericMatrix& pheno, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_nocovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_nocovar(genoprobs, pheno, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr
NumericMatrix scan_hk_onechr(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr(genoprobs, pheno, addcovar, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_weighted
NumericMatrix scan_hk_onechr_weighted(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_weighted(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_weighted(genoprobs, pheno, addcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_intcovar_highmem
NumericMatrix scan_hk_onechr_intcovar_highmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_intcovar_highmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_intcovar_highmem(genoprobs, pheno, addcovar, intcovar, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_intcovar_weighted_highmem
NumericMatrix scan_hk_onechr_intcovar_weighted_highmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_intcovar_weighted_highmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_intcovar_weighted_highmem(genoprobs, pheno, addcovar, intcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_intcovar_lowmem
NumericMatrix scan_hk_onechr_intcovar_lowmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_intcovar_lowmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_intcovar_lowmem(genoprobs, pheno, addcovar, intcovar, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_hk_onechr_intcovar_weighted_lowmem
NumericMatrix scan_hk_onechr_intcovar_weighted_lowmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_hk_onechr_intcovar_weighted_lowmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_hk_onechr_intcovar_weighted_lowmem(genoprobs, pheno, addcovar, intcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_pg_onechr
NumericVector scan_pg_onechr(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_pg_onechr(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_pg_onechr(genoprobs, pheno, addcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_pg_onechr_intcovar_highmem
NumericVector scan_pg_onechr_intcovar_highmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_pg_onechr_intcovar_highmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_pg_onechr_intcovar_highmem(genoprobs, pheno, addcovar, intcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scan_pg_onechr_intcovar_lowmem
NumericVector scan_pg_onechr_intcovar_lowmem(const NumericVector& genoprobs, const NumericMatrix& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scan_pg_onechr_intcovar_lowmem(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scan_pg_onechr_intcovar_lowmem(genoprobs, pheno, addcovar, intcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scanblup
List scanblup(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const bool se, const bool reml, const double tol);
RcppExport SEXP _qtl2_scanblup(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP seSEXP, SEXP remlSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const bool >::type se(seSEXP);
    Rcpp::traits::input_parameter< const bool >::type reml(remlSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scanblup(genoprobs, pheno, addcovar, se, reml, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_binary_addcovar
NumericMatrix scancoef_binary_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scancoef_binary_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_binary_addcovar(genoprobs, pheno, addcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_binary_intcovar
NumericMatrix scancoef_binary_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scancoef_binary_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_binary_intcovar(genoprobs, pheno, addcovar, intcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_binary_addcovar
List scancoefSE_binary_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scancoefSE_binary_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_binary_addcovar(genoprobs, pheno, addcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_binary_intcovar
List scancoefSE_binary_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const int maxit, const double tol, const double qr_tol, const double eta_max);
RcppExport SEXP _qtl2_scancoefSE_binary_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP maxitSEXP, SEXP tolSEXP, SEXP qr_tolSEXP, SEXP eta_maxSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const int >::type maxit(maxitSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    Rcpp::traits::input_parameter< const double >::type qr_tol(qr_tolSEXP);
    Rcpp::traits::input_parameter< const double >::type eta_max(eta_maxSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_binary_intcovar(genoprobs, pheno, addcovar, intcovar, weights, maxit, tol, qr_tol, eta_max));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_hk_addcovar
NumericMatrix scancoef_hk_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoef_hk_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_hk_addcovar(genoprobs, pheno, addcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_hk_intcovar
NumericMatrix scancoef_hk_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoef_hk_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_hk_intcovar(genoprobs, pheno, addcovar, intcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_hk_addcovar
List scancoefSE_hk_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoefSE_hk_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_hk_addcovar(genoprobs, pheno, addcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_hk_intcovar
List scancoefSE_hk_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoefSE_hk_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_hk_intcovar(genoprobs, pheno, addcovar, intcovar, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_pg_addcovar
NumericMatrix scancoef_pg_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoef_pg_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_pg_addcovar(genoprobs, pheno, addcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoef_pg_intcovar
NumericMatrix scancoef_pg_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoef_pg_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoef_pg_intcovar(genoprobs, pheno, addcovar, intcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_pg_addcovar
List scancoefSE_pg_addcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoefSE_pg_addcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_pg_addcovar(genoprobs, pheno, addcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// scancoefSE_pg_intcovar
List scancoefSE_pg_intcovar(const NumericVector& genoprobs, const NumericVector& pheno, const NumericMatrix& addcovar, const NumericMatrix& intcovar, const NumericMatrix& eigenvec, const NumericVector& weights, const double tol);
RcppExport SEXP _qtl2_scancoefSE_pg_intcovar(SEXP genoprobsSEXP, SEXP phenoSEXP, SEXP addcovarSEXP, SEXP intcovarSEXP, SEXP eigenvecSEXP, SEXP weightsSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprobs(genoprobsSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type pheno(phenoSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type addcovar(addcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type intcovar(intcovarSEXP);
    Rcpp::traits::input_parameter< const NumericMatrix& >::type eigenvec(eigenvecSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type weights(weightsSEXP);
    Rcpp::traits::input_parameter< const double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(scancoefSE_pg_intcovar(genoprobs, pheno, addcovar, intcovar, eigenvec, weights, tol));
    return rcpp_result_gen;
END_RCPP
}
// calc_sdp
IntegerVector calc_sdp(const IntegerMatrix& geno);
RcppExport SEXP _qtl2_calc_sdp(SEXP genoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type geno(genoSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_sdp(geno));
    return rcpp_result_gen;
END_RCPP
}
// invert_sdp
IntegerMatrix invert_sdp(const IntegerVector& sdp, const int n_str);
RcppExport SEXP _qtl2_invert_sdp(SEXP sdpSEXP, SEXP n_strSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerVector& >::type sdp(sdpSEXP);
    Rcpp::traits::input_parameter< const int >::type n_str(n_strSEXP);
    rcpp_result_gen = Rcpp::wrap(invert_sdp(sdp, n_str));
    return rcpp_result_gen;
END_RCPP
}
// alleleprob_to_snpprob
NumericVector alleleprob_to_snpprob(const NumericVector& alleleprob, const IntegerVector& sdp, const IntegerVector& interval, const LogicalVector& on_map);
RcppExport SEXP _qtl2_alleleprob_to_snpprob(SEXP alleleprobSEXP, SEXP sdpSEXP, SEXP intervalSEXP, SEXP on_mapSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type alleleprob(alleleprobSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type sdp(sdpSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type interval(intervalSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type on_map(on_mapSEXP);
    rcpp_result_gen = Rcpp::wrap(alleleprob_to_snpprob(alleleprob, sdp, interval, on_map));
    return rcpp_result_gen;
END_RCPP
}
// genocol_to_snpcol
IntegerVector genocol_to_snpcol(const int n_str, const int sdp);
RcppExport SEXP _qtl2_genocol_to_snpcol(SEXP n_strSEXP, SEXP sdpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_str(n_strSEXP);
    Rcpp::traits::input_parameter< const int >::type sdp(sdpSEXP);
    rcpp_result_gen = Rcpp::wrap(genocol_to_snpcol(n_str, sdp));
    return rcpp_result_gen;
END_RCPP
}
// genoprob_to_snpprob
NumericVector genoprob_to_snpprob(const NumericVector& genoprob, const IntegerVector& sdp, const IntegerVector& interval, const LogicalVector& on_map);
RcppExport SEXP _qtl2_genoprob_to_snpprob(SEXP genoprobSEXP, SEXP sdpSEXP, SEXP intervalSEXP, SEXP on_mapSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprob(genoprobSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type sdp(sdpSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type interval(intervalSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type on_map(on_mapSEXP);
    rcpp_result_gen = Rcpp::wrap(genoprob_to_snpprob(genoprob, sdp, interval, on_map));
    return rcpp_result_gen;
END_RCPP
}
// Xgenocol_to_snpcol
IntegerVector Xgenocol_to_snpcol(const int n_str, const int sdp);
RcppExport SEXP _qtl2_Xgenocol_to_snpcol(SEXP n_strSEXP, SEXP sdpSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type n_str(n_strSEXP);
    Rcpp::traits::input_parameter< const int >::type sdp(sdpSEXP);
    rcpp_result_gen = Rcpp::wrap(Xgenocol_to_snpcol(n_str, sdp));
    return rcpp_result_gen;
END_RCPP
}
// Xgenoprob_to_snpprob
NumericVector Xgenoprob_to_snpprob(const NumericVector& genoprob, const IntegerVector& sdp, const IntegerVector& interval, const LogicalVector& on_map);
RcppExport SEXP _qtl2_Xgenoprob_to_snpprob(SEXP genoprobSEXP, SEXP sdpSEXP, SEXP intervalSEXP, SEXP on_mapSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type genoprob(genoprobSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type sdp(sdpSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type interval(intervalSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type on_map(on_mapSEXP);
    rcpp_result_gen = Rcpp::wrap(Xgenoprob_to_snpprob(genoprob, sdp, interval, on_map));
    return rcpp_result_gen;
END_RCPP
}
// test_init
double test_init(const String& crosstype, const int true_gen, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_init(SEXP crosstypeSEXP, SEXP true_genSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const int >::type true_gen(true_genSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_init(crosstype, true_gen, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_emit
double test_emit(const String& crosstype, const int obs_gen, const int true_gen, const double error_prob, const IntegerVector& founder_geno, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_emit(SEXP crosstypeSEXP, SEXP obs_genSEXP, SEXP true_genSEXP, SEXP error_probSEXP, SEXP founder_genoSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const int >::type obs_gen(obs_genSEXP);
    Rcpp::traits::input_parameter< const int >::type true_gen(true_genSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_emit(crosstype, obs_gen, true_gen, error_prob, founder_geno, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_step
double test_step(const String& crosstype, const int gen_left, const int gen_right, const double rec_frac, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_step(SEXP crosstypeSEXP, SEXP gen_leftSEXP, SEXP gen_rightSEXP, SEXP rec_fracSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const int >::type gen_left(gen_leftSEXP);
    Rcpp::traits::input_parameter< const int >::type gen_right(gen_rightSEXP);
    Rcpp::traits::input_parameter< const double >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_step(crosstype, gen_left, gen_right, rec_frac, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_check_geno
bool test_check_geno(const String& crosstype, const int gen, const bool is_observed_value, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_check_geno(SEXP crosstypeSEXP, SEXP genSEXP, SEXP is_observed_valueSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const int >::type gen(genSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_observed_value(is_observed_valueSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_check_geno(crosstype, gen, is_observed_value, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_possible_gen
IntegerVector test_possible_gen(const String& crosstype, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_possible_gen(SEXP crosstypeSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_possible_gen(crosstype, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_ngen
int test_ngen(const String& crosstype, const bool is_x_chr);
RcppExport SEXP _qtl2_test_ngen(SEXP crosstypeSEXP, SEXP is_x_chrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    rcpp_result_gen = Rcpp::wrap(test_ngen(crosstype, is_x_chr));
    return rcpp_result_gen;
END_RCPP
}
// test_nrec
int test_nrec(const String& crosstype, const int gen_left, const int gen_right, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_nrec(SEXP crosstypeSEXP, SEXP gen_leftSEXP, SEXP gen_rightSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const int >::type gen_left(gen_leftSEXP);
    Rcpp::traits::input_parameter< const int >::type gen_right(gen_rightSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_nrec(crosstype, gen_left, gen_right, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_founder_geno_values
bool test_founder_geno_values(const String& crosstype, const IntegerMatrix& founder_geno);
RcppExport SEXP _qtl2_test_founder_geno_values(SEXP crosstypeSEXP, SEXP founder_genoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_founder_geno_values(crosstype, founder_geno));
    return rcpp_result_gen;
END_RCPP
}
// need_founder_geno
bool need_founder_geno(const String& crosstype);
RcppExport SEXP _qtl2_need_founder_geno(SEXP crosstypeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    rcpp_result_gen = Rcpp::wrap(need_founder_geno(crosstype));
    return rcpp_result_gen;
END_RCPP
}
// check_founder_geno_size
bool check_founder_geno_size(const String& crosstype, const IntegerMatrix& founder_geno, const int n_markers);
RcppExport SEXP _qtl2_check_founder_geno_size(SEXP crosstypeSEXP, SEXP founder_genoSEXP, SEXP n_markersSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const int >::type n_markers(n_markersSEXP);
    rcpp_result_gen = Rcpp::wrap(check_founder_geno_size(crosstype, founder_geno, n_markers));
    return rcpp_result_gen;
END_RCPP
}
// test_emitmatrix
std::vector<NumericMatrix> test_emitmatrix(const String& crosstype, const double error_prob, const int max_obsgeno, const IntegerMatrix& founder_geno, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_emitmatrix(SEXP crosstypeSEXP, SEXP error_probSEXP, SEXP max_obsgenoSEXP, SEXP founder_genoSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const double >::type error_prob(error_probSEXP);
    Rcpp::traits::input_parameter< const int >::type max_obsgeno(max_obsgenoSEXP);
    Rcpp::traits::input_parameter< const IntegerMatrix& >::type founder_geno(founder_genoSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_emitmatrix(crosstype, error_prob, max_obsgeno, founder_geno, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_stepmatrix
std::vector<NumericMatrix> test_stepmatrix(const String& crosstype, const NumericVector& rec_frac, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_stepmatrix(SEXP crosstypeSEXP, SEXP rec_fracSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type rec_frac(rec_fracSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_stepmatrix(crosstype, rec_frac, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}
// test_initvector
NumericVector test_initvector(const String& crosstype, const bool is_x_chr, const bool is_female, const IntegerVector& cross_info);
RcppExport SEXP _qtl2_test_initvector(SEXP crosstypeSEXP, SEXP is_x_chrSEXP, SEXP is_femaleSEXP, SEXP cross_infoSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const String& >::type crosstype(crosstypeSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_x_chr(is_x_chrSEXP);
    Rcpp::traits::input_parameter< const bool >::type is_female(is_femaleSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type cross_info(cross_infoSEXP);
    rcpp_result_gen = Rcpp::wrap(test_initvector(crosstype, is_x_chr, is_female, cross_info));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_qtl2_arrange_genes", (DL_FUNC) &_qtl2_arrange_genes, 2},
    {"_qtl2_R_bayes_int_plain", (DL_FUNC) &_qtl2_R_bayes_int_plain, 3},
    {"_qtl2_calc_ll_binreg", (DL_FUNC) &_qtl2_calc_ll_binreg, 6},
    {"_qtl2_calc_coef_binreg", (DL_FUNC) &_qtl2_calc_coef_binreg, 6},
    {"_qtl2_calc_coefSE_binreg", (DL_FUNC) &_qtl2_calc_coefSE_binreg, 6},
    {"_qtl2_fit_binreg", (DL_FUNC) &_qtl2_fit_binreg, 7},
    {"_qtl2_calc_ll_binreg_eigenchol", (DL_FUNC) &_qtl2_calc_ll_binreg_eigenchol, 5},
    {"_qtl2_calc_ll_binreg_eigenqr", (DL_FUNC) &_qtl2_calc_ll_binreg_eigenqr, 6},
    {"_qtl2_calc_coef_binreg_eigenqr", (DL_FUNC) &_qtl2_calc_coef_binreg_eigenqr, 6},
    {"_qtl2_calc_coefSE_binreg_eigenqr", (DL_FUNC) &_qtl2_calc_coefSE_binreg_eigenqr, 6},
    {"_qtl2_fit_binreg_eigenqr", (DL_FUNC) &_qtl2_fit_binreg_eigenqr, 7},
    {"_qtl2_calc_ll_binreg_weighted", (DL_FUNC) &_qtl2_calc_ll_binreg_weighted, 7},
    {"_qtl2_calc_coef_binreg_weighted", (DL_FUNC) &_qtl2_calc_coef_binreg_weighted, 7},
    {"_qtl2_calc_coefSE_binreg_weighted", (DL_FUNC) &_qtl2_calc_coefSE_binreg_weighted, 7},
    {"_qtl2_fit_binreg_weighted", (DL_FUNC) &_qtl2_fit_binreg_weighted, 8},
    {"_qtl2_calc_ll_binreg_weighted_eigenchol", (DL_FUNC) &_qtl2_calc_ll_binreg_weighted_eigenchol, 6},
    {"_qtl2_calc_ll_binreg_weighted_eigenqr", (DL_FUNC) &_qtl2_calc_ll_binreg_weighted_eigenqr, 7},
    {"_qtl2_calc_coef_binreg_weighted_eigenqr", (DL_FUNC) &_qtl2_calc_coef_binreg_weighted_eigenqr, 7},
    {"_qtl2_calc_coefSE_binreg_weighted_eigenqr", (DL_FUNC) &_qtl2_calc_coefSE_binreg_weighted_eigenqr, 7},
    {"_qtl2_fit_binreg_weighted_eigenqr", (DL_FUNC) &_qtl2_fit_binreg_weighted_eigenqr, 8},
    {"_qtl2_calc_kinship", (DL_FUNC) &_qtl2_calc_kinship, 1},
    {"_qtl2_crosstype_supported", (DL_FUNC) &_qtl2_crosstype_supported, 1},
    {"_qtl2_count_invalid_genotypes", (DL_FUNC) &_qtl2_count_invalid_genotypes, 5},
    {"_qtl2_check_crossinfo", (DL_FUNC) &_qtl2_check_crossinfo, 3},
    {"_qtl2_check_is_female_vector", (DL_FUNC) &_qtl2_check_is_female_vector, 3},
    {"_qtl2_check_handle_x_chr", (DL_FUNC) &_qtl2_check_handle_x_chr, 2},
    {"_qtl2_chisq_colpairs", (DL_FUNC) &_qtl2_chisq_colpairs, 1},
    {"_qtl2_clean_genoprob", (DL_FUNC) &_qtl2_clean_genoprob, 3},
    {"_qtl2_compare_geno", (DL_FUNC) &_qtl2_compare_geno, 1},
    {"_qtl2_count_xo", (DL_FUNC) &_qtl2_count_xo, 3},
    {"_qtl2_count_xo_3d", (DL_FUNC) &_qtl2_count_xo_3d, 3},
    {"_qtl2_mpp_encode_alleles", (DL_FUNC) &_qtl2_mpp_encode_alleles, 4},
    {"_qtl2_mpp_decode_geno", (DL_FUNC) &_qtl2_mpp_decode_geno, 3},
    {"_qtl2_mpp_is_het", (DL_FUNC) &_qtl2_mpp_is_het, 3},
    {"_qtl2_mpp_geno_names", (DL_FUNC) &_qtl2_mpp_geno_names, 2},
    {"_qtl2_invert_founder_index", (DL_FUNC) &_qtl2_invert_founder_index, 1},
    {"_qtl2_is_phase_known", (DL_FUNC) &_qtl2_is_phase_known, 1},
    {"_qtl2_find_dup_markers_notexact", (DL_FUNC) &_qtl2_find_dup_markers_notexact, 4},
    {"_qtl2_find_ibd_segments", (DL_FUNC) &_qtl2_find_ibd_segments, 4},
    {"_qtl2_R_find_peaks", (DL_FUNC) &_qtl2_R_find_peaks, 3},
    {"_qtl2_R_find_peaks_and_lodint", (DL_FUNC) &_qtl2_R_find_peaks_and_lodint, 4},
    {"_qtl2_R_find_peaks_and_bayesint", (DL_FUNC) &_qtl2_R_find_peaks_and_bayesint, 5},
    {"_qtl2_fit1_binary_addcovar", (DL_FUNC) &_qtl2_fit1_binary_addcovar, 9},
    {"_qtl2_fit1_binary_intcovar", (DL_FUNC) &_qtl2_fit1_binary_intcovar, 10},
    {"_qtl2_fit1_hk_addcovar", (DL_FUNC) &_qtl2_fit1_hk_addcovar, 6},
    {"_qtl2_fit1_hk_intcovar", (DL_FUNC) &_qtl2_fit1_hk_intcovar, 7},
    {"_qtl2_fit1_pg_addcovar", (DL_FUNC) &_qtl2_fit1_pg_addcovar, 7},
    {"_qtl2_fit1_pg_intcovar", (DL_FUNC) &_qtl2_fit1_pg_intcovar, 8},
    {"_qtl2_geno_names", (DL_FUNC) &_qtl2_geno_names, 3},
    {"_qtl2_nalleles", (DL_FUNC) &_qtl2_nalleles, 1},
    {"_qtl2_genoprob_to_alleleprob", (DL_FUNC) &_qtl2_genoprob_to_alleleprob, 3},
    {"_qtl2_get_x_covar", (DL_FUNC) &_qtl2_get_x_covar, 3},
    {"_qtl2_guess_phase_f2A", (DL_FUNC) &_qtl2_guess_phase_f2A, 2},
    {"_qtl2_guess_phase_f2X", (DL_FUNC) &_qtl2_guess_phase_f2X, 2},
    {"_qtl2_guess_phase_A", (DL_FUNC) &_qtl2_guess_phase_A, 3},
    {"_qtl2_guess_phase_X", (DL_FUNC) &_qtl2_guess_phase_X, 4},
    {"_qtl2_calc_errorlod", (DL_FUNC) &_qtl2_calc_errorlod, 7},
    {"_qtl2_calc_genoprob", (DL_FUNC) &_qtl2_calc_genoprob, 9},
    {"_qtl2_calc_genoprob2", (DL_FUNC) &_qtl2_calc_genoprob2, 9},
    {"_qtl2_est_map", (DL_FUNC) &_qtl2_est_map, 11},
    {"_qtl2_est_map2", (DL_FUNC) &_qtl2_est_map2, 13},
    {"_qtl2_sim_geno", (DL_FUNC) &_qtl2_sim_geno, 10},
    {"_qtl2_sim_geno2", (DL_FUNC) &_qtl2_sim_geno2, 10},
    {"_qtl2_addlog", (DL_FUNC) &_qtl2_addlog, 2},
    {"_qtl2_subtractlog", (DL_FUNC) &_qtl2_subtractlog, 2},
    {"_qtl2_viterbi", (DL_FUNC) &_qtl2_viterbi, 9},
    {"_qtl2_viterbi2", (DL_FUNC) &_qtl2_viterbi2, 9},
    {"_qtl2_interp_genoprob_onechr", (DL_FUNC) &_qtl2_interp_genoprob_onechr, 3},
    {"_qtl2_interpolate_map", (DL_FUNC) &_qtl2_interpolate_map, 3},
    {"_qtl2_find_intervals", (DL_FUNC) &_qtl2_find_intervals, 3},
    {"_qtl2_calc_rss_linreg", (DL_FUNC) &_qtl2_calc_rss_linreg, 3},
    {"_qtl2_calc_coef_linreg", (DL_FUNC) &_qtl2_calc_coef_linreg, 3},
    {"_qtl2_calc_coefSE_linreg", (DL_FUNC) &_qtl2_calc_coefSE_linreg, 3},
    {"_qtl2_calc_resid_linreg", (DL_FUNC) &_qtl2_calc_resid_linreg, 3},
    {"_qtl2_calc_resid_linreg_3d", (DL_FUNC) &_qtl2_calc_resid_linreg_3d, 3},
    {"_qtl2_fit_linreg", (DL_FUNC) &_qtl2_fit_linreg, 4},
    {"_qtl2_fit_linreg_eigenchol", (DL_FUNC) &_qtl2_fit_linreg_eigenchol, 3},
    {"_qtl2_calc_coef_linreg_eigenchol", (DL_FUNC) &_qtl2_calc_coef_linreg_eigenchol, 2},
    {"_qtl2_calc_coefSE_linreg_eigenchol", (DL_FUNC) &_qtl2_calc_coefSE_linreg_eigenchol, 2},
    {"_qtl2_calc_rss_eigenchol", (DL_FUNC) &_qtl2_calc_rss_eigenchol, 2},
    {"_qtl2_calc_fitted_linreg_eigenchol", (DL_FUNC) &_qtl2_calc_fitted_linreg_eigenchol, 2},
    {"_qtl2_fit_linreg_eigenqr", (DL_FUNC) &_qtl2_fit_linreg_eigenqr, 4},
    {"_qtl2_calc_coef_linreg_eigenqr", (DL_FUNC) &_qtl2_calc_coef_linreg_eigenqr, 3},
    {"_qtl2_calc_coefSE_linreg_eigenqr", (DL_FUNC) &_qtl2_calc_coefSE_linreg_eigenqr, 3},
    {"_qtl2_calc_rss_eigenqr", (DL_FUNC) &_qtl2_calc_rss_eigenqr, 3},
    {"_qtl2_calc_fitted_linreg_eigenqr", (DL_FUNC) &_qtl2_calc_fitted_linreg_eigenqr, 3},
    {"_qtl2_calc_mvrss_eigenchol", (DL_FUNC) &_qtl2_calc_mvrss_eigenchol, 2},
    {"_qtl2_calc_mvrss_eigenqr", (DL_FUNC) &_qtl2_calc_mvrss_eigenqr, 3},
    {"_qtl2_calc_resid_eigenchol", (DL_FUNC) &_qtl2_calc_resid_eigenchol, 2},
    {"_qtl2_calc_resid_eigenqr", (DL_FUNC) &_qtl2_calc_resid_eigenqr, 3},
    {"_qtl2_Rcpp_eigen_decomp", (DL_FUNC) &_qtl2_Rcpp_eigen_decomp, 1},
    {"_qtl2_Rcpp_eigen_rotation", (DL_FUNC) &_qtl2_Rcpp_eigen_rotation, 3},
    {"_qtl2_Rcpp_calc_logdetXpX", (DL_FUNC) &_qtl2_Rcpp_calc_logdetXpX, 1},
    {"_qtl2_Rcpp_calcLL", (DL_FUNC) &_qtl2_Rcpp_calcLL, 6},
    {"_qtl2_Rcpp_calcLL_mat", (DL_FUNC) &_qtl2_Rcpp_calcLL_mat, 6},
    {"_qtl2_Rcpp_fitLMM", (DL_FUNC) &_qtl2_Rcpp_fitLMM, 7},
    {"_qtl2_Rcpp_fitLMM_mat", (DL_FUNC) &_qtl2_Rcpp_fitLMM_mat, 7},
    {"_qtl2_locate_xo", (DL_FUNC) &_qtl2_locate_xo, 4},
    {"_qtl2_R_lod_int_plain", (DL_FUNC) &_qtl2_R_lod_int_plain, 2},
    {"_qtl2_find_matching_cols", (DL_FUNC) &_qtl2_find_matching_cols, 2},
    {"_qtl2_find_lin_indep_cols", (DL_FUNC) &_qtl2_find_lin_indep_cols, 2},
    {"_qtl2_formX_intcovar", (DL_FUNC) &_qtl2_formX_intcovar, 5},
    {"_qtl2_expand_genoprobs_intcovar", (DL_FUNC) &_qtl2_expand_genoprobs_intcovar, 2},
    {"_qtl2_weighted_matrix", (DL_FUNC) &_qtl2_weighted_matrix, 2},
    {"_qtl2_weighted_3darray", (DL_FUNC) &_qtl2_weighted_3darray, 2},
    {"_qtl2_matrix_x_matrix", (DL_FUNC) &_qtl2_matrix_x_matrix, 2},
    {"_qtl2_matrix_x_vector", (DL_FUNC) &_qtl2_matrix_x_vector, 2},
    {"_qtl2_matrix_x_3darray", (DL_FUNC) &_qtl2_matrix_x_3darray, 2},
    {"_qtl2_maxmarg", (DL_FUNC) &_qtl2_maxmarg, 3},
    {"_qtl2_predict_snpgeno", (DL_FUNC) &_qtl2_predict_snpgeno, 3},
    {"_qtl2_random_int", (DL_FUNC) &_qtl2_random_int, 3},
    {"_qtl2_get_permutation", (DL_FUNC) &_qtl2_get_permutation, 1},
    {"_qtl2_permute_nvector", (DL_FUNC) &_qtl2_permute_nvector, 2},
    {"_qtl2_permute_ivector", (DL_FUNC) &_qtl2_permute_ivector, 2},
    {"_qtl2_permute_nvector_stratified", (DL_FUNC) &_qtl2_permute_nvector_stratified, 4},
    {"_qtl2_permute_ivector_stratified", (DL_FUNC) &_qtl2_permute_ivector_stratified, 4},
    {"_qtl2_reduce_markers", (DL_FUNC) &_qtl2_reduce_markers, 3},
    {"_qtl2_scan_binary_onechr", (DL_FUNC) &_qtl2_scan_binary_onechr, 7},
    {"_qtl2_scan_binary_onechr_weighted", (DL_FUNC) &_qtl2_scan_binary_onechr_weighted, 8},
    {"_qtl2_scan_binary_onechr_intcovar_highmem", (DL_FUNC) &_qtl2_scan_binary_onechr_intcovar_highmem, 7},
    {"_qtl2_scan_binary_onechr_intcovar_weighted_highmem", (DL_FUNC) &_qtl2_scan_binary_onechr_intcovar_weighted_highmem, 8},
    {"_qtl2_scan_binary_onechr_intcovar_lowmem", (DL_FUNC) &_qtl2_scan_binary_onechr_intcovar_lowmem, 8},
    {"_qtl2_scan_binary_onechr_intcovar_weighted_lowmem", (DL_FUNC) &_qtl2_scan_binary_onechr_intcovar_weighted_lowmem, 9},
    {"_qtl2_scan_hk_onechr_nocovar", (DL_FUNC) &_qtl2_scan_hk_onechr_nocovar, 3},
    {"_qtl2_scan_hk_onechr", (DL_FUNC) &_qtl2_scan_hk_onechr, 4},
    {"_qtl2_scan_hk_onechr_weighted", (DL_FUNC) &_qtl2_scan_hk_onechr_weighted, 5},
    {"_qtl2_scan_hk_onechr_intcovar_highmem", (DL_FUNC) &_qtl2_scan_hk_onechr_intcovar_highmem, 5},
    {"_qtl2_scan_hk_onechr_intcovar_weighted_highmem", (DL_FUNC) &_qtl2_scan_hk_onechr_intcovar_weighted_highmem, 6},
    {"_qtl2_scan_hk_onechr_intcovar_lowmem", (DL_FUNC) &_qtl2_scan_hk_onechr_intcovar_lowmem, 5},
    {"_qtl2_scan_hk_onechr_intcovar_weighted_lowmem", (DL_FUNC) &_qtl2_scan_hk_onechr_intcovar_weighted_lowmem, 6},
    {"_qtl2_scan_pg_onechr", (DL_FUNC) &_qtl2_scan_pg_onechr, 6},
    {"_qtl2_scan_pg_onechr_intcovar_highmem", (DL_FUNC) &_qtl2_scan_pg_onechr_intcovar_highmem, 7},
    {"_qtl2_scan_pg_onechr_intcovar_lowmem", (DL_FUNC) &_qtl2_scan_pg_onechr_intcovar_lowmem, 7},
    {"_qtl2_scanblup", (DL_FUNC) &_qtl2_scanblup, 6},
    {"_qtl2_scancoef_binary_addcovar", (DL_FUNC) &_qtl2_scancoef_binary_addcovar, 8},
    {"_qtl2_scancoef_binary_intcovar", (DL_FUNC) &_qtl2_scancoef_binary_intcovar, 9},
    {"_qtl2_scancoefSE_binary_addcovar", (DL_FUNC) &_qtl2_scancoefSE_binary_addcovar, 8},
    {"_qtl2_scancoefSE_binary_intcovar", (DL_FUNC) &_qtl2_scancoefSE_binary_intcovar, 9},
    {"_qtl2_scancoef_hk_addcovar", (DL_FUNC) &_qtl2_scancoef_hk_addcovar, 5},
    {"_qtl2_scancoef_hk_intcovar", (DL_FUNC) &_qtl2_scancoef_hk_intcovar, 6},
    {"_qtl2_scancoefSE_hk_addcovar", (DL_FUNC) &_qtl2_scancoefSE_hk_addcovar, 5},
    {"_qtl2_scancoefSE_hk_intcovar", (DL_FUNC) &_qtl2_scancoefSE_hk_intcovar, 6},
    {"_qtl2_scancoef_pg_addcovar", (DL_FUNC) &_qtl2_scancoef_pg_addcovar, 6},
    {"_qtl2_scancoef_pg_intcovar", (DL_FUNC) &_qtl2_scancoef_pg_intcovar, 7},
    {"_qtl2_scancoefSE_pg_addcovar", (DL_FUNC) &_qtl2_scancoefSE_pg_addcovar, 6},
    {"_qtl2_scancoefSE_pg_intcovar", (DL_FUNC) &_qtl2_scancoefSE_pg_intcovar, 7},
    {"_qtl2_calc_sdp", (DL_FUNC) &_qtl2_calc_sdp, 1},
    {"_qtl2_invert_sdp", (DL_FUNC) &_qtl2_invert_sdp, 2},
    {"_qtl2_alleleprob_to_snpprob", (DL_FUNC) &_qtl2_alleleprob_to_snpprob, 4},
    {"_qtl2_genocol_to_snpcol", (DL_FUNC) &_qtl2_genocol_to_snpcol, 2},
    {"_qtl2_genoprob_to_snpprob", (DL_FUNC) &_qtl2_genoprob_to_snpprob, 4},
    {"_qtl2_Xgenocol_to_snpcol", (DL_FUNC) &_qtl2_Xgenocol_to_snpcol, 2},
    {"_qtl2_Xgenoprob_to_snpprob", (DL_FUNC) &_qtl2_Xgenoprob_to_snpprob, 4},
    {"_qtl2_test_init", (DL_FUNC) &_qtl2_test_init, 5},
    {"_qtl2_test_emit", (DL_FUNC) &_qtl2_test_emit, 8},
    {"_qtl2_test_step", (DL_FUNC) &_qtl2_test_step, 7},
    {"_qtl2_test_check_geno", (DL_FUNC) &_qtl2_test_check_geno, 6},
    {"_qtl2_test_possible_gen", (DL_FUNC) &_qtl2_test_possible_gen, 4},
    {"_qtl2_test_ngen", (DL_FUNC) &_qtl2_test_ngen, 2},
    {"_qtl2_test_nrec", (DL_FUNC) &_qtl2_test_nrec, 6},
    {"_qtl2_test_founder_geno_values", (DL_FUNC) &_qtl2_test_founder_geno_values, 2},
    {"_qtl2_need_founder_geno", (DL_FUNC) &_qtl2_need_founder_geno, 1},
    {"_qtl2_check_founder_geno_size", (DL_FUNC) &_qtl2_check_founder_geno_size, 3},
    {"_qtl2_test_emitmatrix", (DL_FUNC) &_qtl2_test_emitmatrix, 7},
    {"_qtl2_test_stepmatrix", (DL_FUNC) &_qtl2_test_stepmatrix, 5},
    {"_qtl2_test_initvector", (DL_FUNC) &_qtl2_test_initvector, 4},
    {NULL, NULL, 0}
};

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