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

// vector_mean
double vector_mean(const arma::vec& x, int min_value_count, std::string na_mode);
RcppExport SEXP _pairscale_vector_mean(SEXP xSEXP, SEXP min_value_countSEXP, SEXP na_modeSEXP) {
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 min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(vector_mean(x, min_value_count, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// vector_median
double vector_median(const arma::vec& x, int min_value_count, std::string na_mode);
RcppExport SEXP _pairscale_vector_median(SEXP xSEXP, SEXP min_value_countSEXP, SEXP na_modeSEXP) {
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 min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(vector_median(x, min_value_count, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// vector_trimmedmean
double vector_trimmedmean(const arma::vec& x, int min_value_count, double trim, std::string na_mode);
RcppExport SEXP _pairscale_vector_trimmedmean(SEXP xSEXP, SEXP min_value_countSEXP, SEXP trimSEXP, SEXP na_modeSEXP) {
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 min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type trim(trimSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(vector_trimmedmean(x, min_value_count, trim, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// vector_madmean
double vector_madmean(const arma::vec& x, int min_value_count, double threshold_std, std::string na_mode);
RcppExport SEXP _pairscale_vector_madmean(SEXP xSEXP, SEXP min_value_countSEXP, SEXP threshold_stdSEXP, SEXP na_modeSEXP) {
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 min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type threshold_std(threshold_stdSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(vector_madmean(x, min_value_count, threshold_std, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// vector_mode
double vector_mode(const arma::vec& x, int min_value_count, int n_bins, double adjust, double kernel_width_in_sd, std::string bandwidth_method, double mode_frac_maxdens, std::string na_mode);
RcppExport SEXP _pairscale_vector_mode(SEXP xSEXP, SEXP min_value_countSEXP, SEXP n_binsSEXP, SEXP adjustSEXP, SEXP kernel_width_in_sdSEXP, SEXP bandwidth_methodSEXP, SEXP mode_frac_maxdensSEXP, SEXP na_modeSEXP) {
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 min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< int >::type n_bins(n_binsSEXP);
    Rcpp::traits::input_parameter< double >::type adjust(adjustSEXP);
    Rcpp::traits::input_parameter< double >::type kernel_width_in_sd(kernel_width_in_sdSEXP);
    Rcpp::traits::input_parameter< std::string >::type bandwidth_method(bandwidth_methodSEXP);
    Rcpp::traits::input_parameter< double >::type mode_frac_maxdens(mode_frac_maxdensSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(vector_mode(x, min_value_count, n_bins, adjust, kernel_width_in_sd, bandwidth_method, mode_frac_maxdens, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairdiff_mean
arma::mat pairdiff_mean(const arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> cols, int min_value_count, std::string na_mode);
RcppExport SEXP _pairscale_pairdiff_mean(SEXP xSEXP, SEXP colsSEXP, SEXP min_value_countSEXP, SEXP na_modeSEXP) {
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< Rcpp::Nullable<Rcpp::IntegerVector> >::type cols(colsSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairdiff_mean(x, cols, min_value_count, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairdiff_median
arma::mat pairdiff_median(const arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> cols, int min_value_count, std::string na_mode);
RcppExport SEXP _pairscale_pairdiff_median(SEXP xSEXP, SEXP colsSEXP, SEXP min_value_countSEXP, SEXP na_modeSEXP) {
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< Rcpp::Nullable<Rcpp::IntegerVector> >::type cols(colsSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairdiff_median(x, cols, min_value_count, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairdiff_trimmedmean
arma::mat pairdiff_trimmedmean(const arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> cols, int min_value_count, double trim, std::string na_mode);
RcppExport SEXP _pairscale_pairdiff_trimmedmean(SEXP xSEXP, SEXP colsSEXP, SEXP min_value_countSEXP, SEXP trimSEXP, SEXP na_modeSEXP) {
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< Rcpp::Nullable<Rcpp::IntegerVector> >::type cols(colsSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type trim(trimSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairdiff_trimmedmean(x, cols, min_value_count, trim, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairdiff_madmean
arma::mat pairdiff_madmean(const arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> cols, int min_value_count, double threshold_std, std::string na_mode);
RcppExport SEXP _pairscale_pairdiff_madmean(SEXP xSEXP, SEXP colsSEXP, SEXP min_value_countSEXP, SEXP threshold_stdSEXP, SEXP na_modeSEXP) {
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< Rcpp::Nullable<Rcpp::IntegerVector> >::type cols(colsSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type threshold_std(threshold_stdSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairdiff_madmean(x, cols, min_value_count, threshold_std, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairdiff_mode
arma::mat pairdiff_mode(const arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> cols, int min_value_count, int n_bins, double adjust, double kernel_width_in_sd, std::string bandwidth_method, double mode_frac_maxdens, std::string na_mode);
RcppExport SEXP _pairscale_pairdiff_mode(SEXP xSEXP, SEXP colsSEXP, SEXP min_value_countSEXP, SEXP n_binsSEXP, SEXP adjustSEXP, SEXP kernel_width_in_sdSEXP, SEXP bandwidth_methodSEXP, SEXP mode_frac_maxdensSEXP, SEXP na_modeSEXP) {
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< Rcpp::Nullable<Rcpp::IntegerVector> >::type cols(colsSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< int >::type n_bins(n_binsSEXP);
    Rcpp::traits::input_parameter< double >::type adjust(adjustSEXP);
    Rcpp::traits::input_parameter< double >::type kernel_width_in_sd(kernel_width_in_sdSEXP);
    Rcpp::traits::input_parameter< std::string >::type bandwidth_method(bandwidth_methodSEXP);
    Rcpp::traits::input_parameter< double >::type mode_frac_maxdens(mode_frac_maxdensSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairdiff_mode(x, cols, min_value_count, n_bins, adjust, kernel_width_in_sd, bandwidth_method, mode_frac_maxdens, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairscale_mode
Rcpp::NumericVector pairscale_mode(arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> clusters, int min_value_count, int n_bins, double adjust, double kernel_width_in_sd, std::string bandwidth_method, double mode_frac_maxdens, int niter_irls, std::string na_mode);
RcppExport SEXP _pairscale_pairscale_mode(SEXP xSEXP, SEXP clustersSEXP, SEXP min_value_countSEXP, SEXP n_binsSEXP, SEXP adjustSEXP, SEXP kernel_width_in_sdSEXP, SEXP bandwidth_methodSEXP, SEXP mode_frac_maxdensSEXP, SEXP niter_irlsSEXP, SEXP na_modeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type clusters(clustersSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< int >::type n_bins(n_binsSEXP);
    Rcpp::traits::input_parameter< double >::type adjust(adjustSEXP);
    Rcpp::traits::input_parameter< double >::type kernel_width_in_sd(kernel_width_in_sdSEXP);
    Rcpp::traits::input_parameter< std::string >::type bandwidth_method(bandwidth_methodSEXP);
    Rcpp::traits::input_parameter< double >::type mode_frac_maxdens(mode_frac_maxdensSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairscale_mode(x, clusters, min_value_count, n_bins, adjust, kernel_width_in_sd, bandwidth_method, mode_frac_maxdens, niter_irls, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairscale_median
Rcpp::NumericVector pairscale_median(arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> clusters, int min_value_count, int niter_irls, std::string na_mode);
RcppExport SEXP _pairscale_pairscale_median(SEXP xSEXP, SEXP clustersSEXP, SEXP min_value_countSEXP, SEXP niter_irlsSEXP, SEXP na_modeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type clusters(clustersSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairscale_median(x, clusters, min_value_count, niter_irls, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairscale_mean
Rcpp::NumericVector pairscale_mean(arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> clusters, int min_value_count, int niter_irls, std::string na_mode);
RcppExport SEXP _pairscale_pairscale_mean(SEXP xSEXP, SEXP clustersSEXP, SEXP min_value_countSEXP, SEXP niter_irlsSEXP, SEXP na_modeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type clusters(clustersSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairscale_mean(x, clusters, min_value_count, niter_irls, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairscale_trimmedmean
Rcpp::NumericVector pairscale_trimmedmean(arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> clusters, int min_value_count, double trim, int niter_irls, std::string na_mode);
RcppExport SEXP _pairscale_pairscale_trimmedmean(SEXP xSEXP, SEXP clustersSEXP, SEXP min_value_countSEXP, SEXP trimSEXP, SEXP niter_irlsSEXP, SEXP na_modeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type clusters(clustersSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type trim(trimSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairscale_trimmedmean(x, clusters, min_value_count, trim, niter_irls, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// pairscale_madmean
Rcpp::NumericVector pairscale_madmean(arma::mat& x, Rcpp::Nullable<Rcpp::IntegerVector> clusters, int min_value_count, double threshold_std, int niter_irls, std::string na_mode);
RcppExport SEXP _pairscale_pairscale_madmean(SEXP xSEXP, SEXP clustersSEXP, SEXP min_value_countSEXP, SEXP threshold_stdSEXP, SEXP niter_irlsSEXP, SEXP na_modeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type clusters(clustersSEXP);
    Rcpp::traits::input_parameter< int >::type min_value_count(min_value_countSEXP);
    Rcpp::traits::input_parameter< double >::type threshold_std(threshold_stdSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    Rcpp::traits::input_parameter< std::string >::type na_mode(na_modeSEXP);
    rcpp_result_gen = Rcpp::wrap(pairscale_madmean(x, clusters, min_value_count, threshold_std, niter_irls, na_mode));
    return rcpp_result_gen;
END_RCPP
}
// solve_graph_laplacian
Rcpp::NumericVector solve_graph_laplacian(arma::mat M, int niter_irls);
RcppExport SEXP _pairscale_solve_graph_laplacian(SEXP MSEXP, SEXP niter_irlsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat >::type M(MSEXP);
    Rcpp::traits::input_parameter< int >::type niter_irls(niter_irlsSEXP);
    rcpp_result_gen = Rcpp::wrap(solve_graph_laplacian(M, niter_irls));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_pairscale_vector_mean", (DL_FUNC) &_pairscale_vector_mean, 3},
    {"_pairscale_vector_median", (DL_FUNC) &_pairscale_vector_median, 3},
    {"_pairscale_vector_trimmedmean", (DL_FUNC) &_pairscale_vector_trimmedmean, 4},
    {"_pairscale_vector_madmean", (DL_FUNC) &_pairscale_vector_madmean, 4},
    {"_pairscale_vector_mode", (DL_FUNC) &_pairscale_vector_mode, 8},
    {"_pairscale_pairdiff_mean", (DL_FUNC) &_pairscale_pairdiff_mean, 4},
    {"_pairscale_pairdiff_median", (DL_FUNC) &_pairscale_pairdiff_median, 4},
    {"_pairscale_pairdiff_trimmedmean", (DL_FUNC) &_pairscale_pairdiff_trimmedmean, 5},
    {"_pairscale_pairdiff_madmean", (DL_FUNC) &_pairscale_pairdiff_madmean, 5},
    {"_pairscale_pairdiff_mode", (DL_FUNC) &_pairscale_pairdiff_mode, 9},
    {"_pairscale_pairscale_mode", (DL_FUNC) &_pairscale_pairscale_mode, 10},
    {"_pairscale_pairscale_median", (DL_FUNC) &_pairscale_pairscale_median, 5},
    {"_pairscale_pairscale_mean", (DL_FUNC) &_pairscale_pairscale_mean, 5},
    {"_pairscale_pairscale_trimmedmean", (DL_FUNC) &_pairscale_pairscale_trimmedmean, 6},
    {"_pairscale_pairscale_madmean", (DL_FUNC) &_pairscale_pairscale_madmean, 6},
    {"_pairscale_solve_graph_laplacian", (DL_FUNC) &_pairscale_solve_graph_laplacian, 2},
    {NULL, NULL, 0}
};

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