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

// aggregate_across_cells
SEXP aggregate_across_cells(SEXP x, Rcpp::IntegerVector groups, int num_groups, bool do_sum, bool do_detected, bool do_median, int num_threads);
RcppExport SEXP _scuttle_aggregate_across_cells(SEXP xSEXP, SEXP groupsSEXP, SEXP num_groupsSEXP, SEXP do_sumSEXP, SEXP do_detectedSEXP, SEXP do_medianSEXP, SEXP num_threadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type groups(groupsSEXP);
    Rcpp::traits::input_parameter< int >::type num_groups(num_groupsSEXP);
    Rcpp::traits::input_parameter< bool >::type do_sum(do_sumSEXP);
    Rcpp::traits::input_parameter< bool >::type do_detected(do_detectedSEXP);
    Rcpp::traits::input_parameter< bool >::type do_median(do_medianSEXP);
    Rcpp::traits::input_parameter< int >::type num_threads(num_threadsSEXP);
    rcpp_result_gen = Rcpp::wrap(aggregate_across_cells(x, groups, num_groups, do_sum, do_detected, do_median, num_threads));
    return rcpp_result_gen;
END_RCPP
}
// cumulative_prop
Rcpp::NumericMatrix cumulative_prop(Rcpp::RObject input, Rcpp::IntegerVector top);
RcppExport SEXP _scuttle_cumulative_prop(SEXP inputSEXP, SEXP topSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type input(inputSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type top(topSEXP);
    rcpp_result_gen = Rcpp::wrap(cumulative_prop(input, top));
    return rcpp_result_gen;
END_RCPP
}
// downsample_global
Rcpp::RObject downsample_global(Rcpp::RObject input, double prop_global, int num_threads, bool already_integer, bool output_sparse, bool output_integer);
RcppExport SEXP _scuttle_downsample_global(SEXP inputSEXP, SEXP prop_globalSEXP, SEXP num_threadsSEXP, SEXP already_integerSEXP, SEXP output_sparseSEXP, SEXP output_integerSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type input(inputSEXP);
    Rcpp::traits::input_parameter< double >::type prop_global(prop_globalSEXP);
    Rcpp::traits::input_parameter< int >::type num_threads(num_threadsSEXP);
    Rcpp::traits::input_parameter< bool >::type already_integer(already_integerSEXP);
    Rcpp::traits::input_parameter< bool >::type output_sparse(output_sparseSEXP);
    Rcpp::traits::input_parameter< bool >::type output_integer(output_integerSEXP);
    rcpp_result_gen = Rcpp::wrap(downsample_global(input, prop_global, num_threads, already_integer, output_sparse, output_integer));
    return rcpp_result_gen;
END_RCPP
}
// downsample_column
Rcpp::RObject downsample_column(Rcpp::RObject input, Rcpp::NumericVector prop_col, bool already_integer, bool output_sparse, bool output_integer);
RcppExport SEXP _scuttle_downsample_column(SEXP inputSEXP, SEXP prop_colSEXP, SEXP already_integerSEXP, SEXP output_sparseSEXP, SEXP output_integerSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type input(inputSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type prop_col(prop_colSEXP);
    Rcpp::traits::input_parameter< bool >::type already_integer(already_integerSEXP);
    Rcpp::traits::input_parameter< bool >::type output_sparse(output_sparseSEXP);
    Rcpp::traits::input_parameter< bool >::type output_integer(output_integerSEXP);
    rcpp_result_gen = Rcpp::wrap(downsample_column(input, prop_col, already_integer, output_sparse, output_integer));
    return rcpp_result_gen;
END_RCPP
}
// fit_linear_model
Rcpp::RObject fit_linear_model(Rcpp::NumericMatrix qr, Rcpp::NumericVector qraux, Rcpp::RObject exprs, bool get_coefs, int nthreads);
RcppExport SEXP _scuttle_fit_linear_model(SEXP qrSEXP, SEXP qrauxSEXP, SEXP exprsSEXP, SEXP get_coefsSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type qr(qrSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type qraux(qrauxSEXP);
    Rcpp::traits::input_parameter< Rcpp::RObject >::type exprs(exprsSEXP);
    Rcpp::traits::input_parameter< bool >::type get_coefs(get_coefsSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(fit_linear_model(qr, qraux, exprs, get_coefs, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// pool_size_factors
Rcpp::List pool_size_factors(Rcpp::RObject exprs, Rcpp::NumericVector pseudo_cell, Rcpp::IntegerVector order, Rcpp::IntegerVector pool_sizes);
RcppExport SEXP _scuttle_pool_size_factors(SEXP exprsSEXP, SEXP pseudo_cellSEXP, SEXP orderSEXP, SEXP pool_sizesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type exprs(exprsSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type pseudo_cell(pseudo_cellSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type order(orderSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type pool_sizes(pool_sizesSEXP);
    rcpp_result_gen = Rcpp::wrap(pool_size_factors(exprs, pseudo_cell, order, pool_sizes));
    return rcpp_result_gen;
END_RCPP
}
// set_executor
SEXP set_executor(SEXP ptr);
RcppExport SEXP _scuttle_set_executor(SEXP ptrSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< SEXP >::type ptr(ptrSEXP);
    rcpp_result_gen = Rcpp::wrap(set_executor(ptr));
    return rcpp_result_gen;
END_RCPP
}
// sum_row_counts
Rcpp::RObject sum_row_counts(Rcpp::RObject counts, Rcpp::IntegerVector genes, Rcpp::IntegerVector runs);
RcppExport SEXP _scuttle_sum_row_counts(SEXP countsSEXP, SEXP genesSEXP, SEXP runsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type counts(countsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type genes(genesSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type runs(runsSEXP);
    rcpp_result_gen = Rcpp::wrap(sum_row_counts(counts, genes, runs));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_scuttle_aggregate_across_cells", (DL_FUNC) &_scuttle_aggregate_across_cells, 7},
    {"_scuttle_cumulative_prop", (DL_FUNC) &_scuttle_cumulative_prop, 2},
    {"_scuttle_downsample_global", (DL_FUNC) &_scuttle_downsample_global, 6},
    {"_scuttle_downsample_column", (DL_FUNC) &_scuttle_downsample_column, 5},
    {"_scuttle_fit_linear_model", (DL_FUNC) &_scuttle_fit_linear_model, 5},
    {"_scuttle_pool_size_factors", (DL_FUNC) &_scuttle_pool_size_factors, 4},
    {"_scuttle_set_executor", (DL_FUNC) &_scuttle_set_executor, 1},
    {"_scuttle_sum_row_counts", (DL_FUNC) &_scuttle_sum_row_counts, 3},
    {NULL, NULL, 0}
};

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