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

// pfj
Rcpp::List pfj(const DataFrame& data, const DataFrame& stageframe, const int noyears, int firstyear, const int popidcol, const int patchidcol, const int individcol, const int blocksize, arma::ivec xcol, arma::ivec ycol, arma::ivec juvcol, arma::ivec sizeacol, arma::ivec sizebcol, arma::ivec sizeccol, arma::ivec repstracol, arma::ivec repstrbcol, arma::ivec fecacol, arma::ivec fecbcol, arma::ivec indcovacol, arma::ivec indcovbcol, arma::ivec indcovccol, arma::ivec aliveacol, arma::ivec deadacol, arma::ivec obsacol, arma::ivec nonobsacol, arma::ivec censorcol, arma::ivec stagecol, double repstrrel, double fecrel, bool NAas0, bool NRasRep, bool RepasObs, bool NOasObs, bool stassign, int stszcol, double censorkeep, bool censbool, bool censrepeat, bool coordsrepeat, bool retain_alive0, bool reduce, bool quiet);
RcppExport SEXP _lefko3_pfj(SEXP dataSEXP, SEXP stageframeSEXP, SEXP noyearsSEXP, SEXP firstyearSEXP, SEXP popidcolSEXP, SEXP patchidcolSEXP, SEXP individcolSEXP, SEXP blocksizeSEXP, SEXP xcolSEXP, SEXP ycolSEXP, SEXP juvcolSEXP, SEXP sizeacolSEXP, SEXP sizebcolSEXP, SEXP sizeccolSEXP, SEXP repstracolSEXP, SEXP repstrbcolSEXP, SEXP fecacolSEXP, SEXP fecbcolSEXP, SEXP indcovacolSEXP, SEXP indcovbcolSEXP, SEXP indcovccolSEXP, SEXP aliveacolSEXP, SEXP deadacolSEXP, SEXP obsacolSEXP, SEXP nonobsacolSEXP, SEXP censorcolSEXP, SEXP stagecolSEXP, SEXP repstrrelSEXP, SEXP fecrelSEXP, SEXP NAas0SEXP, SEXP NRasRepSEXP, SEXP RepasObsSEXP, SEXP NOasObsSEXP, SEXP stassignSEXP, SEXP stszcolSEXP, SEXP censorkeepSEXP, SEXP censboolSEXP, SEXP censrepeatSEXP, SEXP coordsrepeatSEXP, SEXP retain_alive0SEXP, SEXP reduceSEXP, SEXP quietSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const DataFrame& >::type data(dataSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< const int >::type noyears(noyearsSEXP);
    Rcpp::traits::input_parameter< int >::type firstyear(firstyearSEXP);
    Rcpp::traits::input_parameter< const int >::type popidcol(popidcolSEXP);
    Rcpp::traits::input_parameter< const int >::type patchidcol(patchidcolSEXP);
    Rcpp::traits::input_parameter< const int >::type individcol(individcolSEXP);
    Rcpp::traits::input_parameter< const int >::type blocksize(blocksizeSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type xcol(xcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type ycol(ycolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type juvcol(juvcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type sizeacol(sizeacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type sizebcol(sizebcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type sizeccol(sizeccolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type repstracol(repstracolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type repstrbcol(repstrbcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type fecacol(fecacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type fecbcol(fecbcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type indcovacol(indcovacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type indcovbcol(indcovbcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type indcovccol(indcovccolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type aliveacol(aliveacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type deadacol(deadacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type obsacol(obsacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type nonobsacol(nonobsacolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type censorcol(censorcolSEXP);
    Rcpp::traits::input_parameter< arma::ivec >::type stagecol(stagecolSEXP);
    Rcpp::traits::input_parameter< double >::type repstrrel(repstrrelSEXP);
    Rcpp::traits::input_parameter< double >::type fecrel(fecrelSEXP);
    Rcpp::traits::input_parameter< bool >::type NAas0(NAas0SEXP);
    Rcpp::traits::input_parameter< bool >::type NRasRep(NRasRepSEXP);
    Rcpp::traits::input_parameter< bool >::type RepasObs(RepasObsSEXP);
    Rcpp::traits::input_parameter< bool >::type NOasObs(NOasObsSEXP);
    Rcpp::traits::input_parameter< bool >::type stassign(stassignSEXP);
    Rcpp::traits::input_parameter< int >::type stszcol(stszcolSEXP);
    Rcpp::traits::input_parameter< double >::type censorkeep(censorkeepSEXP);
    Rcpp::traits::input_parameter< bool >::type censbool(censboolSEXP);
    Rcpp::traits::input_parameter< bool >::type censrepeat(censrepeatSEXP);
    Rcpp::traits::input_parameter< bool >::type coordsrepeat(coordsrepeatSEXP);
    Rcpp::traits::input_parameter< bool >::type retain_alive0(retain_alive0SEXP);
    Rcpp::traits::input_parameter< bool >::type reduce(reduceSEXP);
    Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP);
    rcpp_result_gen = Rcpp::wrap(pfj(data, stageframe, noyears, firstyear, popidcol, patchidcol, individcol, blocksize, xcol, ycol, juvcol, sizeacol, sizebcol, sizeccol, repstracol, repstrbcol, fecacol, fecbcol, indcovacol, indcovbcol, indcovccol, aliveacol, deadacol, obsacol, nonobsacol, censorcol, stagecol, repstrrel, fecrel, NAas0, NRasRep, RepasObs, NOasObs, stassign, stszcol, censorkeep, censbool, censrepeat, coordsrepeat, retain_alive0, reduce, quiet));
    return rcpp_result_gen;
END_RCPP
}
// jpf
Rcpp::List jpf(const DataFrame& data, const DataFrame& stageframe, int popidcol, int patchidcol, int individcol, int year2col, int year3col, int xcol, int ycol, int juv2col, int juv3col, int sizea2col, int sizea3col, int sizeb2col, int sizeb3col, int sizec2col, int sizec3col, int repstra2col, int repstra3col, int repstrb2col, int repstrb3col, int feca2col, int feca3col, int fecb2col, int fecb3col, int indcova2col, int indcova3col, int indcovb2col, int indcovb3col, int indcovc2col, int indcovc3col, int alive2col, int alive3col, int dead2col, int dead3col, int obs2col, int obs3col, int nonobs2col, int nonobs3col, double repstrrel, double fecrel, int stage2col, int stage3col, int censorcol, bool NAas0, bool NRasRep, bool NOasObs, bool stassign, int stszcol, double censorkeep, bool censbool, bool retain_alive0, const bool reduce, bool quiet);
RcppExport SEXP _lefko3_jpf(SEXP dataSEXP, SEXP stageframeSEXP, SEXP popidcolSEXP, SEXP patchidcolSEXP, SEXP individcolSEXP, SEXP year2colSEXP, SEXP year3colSEXP, SEXP xcolSEXP, SEXP ycolSEXP, SEXP juv2colSEXP, SEXP juv3colSEXP, SEXP sizea2colSEXP, SEXP sizea3colSEXP, SEXP sizeb2colSEXP, SEXP sizeb3colSEXP, SEXP sizec2colSEXP, SEXP sizec3colSEXP, SEXP repstra2colSEXP, SEXP repstra3colSEXP, SEXP repstrb2colSEXP, SEXP repstrb3colSEXP, SEXP feca2colSEXP, SEXP feca3colSEXP, SEXP fecb2colSEXP, SEXP fecb3colSEXP, SEXP indcova2colSEXP, SEXP indcova3colSEXP, SEXP indcovb2colSEXP, SEXP indcovb3colSEXP, SEXP indcovc2colSEXP, SEXP indcovc3colSEXP, SEXP alive2colSEXP, SEXP alive3colSEXP, SEXP dead2colSEXP, SEXP dead3colSEXP, SEXP obs2colSEXP, SEXP obs3colSEXP, SEXP nonobs2colSEXP, SEXP nonobs3colSEXP, SEXP repstrrelSEXP, SEXP fecrelSEXP, SEXP stage2colSEXP, SEXP stage3colSEXP, SEXP censorcolSEXP, SEXP NAas0SEXP, SEXP NRasRepSEXP, SEXP NOasObsSEXP, SEXP stassignSEXP, SEXP stszcolSEXP, SEXP censorkeepSEXP, SEXP censboolSEXP, SEXP retain_alive0SEXP, SEXP reduceSEXP, SEXP quietSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const DataFrame& >::type data(dataSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< int >::type popidcol(popidcolSEXP);
    Rcpp::traits::input_parameter< int >::type patchidcol(patchidcolSEXP);
    Rcpp::traits::input_parameter< int >::type individcol(individcolSEXP);
    Rcpp::traits::input_parameter< int >::type year2col(year2colSEXP);
    Rcpp::traits::input_parameter< int >::type year3col(year3colSEXP);
    Rcpp::traits::input_parameter< int >::type xcol(xcolSEXP);
    Rcpp::traits::input_parameter< int >::type ycol(ycolSEXP);
    Rcpp::traits::input_parameter< int >::type juv2col(juv2colSEXP);
    Rcpp::traits::input_parameter< int >::type juv3col(juv3colSEXP);
    Rcpp::traits::input_parameter< int >::type sizea2col(sizea2colSEXP);
    Rcpp::traits::input_parameter< int >::type sizea3col(sizea3colSEXP);
    Rcpp::traits::input_parameter< int >::type sizeb2col(sizeb2colSEXP);
    Rcpp::traits::input_parameter< int >::type sizeb3col(sizeb3colSEXP);
    Rcpp::traits::input_parameter< int >::type sizec2col(sizec2colSEXP);
    Rcpp::traits::input_parameter< int >::type sizec3col(sizec3colSEXP);
    Rcpp::traits::input_parameter< int >::type repstra2col(repstra2colSEXP);
    Rcpp::traits::input_parameter< int >::type repstra3col(repstra3colSEXP);
    Rcpp::traits::input_parameter< int >::type repstrb2col(repstrb2colSEXP);
    Rcpp::traits::input_parameter< int >::type repstrb3col(repstrb3colSEXP);
    Rcpp::traits::input_parameter< int >::type feca2col(feca2colSEXP);
    Rcpp::traits::input_parameter< int >::type feca3col(feca3colSEXP);
    Rcpp::traits::input_parameter< int >::type fecb2col(fecb2colSEXP);
    Rcpp::traits::input_parameter< int >::type fecb3col(fecb3colSEXP);
    Rcpp::traits::input_parameter< int >::type indcova2col(indcova2colSEXP);
    Rcpp::traits::input_parameter< int >::type indcova3col(indcova3colSEXP);
    Rcpp::traits::input_parameter< int >::type indcovb2col(indcovb2colSEXP);
    Rcpp::traits::input_parameter< int >::type indcovb3col(indcovb3colSEXP);
    Rcpp::traits::input_parameter< int >::type indcovc2col(indcovc2colSEXP);
    Rcpp::traits::input_parameter< int >::type indcovc3col(indcovc3colSEXP);
    Rcpp::traits::input_parameter< int >::type alive2col(alive2colSEXP);
    Rcpp::traits::input_parameter< int >::type alive3col(alive3colSEXP);
    Rcpp::traits::input_parameter< int >::type dead2col(dead2colSEXP);
    Rcpp::traits::input_parameter< int >::type dead3col(dead3colSEXP);
    Rcpp::traits::input_parameter< int >::type obs2col(obs2colSEXP);
    Rcpp::traits::input_parameter< int >::type obs3col(obs3colSEXP);
    Rcpp::traits::input_parameter< int >::type nonobs2col(nonobs2colSEXP);
    Rcpp::traits::input_parameter< int >::type nonobs3col(nonobs3colSEXP);
    Rcpp::traits::input_parameter< double >::type repstrrel(repstrrelSEXP);
    Rcpp::traits::input_parameter< double >::type fecrel(fecrelSEXP);
    Rcpp::traits::input_parameter< int >::type stage2col(stage2colSEXP);
    Rcpp::traits::input_parameter< int >::type stage3col(stage3colSEXP);
    Rcpp::traits::input_parameter< int >::type censorcol(censorcolSEXP);
    Rcpp::traits::input_parameter< bool >::type NAas0(NAas0SEXP);
    Rcpp::traits::input_parameter< bool >::type NRasRep(NRasRepSEXP);
    Rcpp::traits::input_parameter< bool >::type NOasObs(NOasObsSEXP);
    Rcpp::traits::input_parameter< bool >::type stassign(stassignSEXP);
    Rcpp::traits::input_parameter< int >::type stszcol(stszcolSEXP);
    Rcpp::traits::input_parameter< double >::type censorkeep(censorkeepSEXP);
    Rcpp::traits::input_parameter< bool >::type censbool(censboolSEXP);
    Rcpp::traits::input_parameter< bool >::type retain_alive0(retain_alive0SEXP);
    Rcpp::traits::input_parameter< const bool >::type reduce(reduceSEXP);
    Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP);
    rcpp_result_gen = Rcpp::wrap(jpf(data, stageframe, popidcol, patchidcol, individcol, year2col, year3col, xcol, ycol, juv2col, juv3col, sizea2col, sizea3col, sizeb2col, sizeb3col, sizec2col, sizec3col, repstra2col, repstra3col, repstrb2col, repstrb3col, feca2col, feca3col, fecb2col, fecb3col, indcova2col, indcova3col, indcovb2col, indcovb3col, indcovc2col, indcovc3col, alive2col, alive3col, dead2col, dead3col, obs2col, obs3col, nonobs2col, nonobs3col, repstrrel, fecrel, stage2col, stage3col, censorcol, NAas0, NRasRep, NOasObs, stassign, stszcol, censorkeep, censbool, retain_alive0, reduce, quiet));
    return rcpp_result_gen;
END_RCPP
}
// density3
Rcpp::NumericVector density3(Rcpp::DataFrame data, int xcol, int ycol, int yearcol, double spacing);
RcppExport SEXP _lefko3_density3(SEXP dataSEXP, SEXP xcolSEXP, SEXP ycolSEXP, SEXP yearcolSEXP, SEXP spacingSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type data(dataSEXP);
    Rcpp::traits::input_parameter< int >::type xcol(xcolSEXP);
    Rcpp::traits::input_parameter< int >::type ycol(ycolSEXP);
    Rcpp::traits::input_parameter< int >::type yearcol(yearcolSEXP);
    Rcpp::traits::input_parameter< double >::type spacing(spacingSEXP);
    rcpp_result_gen = Rcpp::wrap(density3(data, xcol, ycol, yearcol, spacing));
    return rcpp_result_gen;
END_RCPP
}
// bootstrap3
Rcpp::List bootstrap3(RObject data, Nullable<RObject> by_pop, Nullable<RObject> by_patch, Nullable<RObject> by_indiv, Nullable<RObject> prop_size, Nullable<RObject> max_limit, Nullable<RObject> reps, Nullable<RObject> popcol, Nullable<RObject> patchcol, Nullable<RObject> indivcol, Nullable<RObject> rename);
RcppExport SEXP _lefko3_bootstrap3(SEXP dataSEXP, SEXP by_popSEXP, SEXP by_patchSEXP, SEXP by_indivSEXP, SEXP prop_sizeSEXP, SEXP max_limitSEXP, SEXP repsSEXP, SEXP popcolSEXP, SEXP patchcolSEXP, SEXP indivcolSEXP, SEXP renameSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type data(dataSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type by_pop(by_popSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type by_patch(by_patchSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type by_indiv(by_indivSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type prop_size(prop_sizeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type max_limit(max_limitSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type reps(repsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type popcol(popcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type patchcol(patchcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type indivcol(indivcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type rename(renameSEXP);
    rcpp_result_gen = Rcpp::wrap(bootstrap3(data, by_pop, by_patch, by_indiv, prop_size, max_limit, reps, popcol, patchcol, indivcol, rename));
    return rcpp_result_gen;
END_RCPP
}
// hoffmannofstuttgart
Rcpp::List hoffmannofstuttgart(arma::mat& mainmat, DataFrame indices, int ahstages, StringVector stagenames);
RcppExport SEXP _lefko3_hoffmannofstuttgart(SEXP mainmatSEXP, SEXP indicesSEXP, SEXP ahstagesSEXP, SEXP stagenamesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::mat& >::type mainmat(mainmatSEXP);
    Rcpp::traits::input_parameter< DataFrame >::type indices(indicesSEXP);
    Rcpp::traits::input_parameter< int >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< StringVector >::type stagenames(stagenamesSEXP);
    rcpp_result_gen = Rcpp::wrap(hoffmannofstuttgart(mainmat, indices, ahstages, stagenames));
    return rcpp_result_gen;
END_RCPP
}
// hoffmannofstuttgart_sp
Rcpp::List hoffmannofstuttgart_sp(arma::sp_mat& mainmat, DataFrame indices, int ahstages, StringVector stagenames);
RcppExport SEXP _lefko3_hoffmannofstuttgart_sp(SEXP mainmatSEXP, SEXP indicesSEXP, SEXP ahstagesSEXP, SEXP stagenamesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< arma::sp_mat& >::type mainmat(mainmatSEXP);
    Rcpp::traits::input_parameter< DataFrame >::type indices(indicesSEXP);
    Rcpp::traits::input_parameter< int >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< StringVector >::type stagenames(stagenamesSEXP);
    rcpp_result_gen = Rcpp::wrap(hoffmannofstuttgart_sp(mainmat, indices, ahstages, stagenames));
    return rcpp_result_gen;
END_RCPP
}
// cond_hmpm
Rcpp::List cond_hmpm(List hmpm, Nullable<CharacterVector> matchoice, Nullable<LogicalVector> err_check);
RcppExport SEXP _lefko3_cond_hmpm(SEXP hmpmSEXP, SEXP matchoiceSEXP, SEXP err_checkSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type hmpm(hmpmSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type matchoice(matchoiceSEXP);
    Rcpp::traits::input_parameter< Nullable<LogicalVector> >::type err_check(err_checkSEXP);
    rcpp_result_gen = Rcpp::wrap(cond_hmpm(hmpm, matchoice, err_check));
    return rcpp_result_gen;
END_RCPP
}
// cond_diff
Rcpp::List cond_diff(List lDiff, int ref, Nullable<CharacterVector> matchoice, Nullable<LogicalVector> err_check);
RcppExport SEXP _lefko3_cond_diff(SEXP lDiffSEXP, SEXP refSEXP, SEXP matchoiceSEXP, SEXP err_checkSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lDiff(lDiffSEXP);
    Rcpp::traits::input_parameter< int >::type ref(refSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type matchoice(matchoiceSEXP);
    Rcpp::traits::input_parameter< Nullable<LogicalVector> >::type err_check(err_checkSEXP);
    rcpp_result_gen = Rcpp::wrap(cond_diff(lDiff, ref, matchoice, err_check));
    return rcpp_result_gen;
END_RCPP
}
// ricker3
Rcpp::NumericVector ricker3(double start_value, double alpha, double beta, int time_steps, int time_lag, bool pre0_subs, double pre0_value, int substoch, Nullable<NumericVector> separate_N);
RcppExport SEXP _lefko3_ricker3(SEXP start_valueSEXP, SEXP alphaSEXP, SEXP betaSEXP, SEXP time_stepsSEXP, SEXP time_lagSEXP, SEXP pre0_subsSEXP, SEXP pre0_valueSEXP, SEXP substochSEXP, SEXP separate_NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type start_value(start_valueSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< double >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< int >::type time_steps(time_stepsSEXP);
    Rcpp::traits::input_parameter< int >::type time_lag(time_lagSEXP);
    Rcpp::traits::input_parameter< bool >::type pre0_subs(pre0_subsSEXP);
    Rcpp::traits::input_parameter< double >::type pre0_value(pre0_valueSEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type separate_N(separate_NSEXP);
    rcpp_result_gen = Rcpp::wrap(ricker3(start_value, alpha, beta, time_steps, time_lag, pre0_subs, pre0_value, substoch, separate_N));
    return rcpp_result_gen;
END_RCPP
}
// beverton3
Rcpp::NumericVector beverton3(double start_value, double alpha, double beta, int time_steps, int time_lag, bool pre0_subs, double pre0_value, int substoch, Nullable<NumericVector> separate_N);
RcppExport SEXP _lefko3_beverton3(SEXP start_valueSEXP, SEXP alphaSEXP, SEXP betaSEXP, SEXP time_stepsSEXP, SEXP time_lagSEXP, SEXP pre0_subsSEXP, SEXP pre0_valueSEXP, SEXP substochSEXP, SEXP separate_NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type start_value(start_valueSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< double >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< int >::type time_steps(time_stepsSEXP);
    Rcpp::traits::input_parameter< int >::type time_lag(time_lagSEXP);
    Rcpp::traits::input_parameter< bool >::type pre0_subs(pre0_subsSEXP);
    Rcpp::traits::input_parameter< double >::type pre0_value(pre0_valueSEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type separate_N(separate_NSEXP);
    rcpp_result_gen = Rcpp::wrap(beverton3(start_value, alpha, beta, time_steps, time_lag, pre0_subs, pre0_value, substoch, separate_N));
    return rcpp_result_gen;
END_RCPP
}
// usher3
Rcpp::NumericVector usher3(double start_value, double alpha, double beta, int time_steps, int time_lag, bool pre0_subs, double pre0_value, int substoch, Nullable<NumericVector> separate_N);
RcppExport SEXP _lefko3_usher3(SEXP start_valueSEXP, SEXP alphaSEXP, SEXP betaSEXP, SEXP time_stepsSEXP, SEXP time_lagSEXP, SEXP pre0_subsSEXP, SEXP pre0_valueSEXP, SEXP substochSEXP, SEXP separate_NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type start_value(start_valueSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< double >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< int >::type time_steps(time_stepsSEXP);
    Rcpp::traits::input_parameter< int >::type time_lag(time_lagSEXP);
    Rcpp::traits::input_parameter< bool >::type pre0_subs(pre0_subsSEXP);
    Rcpp::traits::input_parameter< double >::type pre0_value(pre0_valueSEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type separate_N(separate_NSEXP);
    rcpp_result_gen = Rcpp::wrap(usher3(start_value, alpha, beta, time_steps, time_lag, pre0_subs, pre0_value, substoch, separate_N));
    return rcpp_result_gen;
END_RCPP
}
// logistic3
Rcpp::NumericVector logistic3(double start_value, double alpha, double beta, double lambda, int time_steps, int time_lag, bool pre0_subs, double pre0_value, int substoch, Nullable<NumericVector> separate_N);
RcppExport SEXP _lefko3_logistic3(SEXP start_valueSEXP, SEXP alphaSEXP, SEXP betaSEXP, SEXP lambdaSEXP, SEXP time_stepsSEXP, SEXP time_lagSEXP, SEXP pre0_subsSEXP, SEXP pre0_valueSEXP, SEXP substochSEXP, SEXP separate_NSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< double >::type start_value(start_valueSEXP);
    Rcpp::traits::input_parameter< double >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< double >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< double >::type lambda(lambdaSEXP);
    Rcpp::traits::input_parameter< int >::type time_steps(time_stepsSEXP);
    Rcpp::traits::input_parameter< int >::type time_lag(time_lagSEXP);
    Rcpp::traits::input_parameter< bool >::type pre0_subs(pre0_subsSEXP);
    Rcpp::traits::input_parameter< double >::type pre0_value(pre0_valueSEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type separate_N(separate_NSEXP);
    rcpp_result_gen = Rcpp::wrap(logistic3(start_value, alpha, beta, lambda, time_steps, time_lag, pre0_subs, pre0_value, substoch, separate_N));
    return rcpp_result_gen;
END_RCPP
}
// integer_test
int integer_test(NumericVector numeric_input);
RcppExport SEXP _lefko3_integer_test(SEXP numeric_inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type numeric_input(numeric_inputSEXP);
    rcpp_result_gen = Rcpp::wrap(integer_test(numeric_input));
    return rcpp_result_gen;
END_RCPP
}
// binomial_test
int binomial_test(NumericVector integer_input);
RcppExport SEXP _lefko3_binomial_test(SEXP integer_inputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type integer_input(integer_inputSEXP);
    rcpp_result_gen = Rcpp::wrap(binomial_test(integer_input));
    return rcpp_result_gen;
END_RCPP
}
// sf_reassess
Rcpp::List sf_reassess(const DataFrame& stageframe, Nullable<DataFrame> supplement, Nullable<DataFrame> overwrite, Nullable<NumericMatrix> repmatrix, bool agemat, bool historical, int format, bool import_lM);
RcppExport SEXP _lefko3_sf_reassess(SEXP stageframeSEXP, SEXP supplementSEXP, SEXP overwriteSEXP, SEXP repmatrixSEXP, SEXP agematSEXP, SEXP historicalSEXP, SEXP formatSEXP, SEXP import_lMSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const DataFrame& >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type supplement(supplementSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type overwrite(overwriteSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericMatrix> >::type repmatrix(repmatrixSEXP);
    Rcpp::traits::input_parameter< bool >::type agemat(agematSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< int >::type format(formatSEXP);
    Rcpp::traits::input_parameter< bool >::type import_lM(import_lMSEXP);
    rcpp_result_gen = Rcpp::wrap(sf_reassess(stageframe, supplement, overwrite, repmatrix, agemat, historical, format, import_lM));
    return rcpp_result_gen;
END_RCPP
}
// sf_skeleton
Rcpp::DataFrame sf_skeleton(int stages, bool standard);
RcppExport SEXP _lefko3_sf_skeleton(SEXP stagesSEXP, SEXP standardSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type stages(stagesSEXP);
    Rcpp::traits::input_parameter< bool >::type standard(standardSEXP);
    rcpp_result_gen = Rcpp::wrap(sf_skeleton(stages, standard));
    return rcpp_result_gen;
END_RCPP
}
// hist_null
Rcpp::List hist_null(RObject mpm, int format, bool err_check);
RcppExport SEXP _lefko3_hist_null(SEXP mpmSEXP, SEXP formatSEXP, SEXP err_checkSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< int >::type format(formatSEXP);
    Rcpp::traits::input_parameter< bool >::type err_check(err_checkSEXP);
    rcpp_result_gen = Rcpp::wrap(hist_null(mpm, format, err_check));
    return rcpp_result_gen;
END_RCPP
}
// lmean
Rcpp::List lmean(RObject mats, Nullable<String> matsout, bool force_sparse);
RcppExport SEXP _lefko3_lmean(SEXP matsSEXP, SEXP matsoutSEXP, SEXP force_sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type mats(matsSEXP);
    Rcpp::traits::input_parameter< Nullable<String> >::type matsout(matsoutSEXP);
    Rcpp::traits::input_parameter< bool >::type force_sparse(force_sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(lmean(mats, matsout, force_sparse));
    return rcpp_result_gen;
END_RCPP
}
// add_stage
Rcpp::List add_stage(const RObject mpm, int add_before, int add_after, Nullable<CharacterVector> stage_name);
RcppExport SEXP _lefko3_add_stage(SEXP mpmSEXP, SEXP add_beforeSEXP, SEXP add_afterSEXP, SEXP stage_nameSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const RObject >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< int >::type add_before(add_beforeSEXP);
    Rcpp::traits::input_parameter< int >::type add_after(add_afterSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type stage_name(stage_nameSEXP);
    rcpp_result_gen = Rcpp::wrap(add_stage(mpm, add_before, add_after, stage_name));
    return rcpp_result_gen;
END_RCPP
}
// cycle_check
List cycle_check(RObject mpm, Nullable<RObject> quiet);
RcppExport SEXP _lefko3_cycle_check(SEXP mpmSEXP, SEXP quietSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type quiet(quietSEXP);
    rcpp_result_gen = Rcpp::wrap(cycle_check(mpm, quiet));
    return rcpp_result_gen;
END_RCPP
}
// f_projection3
Rcpp::List f_projection3(int format, bool prebreeding, int start_age, int last_age, int fecage_min, int fecage_max, bool cont, bool stochastic, bool standardize, bool growthonly, bool repvalue, bool integeronly, int substoch, bool ipm_cdf, int nreps, int times, double repmod, double exp_tol, double theta_tol, bool random_inda, bool random_indb, bool random_indc, bool err_check, bool quiet, Nullable<RObject> data, Nullable<DataFrame> stageframe, Nullable<DataFrame> supplement, Nullable<NumericMatrix> repmatrix, Nullable<DataFrame> overwrite, Nullable<List> modelsuite, Nullable<DataFrame> paramnames, Nullable<NumericVector> year, Nullable<CharacterVector> patch, Nullable<NumericVector> sp_density, Nullable<RObject> ind_terms, Nullable<RObject> ann_terms, Nullable<RObject> dev_terms, Nullable<RObject> surv_model, Nullable<RObject> obs_model, Nullable<RObject> size_model, Nullable<RObject> sizeb_model, Nullable<RObject> sizec_model, Nullable<RObject> repst_model, Nullable<RObject> fec_model, Nullable<RObject> jsurv_model, Nullable<RObject> jobs_model, Nullable<RObject> jsize_model, Nullable<RObject> jsizeb_model, Nullable<RObject> jsizec_model, Nullable<RObject> jrepst_model, Nullable<RObject> jmatst_model, Nullable<NumericVector> start_vec, Nullable<RObject> start_frame, Nullable<RObject> tweights, Nullable<RObject> density, Nullable<RObject> density_vr, Nullable<RObject> stage_weights, Nullable<RObject> sparse);
RcppExport SEXP _lefko3_f_projection3(SEXP formatSEXP, SEXP prebreedingSEXP, SEXP start_ageSEXP, SEXP last_ageSEXP, SEXP fecage_minSEXP, SEXP fecage_maxSEXP, SEXP contSEXP, SEXP stochasticSEXP, SEXP standardizeSEXP, SEXP growthonlySEXP, SEXP repvalueSEXP, SEXP integeronlySEXP, SEXP substochSEXP, SEXP ipm_cdfSEXP, SEXP nrepsSEXP, SEXP timesSEXP, SEXP repmodSEXP, SEXP exp_tolSEXP, SEXP theta_tolSEXP, SEXP random_indaSEXP, SEXP random_indbSEXP, SEXP random_indcSEXP, SEXP err_checkSEXP, SEXP quietSEXP, SEXP dataSEXP, SEXP stageframeSEXP, SEXP supplementSEXP, SEXP repmatrixSEXP, SEXP overwriteSEXP, SEXP modelsuiteSEXP, SEXP paramnamesSEXP, SEXP yearSEXP, SEXP patchSEXP, SEXP sp_densitySEXP, SEXP ind_termsSEXP, SEXP ann_termsSEXP, SEXP dev_termsSEXP, SEXP surv_modelSEXP, SEXP obs_modelSEXP, SEXP size_modelSEXP, SEXP sizeb_modelSEXP, SEXP sizec_modelSEXP, SEXP repst_modelSEXP, SEXP fec_modelSEXP, SEXP jsurv_modelSEXP, SEXP jobs_modelSEXP, SEXP jsize_modelSEXP, SEXP jsizeb_modelSEXP, SEXP jsizec_modelSEXP, SEXP jrepst_modelSEXP, SEXP jmatst_modelSEXP, SEXP start_vecSEXP, SEXP start_frameSEXP, SEXP tweightsSEXP, SEXP densitySEXP, SEXP density_vrSEXP, SEXP stage_weightsSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< int >::type format(formatSEXP);
    Rcpp::traits::input_parameter< bool >::type prebreeding(prebreedingSEXP);
    Rcpp::traits::input_parameter< int >::type start_age(start_ageSEXP);
    Rcpp::traits::input_parameter< int >::type last_age(last_ageSEXP);
    Rcpp::traits::input_parameter< int >::type fecage_min(fecage_minSEXP);
    Rcpp::traits::input_parameter< int >::type fecage_max(fecage_maxSEXP);
    Rcpp::traits::input_parameter< bool >::type cont(contSEXP);
    Rcpp::traits::input_parameter< bool >::type stochastic(stochasticSEXP);
    Rcpp::traits::input_parameter< bool >::type standardize(standardizeSEXP);
    Rcpp::traits::input_parameter< bool >::type growthonly(growthonlySEXP);
    Rcpp::traits::input_parameter< bool >::type repvalue(repvalueSEXP);
    Rcpp::traits::input_parameter< bool >::type integeronly(integeronlySEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< bool >::type ipm_cdf(ipm_cdfSEXP);
    Rcpp::traits::input_parameter< int >::type nreps(nrepsSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    Rcpp::traits::input_parameter< double >::type repmod(repmodSEXP);
    Rcpp::traits::input_parameter< double >::type exp_tol(exp_tolSEXP);
    Rcpp::traits::input_parameter< double >::type theta_tol(theta_tolSEXP);
    Rcpp::traits::input_parameter< bool >::type random_inda(random_indaSEXP);
    Rcpp::traits::input_parameter< bool >::type random_indb(random_indbSEXP);
    Rcpp::traits::input_parameter< bool >::type random_indc(random_indcSEXP);
    Rcpp::traits::input_parameter< bool >::type err_check(err_checkSEXP);
    Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type data(dataSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type supplement(supplementSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericMatrix> >::type repmatrix(repmatrixSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type overwrite(overwriteSEXP);
    Rcpp::traits::input_parameter< Nullable<List> >::type modelsuite(modelsuiteSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type paramnames(paramnamesSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type year(yearSEXP);
    Rcpp::traits::input_parameter< Nullable<CharacterVector> >::type patch(patchSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sp_density(sp_densitySEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type ind_terms(ind_termsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type ann_terms(ann_termsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type dev_terms(dev_termsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type surv_model(surv_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type obs_model(obs_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type size_model(size_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sizeb_model(sizeb_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sizec_model(sizec_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type repst_model(repst_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type fec_model(fec_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jsurv_model(jsurv_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jobs_model(jobs_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jsize_model(jsize_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jsizeb_model(jsizeb_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jsizec_model(jsizec_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jrepst_model(jrepst_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type jmatst_model(jmatst_modelSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type start_vec(start_vecSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type start_frame(start_frameSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type tweights(tweightsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type density(densitySEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type density_vr(density_vrSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage_weights(stage_weightsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(f_projection3(format, prebreeding, start_age, last_age, fecage_min, fecage_max, cont, stochastic, standardize, growthonly, repvalue, integeronly, substoch, ipm_cdf, nreps, times, repmod, exp_tol, theta_tol, random_inda, random_indb, random_indc, err_check, quiet, data, stageframe, supplement, repmatrix, overwrite, modelsuite, paramnames, year, patch, sp_density, ind_terms, ann_terms, dev_terms, surv_model, obs_model, size_model, sizeb_model, sizec_model, repst_model, fec_model, jsurv_model, jobs_model, jsize_model, jsizeb_model, jsizec_model, jrepst_model, jmatst_model, start_vec, start_frame, tweights, density, density_vr, stage_weights, sparse));
    return rcpp_result_gen;
END_RCPP
}
// mpm_create
Rcpp::List mpm_create(bool historical, bool stage, bool age, bool devries, bool reduce, bool simple, bool err_check, Nullable<RObject> data, Nullable<RObject> year, Nullable<RObject> pop, Nullable<RObject> patch, Nullable<RObject> stageframe, Nullable<RObject> supplement, Nullable<RObject> overwrite, Nullable<RObject> repmatrix, Nullable<RObject> alive, Nullable<RObject> obsst, Nullable<RObject> size, Nullable<RObject> sizeb, Nullable<RObject> sizec, Nullable<RObject> repst, Nullable<RObject> matst, Nullable<RObject> fec, Nullable<RObject> stages, Nullable<RObject> yearcol, Nullable<RObject> popcol, Nullable<RObject> patchcol, Nullable<RObject> indivcol, Nullable<RObject> agecol, Nullable<RObject> censorcol, Nullable<RObject> modelsuite, Nullable<RObject> paramnames, Nullable<RObject> inda, Nullable<RObject> indb, Nullable<RObject> indc, Nullable<RObject> annua, Nullable<RObject> annub, Nullable<RObject> annuc, Nullable<RObject> dev_terms, double density, bool CDF, bool random_inda, bool random_indb, bool random_indc, bool negfec, int exp_tol, int theta_tol, bool censor, Nullable<RObject> censorkeep, int start_age, int last_age, int fecage_min, int fecage_max, int fectime, double fecmod, bool cont, bool prebreeding, bool stage_NRasRep, bool initial_nan, bool sparse_output);
RcppExport SEXP _lefko3_mpm_create(SEXP historicalSEXP, SEXP stageSEXP, SEXP ageSEXP, SEXP devriesSEXP, SEXP reduceSEXP, SEXP simpleSEXP, SEXP err_checkSEXP, SEXP dataSEXP, SEXP yearSEXP, SEXP popSEXP, SEXP patchSEXP, SEXP stageframeSEXP, SEXP supplementSEXP, SEXP overwriteSEXP, SEXP repmatrixSEXP, SEXP aliveSEXP, SEXP obsstSEXP, SEXP sizeSEXP, SEXP sizebSEXP, SEXP sizecSEXP, SEXP repstSEXP, SEXP matstSEXP, SEXP fecSEXP, SEXP stagesSEXP, SEXP yearcolSEXP, SEXP popcolSEXP, SEXP patchcolSEXP, SEXP indivcolSEXP, SEXP agecolSEXP, SEXP censorcolSEXP, SEXP modelsuiteSEXP, SEXP paramnamesSEXP, SEXP indaSEXP, SEXP indbSEXP, SEXP indcSEXP, SEXP annuaSEXP, SEXP annubSEXP, SEXP annucSEXP, SEXP dev_termsSEXP, SEXP densitySEXP, SEXP CDFSEXP, SEXP random_indaSEXP, SEXP random_indbSEXP, SEXP random_indcSEXP, SEXP negfecSEXP, SEXP exp_tolSEXP, SEXP theta_tolSEXP, SEXP censorSEXP, SEXP censorkeepSEXP, SEXP start_ageSEXP, SEXP last_ageSEXP, SEXP fecage_minSEXP, SEXP fecage_maxSEXP, SEXP fectimeSEXP, SEXP fecmodSEXP, SEXP contSEXP, SEXP prebreedingSEXP, SEXP stage_NRasRepSEXP, SEXP initial_nanSEXP, SEXP sparse_outputSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< bool >::type stage(stageSEXP);
    Rcpp::traits::input_parameter< bool >::type age(ageSEXP);
    Rcpp::traits::input_parameter< bool >::type devries(devriesSEXP);
    Rcpp::traits::input_parameter< bool >::type reduce(reduceSEXP);
    Rcpp::traits::input_parameter< bool >::type simple(simpleSEXP);
    Rcpp::traits::input_parameter< bool >::type err_check(err_checkSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type data(dataSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type year(yearSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type pop(popSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type patch(patchSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type supplement(supplementSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type overwrite(overwriteSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type repmatrix(repmatrixSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type alive(aliveSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type obsst(obsstSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type size(sizeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sizeb(sizebSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sizec(sizecSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type repst(repstSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type matst(matstSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type fec(fecSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stages(stagesSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type yearcol(yearcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type popcol(popcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type patchcol(patchcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type indivcol(indivcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type agecol(agecolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type censorcol(censorcolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type modelsuite(modelsuiteSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type paramnames(paramnamesSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type inda(indaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type indb(indbSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type indc(indcSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type annua(annuaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type annub(annubSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type annuc(annucSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type dev_terms(dev_termsSEXP);
    Rcpp::traits::input_parameter< double >::type density(densitySEXP);
    Rcpp::traits::input_parameter< bool >::type CDF(CDFSEXP);
    Rcpp::traits::input_parameter< bool >::type random_inda(random_indaSEXP);
    Rcpp::traits::input_parameter< bool >::type random_indb(random_indbSEXP);
    Rcpp::traits::input_parameter< bool >::type random_indc(random_indcSEXP);
    Rcpp::traits::input_parameter< bool >::type negfec(negfecSEXP);
    Rcpp::traits::input_parameter< int >::type exp_tol(exp_tolSEXP);
    Rcpp::traits::input_parameter< int >::type theta_tol(theta_tolSEXP);
    Rcpp::traits::input_parameter< bool >::type censor(censorSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type censorkeep(censorkeepSEXP);
    Rcpp::traits::input_parameter< int >::type start_age(start_ageSEXP);
    Rcpp::traits::input_parameter< int >::type last_age(last_ageSEXP);
    Rcpp::traits::input_parameter< int >::type fecage_min(fecage_minSEXP);
    Rcpp::traits::input_parameter< int >::type fecage_max(fecage_maxSEXP);
    Rcpp::traits::input_parameter< int >::type fectime(fectimeSEXP);
    Rcpp::traits::input_parameter< double >::type fecmod(fecmodSEXP);
    Rcpp::traits::input_parameter< bool >::type cont(contSEXP);
    Rcpp::traits::input_parameter< bool >::type prebreeding(prebreedingSEXP);
    Rcpp::traits::input_parameter< bool >::type stage_NRasRep(stage_NRasRepSEXP);
    Rcpp::traits::input_parameter< bool >::type initial_nan(initial_nanSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse_output(sparse_outputSEXP);
    rcpp_result_gen = Rcpp::wrap(mpm_create(historical, stage, age, devries, reduce, simple, err_check, data, year, pop, patch, stageframe, supplement, overwrite, repmatrix, alive, obsst, size, sizeb, sizec, repst, matst, fec, stages, yearcol, popcol, patchcol, indivcol, agecol, censorcol, modelsuite, paramnames, inda, indb, indc, annua, annub, annuc, dev_terms, density, CDF, random_inda, random_indb, random_indc, negfec, exp_tol, theta_tol, censor, censorkeep, start_age, last_age, fecage_min, fecage_max, fectime, fecmod, cont, prebreeding, stage_NRasRep, initial_nan, sparse_output));
    return rcpp_result_gen;
END_RCPP
}
// ss3matrix
arma::vec ss3matrix(const arma::mat& Amat, bool sparse);
RcppExport SEXP _lefko3_ss3matrix(SEXP AmatSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(ss3matrix(Amat, sparse));
    return rcpp_result_gen;
END_RCPP
}
// ss3matrix_sp
arma::vec ss3matrix_sp(const arma::sp_mat& Amat);
RcppExport SEXP _lefko3_ss3matrix_sp(SEXP AmatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    rcpp_result_gen = Rcpp::wrap(ss3matrix_sp(Amat));
    return rcpp_result_gen;
END_RCPP
}
// rv3matrix
arma::vec rv3matrix(const arma::mat& Amat, bool sparse);
RcppExport SEXP _lefko3_rv3matrix(SEXP AmatSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(rv3matrix(Amat, sparse));
    return rcpp_result_gen;
END_RCPP
}
// rv3matrix_sp
arma::vec rv3matrix_sp(const arma::sp_mat& Amat);
RcppExport SEXP _lefko3_rv3matrix_sp(SEXP AmatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    rcpp_result_gen = Rcpp::wrap(rv3matrix_sp(Amat));
    return rcpp_result_gen;
END_RCPP
}
// sens3matrix
arma::mat sens3matrix(const arma::mat& Amat, bool sparse);
RcppExport SEXP _lefko3_sens3matrix(SEXP AmatSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(sens3matrix(Amat, sparse));
    return rcpp_result_gen;
END_RCPP
}
// sens3sp_matrix
arma::sp_mat sens3sp_matrix(const arma::sp_mat& Aspmat, const arma::sp_mat& refmat);
RcppExport SEXP _lefko3_sens3sp_matrix(SEXP AspmatSEXP, SEXP refmatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Aspmat(AspmatSEXP);
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type refmat(refmatSEXP);
    rcpp_result_gen = Rcpp::wrap(sens3sp_matrix(Aspmat, refmat));
    return rcpp_result_gen;
END_RCPP
}
// sens3matrix_spinp
arma::mat sens3matrix_spinp(const arma::sp_mat& Amat);
RcppExport SEXP _lefko3_sens3matrix_spinp(SEXP AmatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    rcpp_result_gen = Rcpp::wrap(sens3matrix_spinp(Amat));
    return rcpp_result_gen;
END_RCPP
}
// sens3hlefko
List sens3hlefko(const arma::mat& Amat, const DataFrame& ahstages, const DataFrame& hstages);
RcppExport SEXP _lefko3_sens3hlefko(SEXP AmatSEXP, SEXP ahstagesSEXP, SEXP hstagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type hstages(hstagesSEXP);
    rcpp_result_gen = Rcpp::wrap(sens3hlefko(Amat, ahstages, hstages));
    return rcpp_result_gen;
END_RCPP
}
// sens3hlefko_sp
List sens3hlefko_sp(const arma::sp_mat& Amat, const DataFrame& ahstages, const DataFrame& hstages);
RcppExport SEXP _lefko3_sens3hlefko_sp(SEXP AmatSEXP, SEXP ahstagesSEXP, SEXP hstagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type hstages(hstagesSEXP);
    rcpp_result_gen = Rcpp::wrap(sens3hlefko_sp(Amat, ahstages, hstages));
    return rcpp_result_gen;
END_RCPP
}
// elas3matrix
arma::mat elas3matrix(const arma::mat& Amat, bool sparse);
RcppExport SEXP _lefko3_elas3matrix(SEXP AmatSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(elas3matrix(Amat, sparse));
    return rcpp_result_gen;
END_RCPP
}
// elas3sp_matrix
arma::sp_mat elas3sp_matrix(const arma::sp_mat& Amat);
RcppExport SEXP _lefko3_elas3sp_matrix(SEXP AmatSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    rcpp_result_gen = Rcpp::wrap(elas3sp_matrix(Amat));
    return rcpp_result_gen;
END_RCPP
}
// elas3hlefko
List elas3hlefko(const arma::mat& Amat, const DataFrame& ahstages, const DataFrame& hstages);
RcppExport SEXP _lefko3_elas3hlefko(SEXP AmatSEXP, SEXP ahstagesSEXP, SEXP hstagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type hstages(hstagesSEXP);
    rcpp_result_gen = Rcpp::wrap(elas3hlefko(Amat, ahstages, hstages));
    return rcpp_result_gen;
END_RCPP
}
// elas3sp_hlefko
List elas3sp_hlefko(const arma::sp_mat& Amat, const DataFrame& ahstages, const DataFrame& hstages);
RcppExport SEXP _lefko3_elas3sp_hlefko(SEXP AmatSEXP, SEXP ahstagesSEXP, SEXP hstagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type Amat(AmatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type ahstages(ahstagesSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type hstages(hstagesSEXP);
    rcpp_result_gen = Rcpp::wrap(elas3sp_hlefko(Amat, ahstages, hstages));
    return rcpp_result_gen;
END_RCPP
}
// proj3
arma::mat proj3(const arma::vec& start_vec, const List& core_list, const arma::uvec& mat_order, bool standardize, bool growthonly, bool integeronly, bool sparse_auto, bool sparse);
RcppExport SEXP _lefko3_proj3(SEXP start_vecSEXP, SEXP core_listSEXP, SEXP mat_orderSEXP, SEXP standardizeSEXP, SEXP growthonlySEXP, SEXP integeronlySEXP, SEXP sparse_autoSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type start_vec(start_vecSEXP);
    Rcpp::traits::input_parameter< const List& >::type core_list(core_listSEXP);
    Rcpp::traits::input_parameter< const arma::uvec& >::type mat_order(mat_orderSEXP);
    Rcpp::traits::input_parameter< bool >::type standardize(standardizeSEXP);
    Rcpp::traits::input_parameter< bool >::type growthonly(growthonlySEXP);
    Rcpp::traits::input_parameter< bool >::type integeronly(integeronlySEXP);
    Rcpp::traits::input_parameter< bool >::type sparse_auto(sparse_autoSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(proj3(start_vec, core_list, mat_order, standardize, growthonly, integeronly, sparse_auto, sparse));
    return rcpp_result_gen;
END_RCPP
}
// proj3sp
arma::mat proj3sp(const arma::vec& start_vec, const List& core_list, const arma::uvec& mat_order, bool standardize, bool growthonly, bool integeronly);
RcppExport SEXP _lefko3_proj3sp(SEXP start_vecSEXP, SEXP core_listSEXP, SEXP mat_orderSEXP, SEXP standardizeSEXP, SEXP growthonlySEXP, SEXP integeronlySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::vec& >::type start_vec(start_vecSEXP);
    Rcpp::traits::input_parameter< const List& >::type core_list(core_listSEXP);
    Rcpp::traits::input_parameter< const arma::uvec& >::type mat_order(mat_orderSEXP);
    Rcpp::traits::input_parameter< bool >::type standardize(standardizeSEXP);
    Rcpp::traits::input_parameter< bool >::type growthonly(growthonlySEXP);
    Rcpp::traits::input_parameter< bool >::type integeronly(integeronlySEXP);
    rcpp_result_gen = Rcpp::wrap(proj3sp(start_vec, core_list, mat_order, standardize, growthonly, integeronly));
    return rcpp_result_gen;
END_RCPP
}
// projection3
Rcpp::List projection3(const List& mpm, int nreps, int times, bool historical, bool stochastic, bool standardize, bool growthonly, bool integeronly, int substoch, double exp_tol, bool sub_warnings, bool quiet, Nullable<IntegerVector> year, Nullable<NumericVector> start_vec, Nullable<DataFrame> start_frame, Nullable<RObject> tweights, Nullable<RObject> density, Nullable<RObject> stage_weights, Nullable<RObject> sparse);
RcppExport SEXP _lefko3_projection3(SEXP mpmSEXP, SEXP nrepsSEXP, SEXP timesSEXP, SEXP historicalSEXP, SEXP stochasticSEXP, SEXP standardizeSEXP, SEXP growthonlySEXP, SEXP integeronlySEXP, SEXP substochSEXP, SEXP exp_tolSEXP, SEXP sub_warningsSEXP, SEXP quietSEXP, SEXP yearSEXP, SEXP start_vecSEXP, SEXP start_frameSEXP, SEXP tweightsSEXP, SEXP densitySEXP, SEXP stage_weightsSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< int >::type nreps(nrepsSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< bool >::type stochastic(stochasticSEXP);
    Rcpp::traits::input_parameter< bool >::type standardize(standardizeSEXP);
    Rcpp::traits::input_parameter< bool >::type growthonly(growthonlySEXP);
    Rcpp::traits::input_parameter< bool >::type integeronly(integeronlySEXP);
    Rcpp::traits::input_parameter< int >::type substoch(substochSEXP);
    Rcpp::traits::input_parameter< double >::type exp_tol(exp_tolSEXP);
    Rcpp::traits::input_parameter< bool >::type sub_warnings(sub_warningsSEXP);
    Rcpp::traits::input_parameter< bool >::type quiet(quietSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type year(yearSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type start_vec(start_vecSEXP);
    Rcpp::traits::input_parameter< Nullable<DataFrame> >::type start_frame(start_frameSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type tweights(tweightsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type density(densitySEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage_weights(stage_weightsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(projection3(mpm, nreps, times, historical, stochastic, standardize, growthonly, integeronly, substoch, exp_tol, sub_warnings, quiet, year, start_vec, start_frame, tweights, density, stage_weights, sparse));
    return rcpp_result_gen;
END_RCPP
}
// slambda3
DataFrame slambda3(const List& mpm, int times, bool historical, Nullable<RObject> tweights, Nullable<RObject> force_sparse);
RcppExport SEXP _lefko3_slambda3(SEXP mpmSEXP, SEXP timesSEXP, SEXP historicalSEXP, SEXP tweightsSEXP, SEXP force_sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type tweights(tweightsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type force_sparse(force_sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(slambda3(mpm, times, historical, tweights, force_sparse));
    return rcpp_result_gen;
END_RCPP
}
// stoch_senselas
Rcpp::List stoch_senselas(const List& mpm, int times, bool historical, int style, int sparse, bool lefkoProj, Nullable<RObject> tweights);
RcppExport SEXP _lefko3_stoch_senselas(SEXP mpmSEXP, SEXP timesSEXP, SEXP historicalSEXP, SEXP styleSEXP, SEXP sparseSEXP, SEXP lefkoProjSEXP, SEXP tweightsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< int >::type style(styleSEXP);
    Rcpp::traits::input_parameter< int >::type sparse(sparseSEXP);
    Rcpp::traits::input_parameter< bool >::type lefkoProj(lefkoProjSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type tweights(tweightsSEXP);
    rcpp_result_gen = Rcpp::wrap(stoch_senselas(mpm, times, historical, style, sparse, lefkoProj, tweights));
    return rcpp_result_gen;
END_RCPP
}
// ltre3matrix
Rcpp::List ltre3matrix(const List& Amats, Rcpp::IntegerVector refnum, Nullable<Rcpp::List> refmats_, bool mean, bool sparse);
RcppExport SEXP _lefko3_ltre3matrix(SEXP AmatsSEXP, SEXP refnumSEXP, SEXP refmats_SEXP, SEXP meanSEXP, SEXP sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type Amats(AmatsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type refnum(refnumSEXP);
    Rcpp::traits::input_parameter< Nullable<Rcpp::List> >::type refmats_(refmats_SEXP);
    Rcpp::traits::input_parameter< bool >::type mean(meanSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(ltre3matrix(Amats, refnum, refmats_, mean, sparse));
    return rcpp_result_gen;
END_RCPP
}
// sltre3matrix
Rcpp::List sltre3matrix(const List& Amats, const DataFrame& labels, Rcpp::IntegerVector refnum, Nullable<Rcpp::List> refmats_, Nullable<RObject> tweights_, int steps, int burnin, bool sparse, double tol_used);
RcppExport SEXP _lefko3_sltre3matrix(SEXP AmatsSEXP, SEXP labelsSEXP, SEXP refnumSEXP, SEXP refmats_SEXP, SEXP tweights_SEXP, SEXP stepsSEXP, SEXP burninSEXP, SEXP sparseSEXP, SEXP tol_usedSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type Amats(AmatsSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type refnum(refnumSEXP);
    Rcpp::traits::input_parameter< Nullable<Rcpp::List> >::type refmats_(refmats_SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type tweights_(tweights_SEXP);
    Rcpp::traits::input_parameter< int >::type steps(stepsSEXP);
    Rcpp::traits::input_parameter< int >::type burnin(burninSEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    Rcpp::traits::input_parameter< double >::type tol_used(tol_usedSEXP);
    rcpp_result_gen = Rcpp::wrap(sltre3matrix(Amats, labels, refnum, refmats_, tweights_, steps, burnin, sparse, tol_used));
    return rcpp_result_gen;
END_RCPP
}
// snaltre3matrix
Rcpp::List snaltre3matrix(const List& Amats, const DataFrame& labels, Rcpp::IntegerVector refnum, Nullable<Rcpp::List> refmats_, Nullable<arma::vec> tweights_, bool sparse, double tol_used);
RcppExport SEXP _lefko3_snaltre3matrix(SEXP AmatsSEXP, SEXP labelsSEXP, SEXP refnumSEXP, SEXP refmats_SEXP, SEXP tweights_SEXP, SEXP sparseSEXP, SEXP tol_usedSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const List& >::type Amats(AmatsSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type labels(labelsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type refnum(refnumSEXP);
    Rcpp::traits::input_parameter< Nullable<Rcpp::List> >::type refmats_(refmats_SEXP);
    Rcpp::traits::input_parameter< Nullable<arma::vec> >::type tweights_(tweights_SEXP);
    Rcpp::traits::input_parameter< bool >::type sparse(sparseSEXP);
    Rcpp::traits::input_parameter< double >::type tol_used(tol_usedSEXP);
    rcpp_result_gen = Rcpp::wrap(snaltre3matrix(Amats, labels, refnum, refmats_, tweights_, sparse, tol_used));
    return rcpp_result_gen;
END_RCPP
}
// markov_run
Rcpp::IntegerVector markov_run(Rcpp::IntegerVector main_times, Rcpp::NumericMatrix mat, int times, Nullable<IntegerVector> start);
RcppExport SEXP _lefko3_markov_run(SEXP main_timesSEXP, SEXP matSEXP, SEXP timesSEXP, SEXP startSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type main_times(main_timesSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericMatrix >::type mat(matSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type start(startSEXP);
    rcpp_result_gen = Rcpp::wrap(markov_run(main_times, mat, times, start));
    return rcpp_result_gen;
END_RCPP
}
// stovokor
Rcpp::List stovokor(const StringVector& surv, const StringVector& obs, const StringVector& size, const StringVector& sizeb, const StringVector& sizec, const StringVector& repst, const StringVector& fec, const StringVector& matstat, const StringVector& vitalrates, bool historical, StringVector& suite, const String& approach, const bool nojuvs, bool juvsize, const String& indiv, const String& patch, const String& year, const String& age, const String& densitycol, const StringVector& indcova, const StringVector& indcovb, const StringVector& indcovc, const bool sizebused, const bool sizecused, const LogicalVector& grouptest, const LogicalVector& ageused, const LogicalVector& densityused, const LogicalVector& indcovaused, const LogicalVector& indcovbused, const LogicalVector& indcovcused, const LogicalVector& annucovaused, const LogicalVector& annucovbused, const LogicalVector& annucovcused, const bool pasrand, const bool yasrand, const bool iaasrand, const bool ibasrand, const bool icasrand, const bool iaasfac, const bool ibasfac, const bool icasfac, const int fectime, const bool size_zero, const bool sizeb_zero, const bool sizec_zero, const bool jsize_zero, const bool jsizeb_zero, const bool jsizec_zero, const bool interactions);
RcppExport SEXP _lefko3_stovokor(SEXP survSEXP, SEXP obsSEXP, SEXP sizeSEXP, SEXP sizebSEXP, SEXP sizecSEXP, SEXP repstSEXP, SEXP fecSEXP, SEXP matstatSEXP, SEXP vitalratesSEXP, SEXP historicalSEXP, SEXP suiteSEXP, SEXP approachSEXP, SEXP nojuvsSEXP, SEXP juvsizeSEXP, SEXP indivSEXP, SEXP patchSEXP, SEXP yearSEXP, SEXP ageSEXP, SEXP densitycolSEXP, SEXP indcovaSEXP, SEXP indcovbSEXP, SEXP indcovcSEXP, SEXP sizebusedSEXP, SEXP sizecusedSEXP, SEXP grouptestSEXP, SEXP ageusedSEXP, SEXP densityusedSEXP, SEXP indcovausedSEXP, SEXP indcovbusedSEXP, SEXP indcovcusedSEXP, SEXP annucovausedSEXP, SEXP annucovbusedSEXP, SEXP annucovcusedSEXP, SEXP pasrandSEXP, SEXP yasrandSEXP, SEXP iaasrandSEXP, SEXP ibasrandSEXP, SEXP icasrandSEXP, SEXP iaasfacSEXP, SEXP ibasfacSEXP, SEXP icasfacSEXP, SEXP fectimeSEXP, SEXP size_zeroSEXP, SEXP sizeb_zeroSEXP, SEXP sizec_zeroSEXP, SEXP jsize_zeroSEXP, SEXP jsizeb_zeroSEXP, SEXP jsizec_zeroSEXP, SEXP interactionsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const StringVector& >::type surv(survSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type obs(obsSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type size(sizeSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type sizeb(sizebSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type sizec(sizecSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type repst(repstSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type fec(fecSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type matstat(matstatSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type vitalrates(vitalratesSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< StringVector& >::type suite(suiteSEXP);
    Rcpp::traits::input_parameter< const String& >::type approach(approachSEXP);
    Rcpp::traits::input_parameter< const bool >::type nojuvs(nojuvsSEXP);
    Rcpp::traits::input_parameter< bool >::type juvsize(juvsizeSEXP);
    Rcpp::traits::input_parameter< const String& >::type indiv(indivSEXP);
    Rcpp::traits::input_parameter< const String& >::type patch(patchSEXP);
    Rcpp::traits::input_parameter< const String& >::type year(yearSEXP);
    Rcpp::traits::input_parameter< const String& >::type age(ageSEXP);
    Rcpp::traits::input_parameter< const String& >::type densitycol(densitycolSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type indcova(indcovaSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type indcovb(indcovbSEXP);
    Rcpp::traits::input_parameter< const StringVector& >::type indcovc(indcovcSEXP);
    Rcpp::traits::input_parameter< const bool >::type sizebused(sizebusedSEXP);
    Rcpp::traits::input_parameter< const bool >::type sizecused(sizecusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type grouptest(grouptestSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type ageused(ageusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type densityused(densityusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type indcovaused(indcovausedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type indcovbused(indcovbusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type indcovcused(indcovcusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type annucovaused(annucovausedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type annucovbused(annucovbusedSEXP);
    Rcpp::traits::input_parameter< const LogicalVector& >::type annucovcused(annucovcusedSEXP);
    Rcpp::traits::input_parameter< const bool >::type pasrand(pasrandSEXP);
    Rcpp::traits::input_parameter< const bool >::type yasrand(yasrandSEXP);
    Rcpp::traits::input_parameter< const bool >::type iaasrand(iaasrandSEXP);
    Rcpp::traits::input_parameter< const bool >::type ibasrand(ibasrandSEXP);
    Rcpp::traits::input_parameter< const bool >::type icasrand(icasrandSEXP);
    Rcpp::traits::input_parameter< const bool >::type iaasfac(iaasfacSEXP);
    Rcpp::traits::input_parameter< const bool >::type ibasfac(ibasfacSEXP);
    Rcpp::traits::input_parameter< const bool >::type icasfac(icasfacSEXP);
    Rcpp::traits::input_parameter< const int >::type fectime(fectimeSEXP);
    Rcpp::traits::input_parameter< const bool >::type size_zero(size_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type sizeb_zero(sizeb_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type sizec_zero(sizec_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type jsize_zero(jsize_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type jsizeb_zero(jsizeb_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type jsizec_zero(jsizec_zeroSEXP);
    Rcpp::traits::input_parameter< const bool >::type interactions(interactionsSEXP);
    rcpp_result_gen = Rcpp::wrap(stovokor(surv, obs, size, sizeb, sizec, repst, fec, matstat, vitalrates, historical, suite, approach, nojuvs, juvsize, indiv, patch, year, age, densitycol, indcova, indcovb, indcovc, sizebused, sizecused, grouptest, ageused, densityused, indcovaused, indcovbused, indcovcused, annucovaused, annucovbused, annucovcused, pasrand, yasrand, iaasrand, ibasrand, icasrand, iaasfac, ibasfac, icasfac, fectime, size_zero, sizeb_zero, sizec_zero, jsize_zero, jsizeb_zero, jsizec_zero, interactions));
    return rcpp_result_gen;
END_RCPP
}
// create_pm
Rcpp::DataFrame create_pm(bool name_terms);
RcppExport SEXP _lefko3_create_pm(SEXP name_termsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type name_terms(name_termsSEXP);
    rcpp_result_gen = Rcpp::wrap(create_pm(name_terms));
    return rcpp_result_gen;
END_RCPP
}
// miniMod
Rcpp::List miniMod(RObject lMod, Nullable<RObject> hfv_data, Nullable<RObject> stageframe, Nullable<RObject> all_years, Nullable<RObject> all_patches, Nullable<RObject> all_groups, Nullable<RObject> all_indcova, Nullable<RObject> all_indcovb, Nullable<RObject> all_indcovc);
RcppExport SEXP _lefko3_miniMod(SEXP lModSEXP, SEXP hfv_dataSEXP, SEXP stageframeSEXP, SEXP all_yearsSEXP, SEXP all_patchesSEXP, SEXP all_groupsSEXP, SEXP all_indcovaSEXP, SEXP all_indcovbSEXP, SEXP all_indcovcSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type lMod(lModSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type hfv_data(hfv_dataSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_years(all_yearsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_patches(all_patchesSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_groups(all_groupsSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_indcova(all_indcovaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_indcovb(all_indcovbSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type all_indcovc(all_indcovcSEXP);
    rcpp_result_gen = Rcpp::wrap(miniMod(lMod, hfv_data, stageframe, all_years, all_patches, all_groups, all_indcova, all_indcovb, all_indcovc));
    return rcpp_result_gen;
END_RCPP
}
// sf_create
Rcpp::List sf_create(NumericVector sizes, Nullable<StringVector> stagenames, Nullable<NumericVector> sizesb, Nullable<NumericVector> sizesc, Nullable<IntegerVector> repstatus, Nullable<IntegerVector> obsstatus, Nullable<IntegerVector> propstatus, Nullable<IntegerVector> matstatus, Nullable<IntegerVector> immstatus, Nullable<NumericVector> minage, Nullable<NumericVector> maxage, Nullable<IntegerVector> indataset, Nullable<NumericVector> sizemin, Nullable<NumericVector> sizebmin, Nullable<NumericVector> sizecmin, Nullable<NumericVector> sizemax, Nullable<NumericVector> sizebmax, Nullable<NumericVector> sizecmax, Nullable<NumericVector> binhalfwidth, Nullable<NumericVector> binhalfwidthb, Nullable<NumericVector> binhalfwidthc, Nullable<IntegerVector> group, Nullable<StringVector> comments, int roundsize, int roundsizeb, int roundsizec, int ipmbins, int ipmbinsb, int ipmbinsc);
RcppExport SEXP _lefko3_sf_create(SEXP sizesSEXP, SEXP stagenamesSEXP, SEXP sizesbSEXP, SEXP sizescSEXP, SEXP repstatusSEXP, SEXP obsstatusSEXP, SEXP propstatusSEXP, SEXP matstatusSEXP, SEXP immstatusSEXP, SEXP minageSEXP, SEXP maxageSEXP, SEXP indatasetSEXP, SEXP sizeminSEXP, SEXP sizebminSEXP, SEXP sizecminSEXP, SEXP sizemaxSEXP, SEXP sizebmaxSEXP, SEXP sizecmaxSEXP, SEXP binhalfwidthSEXP, SEXP binhalfwidthbSEXP, SEXP binhalfwidthcSEXP, SEXP groupSEXP, SEXP commentsSEXP, SEXP roundsizeSEXP, SEXP roundsizebSEXP, SEXP roundsizecSEXP, SEXP ipmbinsSEXP, SEXP ipmbinsbSEXP, SEXP ipmbinscSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type sizes(sizesSEXP);
    Rcpp::traits::input_parameter< Nullable<StringVector> >::type stagenames(stagenamesSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizesb(sizesbSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizesc(sizescSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type repstatus(repstatusSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type obsstatus(obsstatusSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type propstatus(propstatusSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type matstatus(matstatusSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type immstatus(immstatusSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type minage(minageSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type maxage(maxageSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type indataset(indatasetSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizemin(sizeminSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizebmin(sizebminSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizecmin(sizecminSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizemax(sizemaxSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizebmax(sizebmaxSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type sizecmax(sizecmaxSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type binhalfwidth(binhalfwidthSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type binhalfwidthb(binhalfwidthbSEXP);
    Rcpp::traits::input_parameter< Nullable<NumericVector> >::type binhalfwidthc(binhalfwidthcSEXP);
    Rcpp::traits::input_parameter< Nullable<IntegerVector> >::type group(groupSEXP);
    Rcpp::traits::input_parameter< Nullable<StringVector> >::type comments(commentsSEXP);
    Rcpp::traits::input_parameter< int >::type roundsize(roundsizeSEXP);
    Rcpp::traits::input_parameter< int >::type roundsizeb(roundsizebSEXP);
    Rcpp::traits::input_parameter< int >::type roundsizec(roundsizecSEXP);
    Rcpp::traits::input_parameter< int >::type ipmbins(ipmbinsSEXP);
    Rcpp::traits::input_parameter< int >::type ipmbinsb(ipmbinsbSEXP);
    Rcpp::traits::input_parameter< int >::type ipmbinsc(ipmbinscSEXP);
    rcpp_result_gen = Rcpp::wrap(sf_create(sizes, stagenames, sizesb, sizesc, repstatus, obsstatus, propstatus, matstatus, immstatus, minage, maxage, indataset, sizemin, sizebmin, sizecmin, sizemax, sizebmax, sizecmax, binhalfwidth, binhalfwidthb, binhalfwidthc, group, comments, roundsize, roundsizeb, roundsizec, ipmbins, ipmbinsb, ipmbinsc));
    return rcpp_result_gen;
END_RCPP
}
// actualstage3
List actualstage3(RObject data, bool check_stage, bool check_age, bool historical, Nullable<RObject> year2, Nullable<RObject> indices, Nullable<RObject> stagecol, Nullable<RObject> agecol, Nullable<RObject> remove_stage, Nullable<RObject> t1_allow);
RcppExport SEXP _lefko3_actualstage3(SEXP dataSEXP, SEXP check_stageSEXP, SEXP check_ageSEXP, SEXP historicalSEXP, SEXP year2SEXP, SEXP indicesSEXP, SEXP stagecolSEXP, SEXP agecolSEXP, SEXP remove_stageSEXP, SEXP t1_allowSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type data(dataSEXP);
    Rcpp::traits::input_parameter< bool >::type check_stage(check_stageSEXP);
    Rcpp::traits::input_parameter< bool >::type check_age(check_ageSEXP);
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type year2(year2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type indices(indicesSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stagecol(stagecolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type agecol(agecolSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type remove_stage(remove_stageSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type t1_allow(t1_allowSEXP);
    rcpp_result_gen = Rcpp::wrap(actualstage3(data, check_stage, check_age, historical, year2, indices, stagecol, agecol, remove_stage, t1_allow));
    return rcpp_result_gen;
END_RCPP
}
// density_input
DataFrame density_input(List mpm, Nullable<RObject> stage3, Nullable<RObject> stage2, Nullable<RObject> stage1, Nullable<RObject> age2, Nullable<RObject> style, Nullable<RObject> time_delay, Nullable<RObject> alpha, Nullable<RObject> beta, Nullable<RObject> gamma, Nullable<RObject> type, Nullable<RObject> type_t12);
RcppExport SEXP _lefko3_density_input(SEXP mpmSEXP, SEXP stage3SEXP, SEXP stage2SEXP, SEXP stage1SEXP, SEXP age2SEXP, SEXP styleSEXP, SEXP time_delaySEXP, SEXP alphaSEXP, SEXP betaSEXP, SEXP gammaSEXP, SEXP typeSEXP, SEXP type_t12SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage3(stage3SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage2(stage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage1(stage1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type age2(age2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type style(styleSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type time_delay(time_delaySEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type alpha(alphaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type beta(betaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type gamma(gammaSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type(typeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type_t12(type_t12SEXP);
    rcpp_result_gen = Rcpp::wrap(density_input(mpm, stage3, stage2, stage1, age2, style, time_delay, alpha, beta, gamma, type, type_t12));
    return rcpp_result_gen;
END_RCPP
}
// supplemental
Rcpp::List supplemental(bool historical, bool stagebased, bool agebased, Nullable<RObject> stageframe, Nullable<RObject> stage3, Nullable<RObject> stage2, Nullable<RObject> stage1, Nullable<RObject> age2, Nullable<RObject> eststage3, Nullable<RObject> eststage2, Nullable<RObject> eststage1, Nullable<RObject> estage2, Nullable<RObject> givenrate, Nullable<RObject> offset, Nullable<RObject> multiplier, Nullable<RObject> type, Nullable<RObject> type_t12);
RcppExport SEXP _lefko3_supplemental(SEXP historicalSEXP, SEXP stagebasedSEXP, SEXP agebasedSEXP, SEXP stageframeSEXP, SEXP stage3SEXP, SEXP stage2SEXP, SEXP stage1SEXP, SEXP age2SEXP, SEXP eststage3SEXP, SEXP eststage2SEXP, SEXP eststage1SEXP, SEXP estage2SEXP, SEXP givenrateSEXP, SEXP offsetSEXP, SEXP multiplierSEXP, SEXP typeSEXP, SEXP type_t12SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< bool >::type historical(historicalSEXP);
    Rcpp::traits::input_parameter< bool >::type stagebased(stagebasedSEXP);
    Rcpp::traits::input_parameter< bool >::type agebased(agebasedSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stageframe(stageframeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage3(stage3SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage2(stage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage1(stage1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type age2(age2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage3(eststage3SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage2(eststage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage1(eststage1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type estage2(estage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type givenrate(givenrateSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type offset(offsetSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type multiplier(multiplierSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type(typeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type_t12(type_t12SEXP);
    rcpp_result_gen = Rcpp::wrap(supplemental(historical, stagebased, agebased, stageframe, stage3, stage2, stage1, age2, eststage3, eststage2, eststage1, estage2, givenrate, offset, multiplier, type, type_t12));
    return rcpp_result_gen;
END_RCPP
}
// sup_skeleton
DataFrame sup_skeleton(Nullable<RObject> rows);
RcppExport SEXP _lefko3_sup_skeleton(SEXP rowsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Nullable<RObject> >::type rows(rowsSEXP);
    rcpp_result_gen = Rcpp::wrap(sup_skeleton(rows));
    return rcpp_result_gen;
END_RCPP
}
// edit_lM
Rcpp::List edit_lM(const RObject mpm, Nullable<RObject> pop, Nullable<RObject> patch, Nullable<RObject> year2, Nullable<RObject> stage3, Nullable<RObject> stage2, Nullable<RObject> stage1, Nullable<RObject> age2, Nullable<RObject> eststage3, Nullable<RObject> eststage2, Nullable<RObject> eststage1, Nullable<RObject> estage2, Nullable<RObject> givenrate, Nullable<RObject> offset, Nullable<RObject> multiplier, Nullable<RObject> type, Nullable<RObject> type_t12, Nullable<RObject> target_mpm);
RcppExport SEXP _lefko3_edit_lM(SEXP mpmSEXP, SEXP popSEXP, SEXP patchSEXP, SEXP year2SEXP, SEXP stage3SEXP, SEXP stage2SEXP, SEXP stage1SEXP, SEXP age2SEXP, SEXP eststage3SEXP, SEXP eststage2SEXP, SEXP eststage1SEXP, SEXP estage2SEXP, SEXP givenrateSEXP, SEXP offsetSEXP, SEXP multiplierSEXP, SEXP typeSEXP, SEXP type_t12SEXP, SEXP target_mpmSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const RObject >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type pop(popSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type patch(patchSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type year2(year2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage3(stage3SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage2(stage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type stage1(stage1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type age2(age2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage3(eststage3SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage2(eststage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type eststage1(eststage1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type estage2(estage2SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type givenrate(givenrateSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type offset(offsetSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type multiplier(multiplierSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type(typeSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type type_t12(type_t12SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type target_mpm(target_mpmSEXP);
    rcpp_result_gen = Rcpp::wrap(edit_lM(mpm, pop, patch, year2, stage3, stage2, stage1, age2, eststage3, eststage2, eststage1, estage2, givenrate, offset, multiplier, type, type_t12, target_mpm));
    return rcpp_result_gen;
END_RCPP
}
// bambi3
Rcpp::DataFrame bambi3(const DataFrame& stages, const DataFrame& hstages);
RcppExport SEXP _lefko3_bambi3(SEXP stagesSEXP, SEXP hstagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const DataFrame& >::type stages(stagesSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type hstages(hstagesSEXP);
    rcpp_result_gen = Rcpp::wrap(bambi3(stages, hstages));
    return rcpp_result_gen;
END_RCPP
}
// bambi2
Rcpp::DataFrame bambi2(const DataFrame& stages);
RcppExport SEXP _lefko3_bambi2(SEXP stagesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const DataFrame& >::type stages(stagesSEXP);
    rcpp_result_gen = Rcpp::wrap(bambi2(stages));
    return rcpp_result_gen;
END_RCPP
}
// demolition4
Rcpp::List demolition4(List cmats);
RcppExport SEXP _lefko3_demolition4(SEXP cmatsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type cmats(cmatsSEXP);
    rcpp_result_gen = Rcpp::wrap(demolition4(cmats));
    return rcpp_result_gen;
END_RCPP
}
// demolition3
Rcpp::List demolition3(const arma::mat& e_amat, const DataFrame& bambesque, Nullable<Rcpp::NumericMatrix> amat_, Nullable<Rcpp::NumericMatrix> fmat_);
RcppExport SEXP _lefko3_demolition3(SEXP e_amatSEXP, SEXP bambesqueSEXP, SEXP amat_SEXP, SEXP fmat_SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::mat& >::type e_amat(e_amatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type bambesque(bambesqueSEXP);
    Rcpp::traits::input_parameter< Nullable<Rcpp::NumericMatrix> >::type amat_(amat_SEXP);
    Rcpp::traits::input_parameter< Nullable<Rcpp::NumericMatrix> >::type fmat_(fmat_SEXP);
    rcpp_result_gen = Rcpp::wrap(demolition3(e_amat, bambesque, amat_, fmat_));
    return rcpp_result_gen;
END_RCPP
}
// demolition3sp
Rcpp::List demolition3sp(const arma::sp_mat& e_amat, const DataFrame& bambesque, Nullable<arma::sp_mat> amat_, Nullable<arma::sp_mat> fmat_);
RcppExport SEXP _lefko3_demolition3sp(SEXP e_amatSEXP, SEXP bambesqueSEXP, SEXP amat_SEXP, SEXP fmat_SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const arma::sp_mat& >::type e_amat(e_amatSEXP);
    Rcpp::traits::input_parameter< const DataFrame& >::type bambesque(bambesqueSEXP);
    Rcpp::traits::input_parameter< Nullable<arma::sp_mat> >::type amat_(amat_SEXP);
    Rcpp::traits::input_parameter< Nullable<arma::sp_mat> >::type fmat_(fmat_SEXP);
    rcpp_result_gen = Rcpp::wrap(demolition3sp(e_amat, bambesque, amat_, fmat_));
    return rcpp_result_gen;
END_RCPP
}
// lambda3
Rcpp::RObject lambda3(RObject& mpm, Nullable<RObject> style, Nullable<RObject> force_sparse);
RcppExport SEXP _lefko3_lambda3(SEXP mpmSEXP, SEXP styleSEXP, SEXP force_sparseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject& >::type mpm(mpmSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type style(styleSEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type force_sparse(force_sparseSEXP);
    rcpp_result_gen = Rcpp::wrap(lambda3(mpm, style, force_sparse));
    return rcpp_result_gen;
END_RCPP
}
// matrix_interp
Rcpp::DataFrame matrix_interp(RObject object, int mat_chosen, int part, int type);
RcppExport SEXP _lefko3_matrix_interp(SEXP objectSEXP, SEXP mat_chosenSEXP, SEXP partSEXP, SEXP typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< RObject >::type object(objectSEXP);
    Rcpp::traits::input_parameter< int >::type mat_chosen(mat_chosenSEXP);
    Rcpp::traits::input_parameter< int >::type part(partSEXP);
    Rcpp::traits::input_parameter< int >::type type(typeSEXP);
    rcpp_result_gen = Rcpp::wrap(matrix_interp(object, mat_chosen, part, type));
    return rcpp_result_gen;
END_RCPP
}
// append_lP
Rcpp::List append_lP(Nullable<RObject> proj1, Nullable<RObject> proj2);
RcppExport SEXP _lefko3_append_lP(SEXP proj1SEXP, SEXP proj2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< Nullable<RObject> >::type proj1(proj1SEXP);
    Rcpp::traits::input_parameter< Nullable<RObject> >::type proj2(proj2SEXP);
    rcpp_result_gen = Rcpp::wrap(append_lP(proj1, proj2));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_lefko3_pfj", (DL_FUNC) &_lefko3_pfj, 42},
    {"_lefko3_jpf", (DL_FUNC) &_lefko3_jpf, 54},
    {"_lefko3_density3", (DL_FUNC) &_lefko3_density3, 5},
    {"_lefko3_bootstrap3", (DL_FUNC) &_lefko3_bootstrap3, 11},
    {"_lefko3_hoffmannofstuttgart", (DL_FUNC) &_lefko3_hoffmannofstuttgart, 4},
    {"_lefko3_hoffmannofstuttgart_sp", (DL_FUNC) &_lefko3_hoffmannofstuttgart_sp, 4},
    {"_lefko3_cond_hmpm", (DL_FUNC) &_lefko3_cond_hmpm, 3},
    {"_lefko3_cond_diff", (DL_FUNC) &_lefko3_cond_diff, 4},
    {"_lefko3_ricker3", (DL_FUNC) &_lefko3_ricker3, 9},
    {"_lefko3_beverton3", (DL_FUNC) &_lefko3_beverton3, 9},
    {"_lefko3_usher3", (DL_FUNC) &_lefko3_usher3, 9},
    {"_lefko3_logistic3", (DL_FUNC) &_lefko3_logistic3, 10},
    {"_lefko3_integer_test", (DL_FUNC) &_lefko3_integer_test, 1},
    {"_lefko3_binomial_test", (DL_FUNC) &_lefko3_binomial_test, 1},
    {"_lefko3_sf_reassess", (DL_FUNC) &_lefko3_sf_reassess, 8},
    {"_lefko3_sf_skeleton", (DL_FUNC) &_lefko3_sf_skeleton, 2},
    {"_lefko3_hist_null", (DL_FUNC) &_lefko3_hist_null, 3},
    {"_lefko3_lmean", (DL_FUNC) &_lefko3_lmean, 3},
    {"_lefko3_add_stage", (DL_FUNC) &_lefko3_add_stage, 4},
    {"_lefko3_cycle_check", (DL_FUNC) &_lefko3_cycle_check, 2},
    {"_lefko3_f_projection3", (DL_FUNC) &_lefko3_f_projection3, 58},
    {"_lefko3_mpm_create", (DL_FUNC) &_lefko3_mpm_create, 60},
    {"_lefko3_ss3matrix", (DL_FUNC) &_lefko3_ss3matrix, 2},
    {"_lefko3_ss3matrix_sp", (DL_FUNC) &_lefko3_ss3matrix_sp, 1},
    {"_lefko3_rv3matrix", (DL_FUNC) &_lefko3_rv3matrix, 2},
    {"_lefko3_rv3matrix_sp", (DL_FUNC) &_lefko3_rv3matrix_sp, 1},
    {"_lefko3_sens3matrix", (DL_FUNC) &_lefko3_sens3matrix, 2},
    {"_lefko3_sens3sp_matrix", (DL_FUNC) &_lefko3_sens3sp_matrix, 2},
    {"_lefko3_sens3matrix_spinp", (DL_FUNC) &_lefko3_sens3matrix_spinp, 1},
    {"_lefko3_sens3hlefko", (DL_FUNC) &_lefko3_sens3hlefko, 3},
    {"_lefko3_sens3hlefko_sp", (DL_FUNC) &_lefko3_sens3hlefko_sp, 3},
    {"_lefko3_elas3matrix", (DL_FUNC) &_lefko3_elas3matrix, 2},
    {"_lefko3_elas3sp_matrix", (DL_FUNC) &_lefko3_elas3sp_matrix, 1},
    {"_lefko3_elas3hlefko", (DL_FUNC) &_lefko3_elas3hlefko, 3},
    {"_lefko3_elas3sp_hlefko", (DL_FUNC) &_lefko3_elas3sp_hlefko, 3},
    {"_lefko3_proj3", (DL_FUNC) &_lefko3_proj3, 8},
    {"_lefko3_proj3sp", (DL_FUNC) &_lefko3_proj3sp, 6},
    {"_lefko3_projection3", (DL_FUNC) &_lefko3_projection3, 19},
    {"_lefko3_slambda3", (DL_FUNC) &_lefko3_slambda3, 5},
    {"_lefko3_stoch_senselas", (DL_FUNC) &_lefko3_stoch_senselas, 7},
    {"_lefko3_ltre3matrix", (DL_FUNC) &_lefko3_ltre3matrix, 5},
    {"_lefko3_sltre3matrix", (DL_FUNC) &_lefko3_sltre3matrix, 9},
    {"_lefko3_snaltre3matrix", (DL_FUNC) &_lefko3_snaltre3matrix, 7},
    {"_lefko3_markov_run", (DL_FUNC) &_lefko3_markov_run, 4},
    {"_lefko3_stovokor", (DL_FUNC) &_lefko3_stovokor, 49},
    {"_lefko3_create_pm", (DL_FUNC) &_lefko3_create_pm, 1},
    {"_lefko3_miniMod", (DL_FUNC) &_lefko3_miniMod, 9},
    {"_lefko3_sf_create", (DL_FUNC) &_lefko3_sf_create, 29},
    {"_lefko3_actualstage3", (DL_FUNC) &_lefko3_actualstage3, 10},
    {"_lefko3_density_input", (DL_FUNC) &_lefko3_density_input, 12},
    {"_lefko3_supplemental", (DL_FUNC) &_lefko3_supplemental, 17},
    {"_lefko3_sup_skeleton", (DL_FUNC) &_lefko3_sup_skeleton, 1},
    {"_lefko3_edit_lM", (DL_FUNC) &_lefko3_edit_lM, 18},
    {"_lefko3_bambi3", (DL_FUNC) &_lefko3_bambi3, 2},
    {"_lefko3_bambi2", (DL_FUNC) &_lefko3_bambi2, 1},
    {"_lefko3_demolition4", (DL_FUNC) &_lefko3_demolition4, 1},
    {"_lefko3_demolition3", (DL_FUNC) &_lefko3_demolition3, 4},
    {"_lefko3_demolition3sp", (DL_FUNC) &_lefko3_demolition3sp, 4},
    {"_lefko3_lambda3", (DL_FUNC) &_lefko3_lambda3, 3},
    {"_lefko3_matrix_interp", (DL_FUNC) &_lefko3_matrix_interp, 4},
    {"_lefko3_append_lP", (DL_FUNC) &_lefko3_append_lP, 2},
    {NULL, NULL, 0}
};

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