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

#include <Rcpp.h>

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>&  Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// partial_argsort
NumericVector partial_argsort(NumericVector x, int n_elements);
RcppExport SEXP _csdR_partial_argsort(SEXP xSEXP, SEXP n_elementsSEXP) {
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 n_elements(n_elementsSEXP);
    rcpp_result_gen = Rcpp::wrap(partial_argsort(x, n_elements));
    return rcpp_result_gen;
END_RCPP
}
// summarizeResults
DataFrame summarizeResults(List res_1, List res_2, int n_threads);
RcppExport SEXP _csdR_summarizeResults(SEXP res_1SEXP, SEXP res_2SEXP, SEXP n_threadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type res_1(res_1SEXP);
    Rcpp::traits::input_parameter< List >::type res_2(res_2SEXP);
    Rcpp::traits::input_parameter< int >::type n_threads(n_threadsSEXP);
    rcpp_result_gen = Rcpp::wrap(summarizeResults(res_1, res_2, n_threads));
    return rcpp_result_gen;
END_RCPP
}
// welford_update
SEXP welford_update(NumericVector mu, NumericVector var, NumericVector cor_matrix, int iteration, int n_threads);
RcppExport SEXP _csdR_welford_update(SEXP muSEXP, SEXP varSEXP, SEXP cor_matrixSEXP, SEXP iterationSEXP, SEXP n_threadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type mu(muSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type var(varSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type cor_matrix(cor_matrixSEXP);
    Rcpp::traits::input_parameter< int >::type iteration(iterationSEXP);
    Rcpp::traits::input_parameter< int >::type n_threads(n_threadsSEXP);
    rcpp_result_gen = Rcpp::wrap(welford_update(mu, var, cor_matrix, iteration, n_threads));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_csdR_partial_argsort", (DL_FUNC) &_csdR_partial_argsort, 2},
    {"_csdR_summarizeResults", (DL_FUNC) &_csdR_summarizeResults, 3},
    {"_csdR_welford_update", (DL_FUNC) &_csdR_welford_update, 5},
    {NULL, NULL, 0}
};

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