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

// 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_column
Rcpp::RObject downsample_column(Rcpp::RObject input, Rcpp::NumericVector prop);
RcppExport SEXP _scuttle_downsample_column(SEXP inputSEXP, SEXP propSEXP) {
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(propSEXP);
    rcpp_result_gen = Rcpp::wrap(downsample_column(input, prop));
    return rcpp_result_gen;
END_RCPP
}
// downsample_matrix
Rcpp::RObject downsample_matrix(Rcpp::RObject rmat, double total, double required);
RcppExport SEXP _scuttle_downsample_matrix(SEXP rmatSEXP, SEXP totalSEXP, SEXP requiredSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::RObject >::type rmat(rmatSEXP);
    Rcpp::traits::input_parameter< double >::type total(totalSEXP);
    Rcpp::traits::input_parameter< double >::type required(requiredSEXP);
    rcpp_result_gen = Rcpp::wrap(downsample_matrix(rmat, total, required));
    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);
RcppExport SEXP _scuttle_fit_linear_model(SEXP qrSEXP, SEXP qrauxSEXP, SEXP exprsSEXP, SEXP get_coefsSEXP) {
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_result_gen = Rcpp::wrap(fit_linear_model(qr, qraux, exprs, get_coefs));
    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
}
// sparse_aggregate_sum
Rcpp::NumericMatrix sparse_aggregate_sum(Rcpp::NumericVector x, Rcpp::IntegerVector i, Rcpp::IntegerVector p, Rcpp::IntegerVector groupings, int ngroups, int nrows);
RcppExport SEXP _scuttle_sparse_aggregate_sum(SEXP xSEXP, SEXP iSEXP, SEXP pSEXP, SEXP groupingsSEXP, SEXP ngroupsSEXP, SEXP nrowsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type i(iSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type groupings(groupingsSEXP);
    Rcpp::traits::input_parameter< int >::type ngroups(ngroupsSEXP);
    Rcpp::traits::input_parameter< int >::type nrows(nrowsSEXP);
    rcpp_result_gen = Rcpp::wrap(sparse_aggregate_sum(x, i, p, groupings, ngroups, nrows));
    return rcpp_result_gen;
END_RCPP
}
// sparse_aggregate_detected
Rcpp::NumericMatrix sparse_aggregate_detected(Rcpp::NumericVector x, Rcpp::IntegerVector i, Rcpp::IntegerVector p, Rcpp::IntegerVector groupings, int ngroups, int nrows);
RcppExport SEXP _scuttle_sparse_aggregate_detected(SEXP xSEXP, SEXP iSEXP, SEXP pSEXP, SEXP groupingsSEXP, SEXP ngroupsSEXP, SEXP nrowsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type i(iSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type p(pSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type groupings(groupingsSEXP);
    Rcpp::traits::input_parameter< int >::type ngroups(ngroupsSEXP);
    Rcpp::traits::input_parameter< int >::type nrows(nrowsSEXP);
    rcpp_result_gen = Rcpp::wrap(sparse_aggregate_detected(x, i, p, groupings, ngroups, nrows));
    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_cumulative_prop", (DL_FUNC) &_scuttle_cumulative_prop, 2},
    {"_scuttle_downsample_column", (DL_FUNC) &_scuttle_downsample_column, 2},
    {"_scuttle_downsample_matrix", (DL_FUNC) &_scuttle_downsample_matrix, 3},
    {"_scuttle_fit_linear_model", (DL_FUNC) &_scuttle_fit_linear_model, 4},
    {"_scuttle_pool_size_factors", (DL_FUNC) &_scuttle_pool_size_factors, 4},
    {"_scuttle_sparse_aggregate_sum", (DL_FUNC) &_scuttle_sparse_aggregate_sum, 6},
    {"_scuttle_sparse_aggregate_detected", (DL_FUNC) &_scuttle_sparse_aggregate_detected, 6},
    {"_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);
}
