Skip to content

Commit

Permalink
got rid of testing functions, started on the R interface documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymugen committed Jan 14, 2020
1 parent 96d6187 commit 365df6a
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 392 deletions.
39 changes: 13 additions & 26 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

lpTestL <- function(yVec, iSigVec, repFac, lnFac, paramValues, d) {
.Call(`_MuGaMix_lpTestL`, yVec, iSigVec, repFac, lnFac, paramValues, d)
}

lpTestLI <- function(yVec, iSigVec, repFac, lnFac, paramValues, i, d, mar) {
.Call(`_MuGaMix_lpTestLI`, yVec, iSigVec, repFac, lnFac, paramValues, i, d, mar)
}

gradTestL <- function(yVec, iSigVec, repFac, lnFac, paramValues, d, idx) {
.Call(`_MuGaMix_gradTestL`, yVec, iSigVec, repFac, lnFac, paramValues, d, idx)
}

gradTestLI <- function(yVec, iSigVec, repFac, lnFac, paramValues, d, idx, mar) {
.Call(`_MuGaMix_gradTestLI`, yVec, iSigVec, repFac, lnFac, paramValues, d, idx, mar)
}

lpTestS <- function(yVec, iSigVec, repFac, lnFac, paramValues, d) {
.Call(`_MuGaMix_lpTestS`, yVec, iSigVec, repFac, lnFac, paramValues, d)
}

gradTestS <- function(yVec, iSigVec, repFac, lnFac, paramValues, d, idx) {
.Call(`_MuGaMix_gradTestS`, yVec, iSigVec, repFac, lnFac, paramValues, d, idx)
}

testLocSampler <- function(yVec, lnFac, Npop, d, Nadapt, Nsamp) {
.Call(`_MuGaMix_testLocSampler`, yVec, lnFac, Npop, d, Nadapt, Nsamp)
#' Run the sampler
#'
#' Runs the sampler on the data assuming no fixed effects or missing trait data and one replication level.
#'
#' @param yVec vectorized data matrix
#' @param lnFac factor relating data points to lines
#' @param Npop number of populations
#' @param Nadapt number of adaptation (burn-in) steps
#' @param Nsamp number of sampling steps
#' @param Nthin thinning number
#'
runSampler <- function(yVec, lnFac, Npop, Nadapt, Nsamp, Nthin) {
.Call(`_MuGaMix_runSampler`, yVec, lnFac, Npop, Nadapt, Nsamp, Nthin)
}

120 changes: 6 additions & 114 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,133 +5,25 @@

using namespace Rcpp;

// lpTestL
double lpTestL(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& d);
RcppExport SEXP _MuGaMix_lpTestL(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP dSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
rcpp_result_gen = Rcpp::wrap(lpTestL(yVec, iSigVec, repFac, lnFac, paramValues, d));
return rcpp_result_gen;
END_RCPP
}
// lpTestLI
Rcpp::List lpTestLI(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& i, const int32_t& d, const double& mar);
RcppExport SEXP _MuGaMix_lpTestLI(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP iSEXP, SEXP dSEXP, SEXP marSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type i(iSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
Rcpp::traits::input_parameter< const double& >::type mar(marSEXP);
rcpp_result_gen = Rcpp::wrap(lpTestLI(yVec, iSigVec, repFac, lnFac, paramValues, i, d, mar));
return rcpp_result_gen;
END_RCPP
}
// gradTestL
double gradTestL(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& d, const int32_t& idx);
RcppExport SEXP _MuGaMix_gradTestL(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP dSEXP, SEXP idxSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type idx(idxSEXP);
rcpp_result_gen = Rcpp::wrap(gradTestL(yVec, iSigVec, repFac, lnFac, paramValues, d, idx));
return rcpp_result_gen;
END_RCPP
}
// gradTestLI
Rcpp::List gradTestLI(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& d, const int32_t& idx, const double& mar);
RcppExport SEXP _MuGaMix_gradTestLI(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP dSEXP, SEXP idxSEXP, SEXP marSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type idx(idxSEXP);
Rcpp::traits::input_parameter< const double& >::type mar(marSEXP);
rcpp_result_gen = Rcpp::wrap(gradTestLI(yVec, iSigVec, repFac, lnFac, paramValues, d, idx, mar));
return rcpp_result_gen;
END_RCPP
}
// lpTestS
double lpTestS(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& d);
RcppExport SEXP _MuGaMix_lpTestS(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP dSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
rcpp_result_gen = Rcpp::wrap(lpTestS(yVec, iSigVec, repFac, lnFac, paramValues, d));
return rcpp_result_gen;
END_RCPP
}
// gradTestS
double gradTestS(const std::vector<double>& yVec, const std::vector<double>& iSigVec, const std::vector<int32_t>& repFac, const std::vector<int32_t>& lnFac, const std::vector<double>& paramValues, const int32_t& d, const int32_t& idx);
RcppExport SEXP _MuGaMix_gradTestS(SEXP yVecSEXP, SEXP iSigVecSEXP, SEXP repFacSEXP, SEXP lnFacSEXP, SEXP paramValuesSEXP, SEXP dSEXP, SEXP idxSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type iSigVec(iSigVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type repFac(repFacSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const std::vector<double>& >::type paramValues(paramValuesSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type idx(idxSEXP);
rcpp_result_gen = Rcpp::wrap(gradTestS(yVec, iSigVec, repFac, lnFac, paramValues, d, idx));
return rcpp_result_gen;
END_RCPP
}
// testLocSampler
Rcpp::List testLocSampler(const std::vector<double>& yVec, const std::vector<int32_t>& lnFac, const int32_t& Npop, const int32_t& d, const int32_t& Nadapt, const int32_t& Nsamp);
RcppExport SEXP _MuGaMix_testLocSampler(SEXP yVecSEXP, SEXP lnFacSEXP, SEXP NpopSEXP, SEXP dSEXP, SEXP NadaptSEXP, SEXP NsampSEXP) {
// runSampler
Rcpp::List runSampler(const std::vector<double>& yVec, const std::vector<int32_t>& lnFac, const int32_t& Npop, const int32_t& Nadapt, const int32_t& Nsamp, const int32_t& Nthin);
RcppExport SEXP _MuGaMix_runSampler(SEXP yVecSEXP, SEXP lnFacSEXP, SEXP NpopSEXP, SEXP NadaptSEXP, SEXP NsampSEXP, SEXP NthinSEXP) {
BEGIN_RCPP
Rcpp::RObject rcpp_result_gen;
Rcpp::RNGScope rcpp_rngScope_gen;
Rcpp::traits::input_parameter< const std::vector<double>& >::type yVec(yVecSEXP);
Rcpp::traits::input_parameter< const std::vector<int32_t>& >::type lnFac(lnFacSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type Npop(NpopSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type d(dSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type Nadapt(NadaptSEXP);
Rcpp::traits::input_parameter< const int32_t& >::type Nsamp(NsampSEXP);
rcpp_result_gen = Rcpp::wrap(testLocSampler(yVec, lnFac, Npop, d, Nadapt, Nsamp));
Rcpp::traits::input_parameter< const int32_t& >::type Nthin(NthinSEXP);
rcpp_result_gen = Rcpp::wrap(runSampler(yVec, lnFac, Npop, Nadapt, Nsamp, Nthin));
return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
{"_MuGaMix_lpTestL", (DL_FUNC) &_MuGaMix_lpTestL, 6},
{"_MuGaMix_lpTestLI", (DL_FUNC) &_MuGaMix_lpTestLI, 8},
{"_MuGaMix_gradTestL", (DL_FUNC) &_MuGaMix_gradTestL, 7},
{"_MuGaMix_gradTestLI", (DL_FUNC) &_MuGaMix_gradTestLI, 8},
{"_MuGaMix_lpTestS", (DL_FUNC) &_MuGaMix_lpTestS, 6},
{"_MuGaMix_gradTestS", (DL_FUNC) &_MuGaMix_gradTestS, 7},
{"_MuGaMix_testLocSampler", (DL_FUNC) &_MuGaMix_testLocSampler, 6},
{"_MuGaMix_runSampler", (DL_FUNC) &_MuGaMix_runSampler, 6},
{NULL, NULL, 0}
};

Expand Down
Loading

0 comments on commit 365df6a

Please sign in to comment.