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

#include <RcppArmadillo.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

// RVintrarandtestCpp
arma::vec RVintrarandtestCpp(const arma::mat& X, const arma::mat& Y, Rcpp::IntegerVector fac, const int nrepet);
RcppExport SEXP _ade4_RVintrarandtestCpp(SEXP XSEXP, SEXP YSEXP, SEXP facSEXP, SEXP nrepetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fac(facSEXP);
    Rcpp::traits::input_parameter< const int >::type nrepet(nrepetSEXP);
    rcpp_result_gen = Rcpp::wrap(RVintrarandtestCpp(X, Y, fac, nrepet));
    return rcpp_result_gen;
END_RCPP
}
// RVrandtestCpp
arma::vec RVrandtestCpp(const arma::mat& X, const arma::mat& Y, const int nrepet);
RcppExport SEXP _ade4_RVrandtestCpp(SEXP XSEXP, SEXP YSEXP, SEXP nrepetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const int >::type nrepet(nrepetSEXP);
    rcpp_result_gen = Rcpp::wrap(RVrandtestCpp(X, Y, nrepet));
    return rcpp_result_gen;
END_RCPP
}
// procusterandtestCpp
arma::vec procusterandtestCpp(const arma::mat& X, const arma::mat& Y, const int nrepet);
RcppExport SEXP _ade4_procusterandtestCpp(SEXP XSEXP, SEXP YSEXP, SEXP nrepetSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const int >::type nrepet(nrepetSEXP);
    rcpp_result_gen = Rcpp::wrap(procusterandtestCpp(X, Y, nrepet));
    return rcpp_result_gen;
END_RCPP
}
// betweenvarCpp
/*********************************************/ double betweenvarCpp(const arma::mat& tab, const arma::vec& pl, Rcpp::IntegerVector fac);
RcppExport SEXP _ade4_betweenvarCpp(SEXP tabSEXP, SEXP plSEXP, SEXP facSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type tab(tabSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fac(facSEXP);
    rcpp_result_gen = Rcpp::wrap(betweenvarCpp(tab, pl, fac));
    return rcpp_result_gen;
END_RCPP
}
// testdiscriminCpp
/*********************************************/ arma::vec testdiscriminCpp(const int npermut, const int rang, const arma::vec& pl, Rcpp::IntegerVector fac, const arma::mat& tab);
RcppExport SEXP _ade4_testdiscriminCpp(SEXP npermutSEXP, SEXP rangSEXP, SEXP plSEXP, SEXP facSEXP, SEXP tabSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< const int >::type rang(rangSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fac(facSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type tab(tabSEXP);
    rcpp_result_gen = Rcpp::wrap(testdiscriminCpp(npermut, rang, pl, fac, tab));
    return rcpp_result_gen;
END_RCPP
}
// testertraceCpp
/*****************/ arma::vec testertraceCpp(int npermut, const arma::vec& pc1, const arma::vec& pc2, arma::mat& X1, arma::mat& X2);
RcppExport SEXP _ade4_testertraceCpp(SEXP npermutSEXP, SEXP pc1SEXP, SEXP pc2SEXP, SEXP X1SEXP, SEXP X2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pc1(pc1SEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pc2(pc2SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type X1(X1SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type X2(X2SEXP);
    rcpp_result_gen = Rcpp::wrap(testertraceCpp(npermut, pc1, pc2, X1, X2));
    return rcpp_result_gen;
END_RCPP
}
// testertracenuCpp
/*****************/ arma::vec testertracenuCpp(int npermut, arma::vec& pc1, arma::vec& pc2, const arma::vec& pl, arma::mat& tab1, arma::mat& tab2, arma::mat& tabinit1, arma::mat& tabinit2, const int typ1, const int typ2);
RcppExport SEXP _ade4_testertracenuCpp(SEXP npermutSEXP, SEXP pc1SEXP, SEXP pc2SEXP, SEXP plSEXP, SEXP tab1SEXP, SEXP tab2SEXP, SEXP tabinit1SEXP, SEXP tabinit2SEXP, SEXP typ1SEXP, SEXP typ2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type pc1(pc1SEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type pc2(pc2SEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tab1(tab1SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tab2(tab2SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tabinit1(tabinit1SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tabinit2(tabinit2SEXP);
    Rcpp::traits::input_parameter< const int >::type typ1(typ1SEXP);
    Rcpp::traits::input_parameter< const int >::type typ2(typ2SEXP);
    rcpp_result_gen = Rcpp::wrap(testertracenuCpp(npermut, pc1, pc2, pl, tab1, tab2, tabinit1, tabinit2, typ1, typ2));
    return rcpp_result_gen;
END_RCPP
}
// testertracenubisCpp
/*****************/ arma::vec testertracenubisCpp(int npermut, arma::vec& pc1, arma::vec& pc2, const arma::vec& pl, arma::mat& tab1, arma::mat& tab2, arma::mat& tabinit1, arma::mat& tabinit2, const int typ1, const int typ2, const int ntab);
RcppExport SEXP _ade4_testertracenubisCpp(SEXP npermutSEXP, SEXP pc1SEXP, SEXP pc2SEXP, SEXP plSEXP, SEXP tab1SEXP, SEXP tab2SEXP, SEXP tabinit1SEXP, SEXP tabinit2SEXP, SEXP typ1SEXP, SEXP typ2SEXP, SEXP ntabSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type pc1(pc1SEXP);
    Rcpp::traits::input_parameter< arma::vec& >::type pc2(pc2SEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tab1(tab1SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tab2(tab2SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tabinit1(tabinit1SEXP);
    Rcpp::traits::input_parameter< arma::mat& >::type tabinit2(tabinit2SEXP);
    Rcpp::traits::input_parameter< const int >::type typ1(typ1SEXP);
    Rcpp::traits::input_parameter< const int >::type typ2(typ2SEXP);
    Rcpp::traits::input_parameter< const int >::type ntab(ntabSEXP);
    rcpp_result_gen = Rcpp::wrap(testertracenubisCpp(npermut, pc1, pc2, pl, tab1, tab2, tabinit1, tabinit2, typ1, typ2, ntab));
    return rcpp_result_gen;
END_RCPP
}
// inerbetweenCpp
/************************************/ double inerbetweenCpp(const arma::vec& pl, const arma::vec& pc, const int moda, Rcpp::IntegerVector indica, const arma::mat& tab);
RcppExport SEXP _ade4_inerbetweenCpp(SEXP plSEXP, SEXP pcSEXP, SEXP modaSEXP, SEXP indicaSEXP, SEXP tabSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pc(pcSEXP);
    Rcpp::traits::input_parameter< const int >::type moda(modaSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type indica(indicaSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type tab(tabSEXP);
    rcpp_result_gen = Rcpp::wrap(inerbetweenCpp(pl, pc, moda, indica, tab));
    return rcpp_result_gen;
END_RCPP
}
// testinterCpp
/************************************/ arma::vec testinterCpp(const int npermut, const arma::vec& pl, const arma::vec& pc, Rcpp::IntegerVector fac, const arma::mat& tab);
RcppExport SEXP _ade4_testinterCpp(SEXP npermutSEXP, SEXP plSEXP, SEXP pcSEXP, SEXP facSEXP, SEXP tabSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pl(plSEXP);
    Rcpp::traits::input_parameter< const arma::vec& >::type pc(pcSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type fac(facSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type tab(tabSEXP);
    rcpp_result_gen = Rcpp::wrap(testinterCpp(npermut, pl, pc, fac, tab));
    return rcpp_result_gen;
END_RCPP
}
// testmantelCpp
arma::vec testmantelCpp(const int npermut, const arma::mat& m1, const arma::mat& m2);
RcppExport SEXP _ade4_testmantelCpp(SEXP npermutSEXP, SEXP m1SEXP, SEXP m2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const int >::type npermut(npermutSEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type m1(m1SEXP);
    Rcpp::traits::input_parameter< const arma::mat& >::type m2(m2SEXP);
    rcpp_result_gen = Rcpp::wrap(testmantelCpp(npermut, m1, m2));
    return rcpp_result_gen;
END_RCPP
}
