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

// surrogate_iaaft_cpp
arma::mat surrogate_iaaft_cpp(const arma::vec& x, int n_surr, int max_iter);
RcppExport SEXP _xiacf_surrogate_iaaft_cpp(SEXP xSEXP, SEXP n_surrSEXP, SEXP max_iterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type n_surr(n_surrSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    rcpp_result_gen = Rcpp::wrap(surrogate_iaaft_cpp(x, n_surr, max_iter));
    return rcpp_result_gen;
END_RCPP
}
// surrogate_miaaft_cpp
arma::cube surrogate_miaaft_cpp(const arma::mat& X, int n_surr, int max_iter);
RcppExport SEXP _xiacf_surrogate_miaaft_cpp(SEXP XSEXP, SEXP n_surrSEXP, SEXP max_iterSEXP) {
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< int >::type n_surr(n_surrSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    rcpp_result_gen = Rcpp::wrap(surrogate_miaaft_cpp(X, n_surr, max_iter));
    return rcpp_result_gen;
END_RCPP
}
// compute_xi_acf_maxstat_cpp
List compute_xi_acf_maxstat_cpp(NumericVector x, int max_lag, int n_surr, int max_iter);
RcppExport SEXP _xiacf_compute_xi_acf_maxstat_cpp(SEXP xSEXP, SEXP max_lagSEXP, SEXP n_surrSEXP, SEXP max_iterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type max_lag(max_lagSEXP);
    Rcpp::traits::input_parameter< int >::type n_surr(n_surrSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_xi_acf_maxstat_cpp(x, max_lag, n_surr, max_iter));
    return rcpp_result_gen;
END_RCPP
}
// compute_xi_ccf_maxstat_cpp
List compute_xi_ccf_maxstat_cpp(NumericVector x, NumericVector y, int max_lag, int n_surr, int max_iter, bool both_directions);
RcppExport SEXP _xiacf_compute_xi_ccf_maxstat_cpp(SEXP xSEXP, SEXP ySEXP, SEXP max_lagSEXP, SEXP n_surrSEXP, SEXP max_iterSEXP, SEXP both_directionsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type y(ySEXP);
    Rcpp::traits::input_parameter< int >::type max_lag(max_lagSEXP);
    Rcpp::traits::input_parameter< int >::type n_surr(n_surrSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    Rcpp::traits::input_parameter< bool >::type both_directions(both_directionsSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_xi_ccf_maxstat_cpp(x, y, max_lag, n_surr, max_iter, both_directions));
    return rcpp_result_gen;
END_RCPP
}
// compute_xi_matrix_maxstat_cpp
List compute_xi_matrix_maxstat_cpp(const arma::mat& X, int max_lag, int n_surr, int max_iter);
RcppExport SEXP _xiacf_compute_xi_matrix_maxstat_cpp(SEXP XSEXP, SEXP max_lagSEXP, SEXP n_surrSEXP, SEXP max_iterSEXP) {
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< int >::type max_lag(max_lagSEXP);
    Rcpp::traits::input_parameter< int >::type n_surr(n_surrSEXP);
    Rcpp::traits::input_parameter< int >::type max_iter(max_iterSEXP);
    rcpp_result_gen = Rcpp::wrap(compute_xi_matrix_maxstat_cpp(X, max_lag, n_surr, max_iter));
    return rcpp_result_gen;
END_RCPP
}
// xi_coefficient_export
double xi_coefficient_export(NumericVector x, NumericVector y);
RcppExport SEXP _xiacf_xi_coefficient_export(SEXP xSEXP, SEXP ySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type y(ySEXP);
    rcpp_result_gen = Rcpp::wrap(xi_coefficient_export(x, y));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_xiacf_surrogate_iaaft_cpp", (DL_FUNC) &_xiacf_surrogate_iaaft_cpp, 3},
    {"_xiacf_surrogate_miaaft_cpp", (DL_FUNC) &_xiacf_surrogate_miaaft_cpp, 3},
    {"_xiacf_compute_xi_acf_maxstat_cpp", (DL_FUNC) &_xiacf_compute_xi_acf_maxstat_cpp, 4},
    {"_xiacf_compute_xi_ccf_maxstat_cpp", (DL_FUNC) &_xiacf_compute_xi_ccf_maxstat_cpp, 6},
    {"_xiacf_compute_xi_matrix_maxstat_cpp", (DL_FUNC) &_xiacf_compute_xi_matrix_maxstat_cpp, 4},
    {"_xiacf_xi_coefficient_export", (DL_FUNC) &_xiacf_xi_coefficient_export, 2},
    {NULL, NULL, 0}
};

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