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

#include <Rcpp.h>

using namespace Rcpp;

// logRowSum
NumericVector logRowSum(const NumericMatrix& mat, int nthreads);
RcppExport SEXP normr_logRowSum(SEXP matSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type mat(matSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(logRowSum(mat, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// logSumVector
double logSumVector(const NumericVector& vec, int nthreads);
RcppExport SEXP normr_logSumVector(SEXP vecSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type vec(vecSEXP);
    Rcpp::traits::input_parameter< int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(logSumVector(vec, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// mapToOriginal
NumericVector mapToOriginal(const NumericVector& vec, const List& m2u);
RcppExport SEXP normr_mapToOriginal(SEXP vecSEXP, SEXP m2uSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type vec(vecSEXP);
    Rcpp::traits::input_parameter< const List& >::type m2u(m2uSEXP);
    rcpp_result_gen = Rcpp::wrap(mapToOriginal(vec, m2u));
    return rcpp_result_gen;
END_RCPP
}
// mapToUniqueWithMap
NumericVector mapToUniqueWithMap(const NumericVector& vec, const List& m2u);
RcppExport SEXP normr_mapToUniqueWithMap(SEXP vecSEXP, SEXP m2uSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericVector& >::type vec(vecSEXP);
    Rcpp::traits::input_parameter< const List& >::type m2u(m2uSEXP);
    rcpp_result_gen = Rcpp::wrap(mapToUniqueWithMap(vec, m2u));
    return rcpp_result_gen;
END_RCPP
}
// em
List em(const List& m2u_sub, const int models, const double eps, const bool verbose, const int nthreads);
RcppExport SEXP normr_em(SEXP m2u_subSEXP, SEXP modelsSEXP, SEXP epsSEXP, SEXP verboseSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type m2u_sub(m2u_subSEXP);
    Rcpp::traits::input_parameter< const int >::type models(modelsSEXP);
    Rcpp::traits::input_parameter< const double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< const bool >::type verbose(verboseSEXP);
    Rcpp::traits::input_parameter< const int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(em(m2u_sub, models, eps, verbose, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// computeEnrichmentWithMap
NumericVector computeEnrichmentWithMap(const NumericMatrix& lnPost, const List& m2u, const NumericVector& theta, const int fg, const int bg, const bool diffCall, const bool standardized, const int nthreads);
RcppExport SEXP normr_computeEnrichmentWithMap(SEXP lnPostSEXP, SEXP m2uSEXP, SEXP thetaSEXP, SEXP fgSEXP, SEXP bgSEXP, SEXP diffCallSEXP, SEXP standardizedSEXP, SEXP nthreadsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const NumericMatrix& >::type lnPost(lnPostSEXP);
    Rcpp::traits::input_parameter< const List& >::type m2u(m2uSEXP);
    Rcpp::traits::input_parameter< const NumericVector& >::type theta(thetaSEXP);
    Rcpp::traits::input_parameter< const int >::type fg(fgSEXP);
    Rcpp::traits::input_parameter< const int >::type bg(bgSEXP);
    Rcpp::traits::input_parameter< const bool >::type diffCall(diffCallSEXP);
    Rcpp::traits::input_parameter< const bool >::type standardized(standardizedSEXP);
    Rcpp::traits::input_parameter< const int >::type nthreads(nthreadsSEXP);
    rcpp_result_gen = Rcpp::wrap(computeEnrichmentWithMap(lnPost, m2u, theta, fg, bg, diffCall, standardized, nthreads));
    return rcpp_result_gen;
END_RCPP
}
// normr_core
List normr_core(const IntegerVector& r, const IntegerVector& s, const int models, const double eps, const int iterations, const double minPThresh, const int bgIdx, const bool diffCall, const bool verbose, const int nthreads, const String binFilter);
RcppExport SEXP normr_normr_core(SEXP rSEXP, SEXP sSEXP, SEXP modelsSEXP, SEXP epsSEXP, SEXP iterationsSEXP, SEXP minPThreshSEXP, SEXP bgIdxSEXP, SEXP diffCallSEXP, SEXP verboseSEXP, SEXP nthreadsSEXP, SEXP binFilterSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const IntegerVector& >::type r(rSEXP);
    Rcpp::traits::input_parameter< const IntegerVector& >::type s(sSEXP);
    Rcpp::traits::input_parameter< const int >::type models(modelsSEXP);
    Rcpp::traits::input_parameter< const double >::type eps(epsSEXP);
    Rcpp::traits::input_parameter< const int >::type iterations(iterationsSEXP);
    Rcpp::traits::input_parameter< const double >::type minPThresh(minPThreshSEXP);
    Rcpp::traits::input_parameter< const int >::type bgIdx(bgIdxSEXP);
    Rcpp::traits::input_parameter< const bool >::type diffCall(diffCallSEXP);
    Rcpp::traits::input_parameter< const bool >::type verbose(verboseSEXP);
    Rcpp::traits::input_parameter< const int >::type nthreads(nthreadsSEXP);
    Rcpp::traits::input_parameter< const String >::type binFilter(binFilterSEXP);
    rcpp_result_gen = Rcpp::wrap(normr_core(r, s, models, eps, iterations, minPThresh, bgIdx, diffCall, verbose, nthreads, binFilter));
    return rcpp_result_gen;
END_RCPP
}
