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

#include "../inst/include/fntl.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

// fd_deriv_rcpp
double fd_deriv_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, unsigned int i, double h, unsigned int fd_type);
RcppExport SEXP _fntl_fd_deriv_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP iSEXP, SEXP hSEXP, SEXP fd_typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type i(iSEXP);
    Rcpp::traits::input_parameter< double >::type h(hSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type fd_type(fd_typeSEXP);
    rcpp_result_gen = Rcpp::wrap(fd_deriv_rcpp(f, x, i, h, fd_type));
    return rcpp_result_gen;
END_RCPP
}
// fd_deriv2_rcpp
double fd_deriv2_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, unsigned int i, unsigned int j, double h_i, double h_j, unsigned int fd_type);
RcppExport SEXP _fntl_fd_deriv2_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP iSEXP, SEXP jSEXP, SEXP h_iSEXP, SEXP h_jSEXP, SEXP fd_typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type i(iSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type j(jSEXP);
    Rcpp::traits::input_parameter< double >::type h_i(h_iSEXP);
    Rcpp::traits::input_parameter< double >::type h_j(h_jSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type fd_type(fd_typeSEXP);
    rcpp_result_gen = Rcpp::wrap(fd_deriv2_rcpp(f, x, i, j, h_i, h_j, fd_type));
    return rcpp_result_gen;
END_RCPP
}
// deriv_rcpp
Rcpp::List deriv_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, unsigned int i, const Rcpp::List& args, unsigned int fd_type);
RcppExport SEXP _fntl_deriv_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP iSEXP, SEXP argsSEXP, SEXP fd_typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type i(iSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type fd_type(fd_typeSEXP);
    rcpp_result_gen = Rcpp::wrap(deriv_rcpp(f, x, i, args, fd_type));
    return rcpp_result_gen;
END_RCPP
}
// deriv2_rcpp
Rcpp::List deriv2_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, unsigned int i, unsigned int j, const Rcpp::List& args, unsigned int fd_type);
RcppExport SEXP _fntl_deriv2_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP iSEXP, SEXP jSEXP, SEXP argsSEXP, SEXP fd_typeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type i(iSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type j(jSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    Rcpp::traits::input_parameter< unsigned int >::type fd_type(fd_typeSEXP);
    rcpp_result_gen = Rcpp::wrap(deriv2_rcpp(f, x, i, j, args, fd_type));
    return rcpp_result_gen;
END_RCPP
}
// gradient_rcpp
Rcpp::List gradient_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, const Rcpp::List& args);
RcppExport SEXP _fntl_gradient_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(gradient_rcpp(f, x, args));
    return rcpp_result_gen;
END_RCPP
}
// jacobian_rcpp
Rcpp::List jacobian_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, const Rcpp::List& args);
RcppExport SEXP _fntl_jacobian_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(jacobian_rcpp(f, x, args));
    return rcpp_result_gen;
END_RCPP
}
// hessian_rcpp
Rcpp::List hessian_rcpp(const Rcpp::Function& f, const Rcpp::NumericVector& x, const Rcpp::List& args);
RcppExport SEXP _fntl_hessian_rcpp(SEXP fSEXP, SEXP xSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(hessian_rcpp(f, x, args));
    return rcpp_result_gen;
END_RCPP
}
// findroot_bisect_rcpp
Rcpp::List findroot_bisect_rcpp(const Rcpp::Function& f, double lower, double upper, const Rcpp::List& args);
RcppExport SEXP _fntl_findroot_bisect_rcpp(SEXP fSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< double >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< double >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(findroot_bisect_rcpp(f, lower, upper, args));
    return rcpp_result_gen;
END_RCPP
}
// findroot_brent_rcpp
Rcpp::List findroot_brent_rcpp(const Rcpp::Function& f, double lower, double upper, const Rcpp::List& args);
RcppExport SEXP _fntl_findroot_brent_rcpp(SEXP fSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< double >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< double >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(findroot_brent_rcpp(f, lower, upper, args));
    return rcpp_result_gen;
END_RCPP
}
// goldensection_rcpp
Rcpp::List goldensection_rcpp(const Rcpp::Function& f, double lower, double upper, const Rcpp::List& args);
RcppExport SEXP _fntl_goldensection_rcpp(SEXP fSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< double >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< double >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(goldensection_rcpp(f, lower, upper, args));
    return rcpp_result_gen;
END_RCPP
}
// optimize_brent_rcpp
Rcpp::List optimize_brent_rcpp(const Rcpp::Function& f, double lower, double upper, const Rcpp::List& args);
RcppExport SEXP _fntl_optimize_brent_rcpp(SEXP fSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< double >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< double >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(optimize_brent_rcpp(f, lower, upper, args));
    return rcpp_result_gen;
END_RCPP
}
// integrate_rcpp
Rcpp::List integrate_rcpp(const Rcpp::Function& f, double lower, double upper, const Rcpp::List& args);
RcppExport SEXP _fntl_integrate_rcpp(SEXP fSEXP, SEXP lowerSEXP, SEXP upperSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< double >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< double >::type upper(upperSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(integrate_rcpp(f, lower, upper, args));
    return rcpp_result_gen;
END_RCPP
}
// cg1_rcpp
Rcpp::List cg1_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::Function& g, const Rcpp::List& args);
RcppExport SEXP _fntl_cg1_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP gSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(cg1_rcpp(init, f, g, args));
    return rcpp_result_gen;
END_RCPP
}
// cg2_rcpp
Rcpp::List cg2_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::List& args);
RcppExport SEXP _fntl_cg2_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(cg2_rcpp(init, f, args));
    return rcpp_result_gen;
END_RCPP
}
// bfgs1_rcpp
Rcpp::List bfgs1_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::Function& g, const Rcpp::List& args);
RcppExport SEXP _fntl_bfgs1_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP gSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(bfgs1_rcpp(init, f, g, args));
    return rcpp_result_gen;
END_RCPP
}
// bfgs2_rcpp
Rcpp::List bfgs2_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::List& args);
RcppExport SEXP _fntl_bfgs2_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(bfgs2_rcpp(init, f, args));
    return rcpp_result_gen;
END_RCPP
}
// lbfgsb1_rcpp
Rcpp::List lbfgsb1_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::Function& g, const Rcpp::List& args);
RcppExport SEXP _fntl_lbfgsb1_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP gSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(lbfgsb1_rcpp(init, f, g, args));
    return rcpp_result_gen;
END_RCPP
}
// lbfgsb2_rcpp
Rcpp::List lbfgsb2_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::List& args);
RcppExport SEXP _fntl_lbfgsb2_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(lbfgsb2_rcpp(init, f, args));
    return rcpp_result_gen;
END_RCPP
}
// neldermead_rcpp
Rcpp::List neldermead_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::List& args);
RcppExport SEXP _fntl_neldermead_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(neldermead_rcpp(init, f, args));
    return rcpp_result_gen;
END_RCPP
}
// nlm1_rcpp
Rcpp::List nlm1_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::Function& g, const Rcpp::Function& h, const Rcpp::List& args);
RcppExport SEXP _fntl_nlm1_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP gSEXP, SEXP hSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type h(hSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(nlm1_rcpp(init, f, g, h, args));
    return rcpp_result_gen;
END_RCPP
}
// nlm2_rcpp
Rcpp::List nlm2_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::Function& g, const Rcpp::List& args);
RcppExport SEXP _fntl_nlm2_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP gSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(nlm2_rcpp(init, f, g, args));
    return rcpp_result_gen;
END_RCPP
}
// nlm3_rcpp
Rcpp::List nlm3_rcpp(const Rcpp::NumericVector& init, const Rcpp::Function& f, const Rcpp::List& args);
RcppExport SEXP _fntl_nlm3_rcpp(SEXP initSEXP, SEXP fSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(nlm3_rcpp(init, f, args));
    return rcpp_result_gen;
END_RCPP
}
// mat_apply_rcpp
Rcpp::NumericMatrix mat_apply_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f);
RcppExport SEXP _fntl_mat_apply_rcpp(SEXP XSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(mat_apply_rcpp(X, f));
    return rcpp_result_gen;
END_RCPP
}
// row_apply_rcpp
Rcpp::NumericVector row_apply_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f);
RcppExport SEXP _fntl_row_apply_rcpp(SEXP XSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(row_apply_rcpp(X, f));
    return rcpp_result_gen;
END_RCPP
}
// col_apply_rcpp
Rcpp::NumericVector col_apply_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f);
RcppExport SEXP _fntl_col_apply_rcpp(SEXP XSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(col_apply_rcpp(X, f));
    return rcpp_result_gen;
END_RCPP
}
// which_rcpp
Rcpp::IntegerMatrix which_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f);
RcppExport SEXP _fntl_which_rcpp(SEXP XSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(which_rcpp(X, f));
    return rcpp_result_gen;
END_RCPP
}
// outer1_rcpp
Rcpp::NumericMatrix outer1_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f);
RcppExport SEXP _fntl_outer1_rcpp(SEXP XSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(outer1_rcpp(X, f));
    return rcpp_result_gen;
END_RCPP
}
// outer2_rcpp
Rcpp::NumericMatrix outer2_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::NumericMatrix& Y, const Rcpp::Function& f);
RcppExport SEXP _fntl_outer2_rcpp(SEXP XSEXP, SEXP YSEXP, SEXP fSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    rcpp_result_gen = Rcpp::wrap(outer2_rcpp(X, Y, f));
    return rcpp_result_gen;
END_RCPP
}
// outer1_matvec_rcpp
Rcpp::NumericVector outer1_matvec_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f, const Rcpp::NumericVector& a);
RcppExport SEXP _fntl_outer1_matvec_rcpp(SEXP XSEXP, SEXP fSEXP, SEXP aSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type a(aSEXP);
    rcpp_result_gen = Rcpp::wrap(outer1_matvec_rcpp(X, f, a));
    return rcpp_result_gen;
END_RCPP
}
// outer2_matvec_rcpp
Rcpp::NumericVector outer2_matvec_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::NumericMatrix& Y, const Rcpp::Function& f, const Rcpp::NumericVector& a);
RcppExport SEXP _fntl_outer2_matvec_rcpp(SEXP XSEXP, SEXP YSEXP, SEXP fSEXP, SEXP aSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type a(aSEXP);
    rcpp_result_gen = Rcpp::wrap(outer2_matvec_rcpp(X, Y, f, a));
    return rcpp_result_gen;
END_RCPP
}
// outer1_triplet_rcpp
Rcpp::List outer1_triplet_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::Function& f, const Rcpp::Function& g);
RcppExport SEXP _fntl_outer1_triplet_rcpp(SEXP XSEXP, SEXP fSEXP, SEXP gSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    rcpp_result_gen = Rcpp::wrap(outer1_triplet_rcpp(X, f, g));
    return rcpp_result_gen;
END_RCPP
}
// outer2_triplet_rcpp
Rcpp::List outer2_triplet_rcpp(const Rcpp::NumericMatrix& X, const Rcpp::NumericMatrix& Y, const Rcpp::Function& f, const Rcpp::Function& g);
RcppExport SEXP _fntl_outer2_triplet_rcpp(SEXP XSEXP, SEXP YSEXP, SEXP fSEXP, SEXP gSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type X(XSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericMatrix& >::type Y(YSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type g(gSEXP);
    rcpp_result_gen = Rcpp::wrap(outer2_triplet_rcpp(X, Y, f, g));
    return rcpp_result_gen;
END_RCPP
}
// solve_cg_rcpp
Rcpp::List solve_cg_rcpp(const Rcpp::Function& l, const Rcpp::NumericVector& b, const Rcpp::NumericVector& init, const Rcpp::List& args);
RcppExport SEXP _fntl_solve_cg_rcpp(SEXP lSEXP, SEXP bSEXP, SEXP initSEXP, SEXP argsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type l(lSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type b(bSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type init(initSEXP);
    Rcpp::traits::input_parameter< const Rcpp::List& >::type args(argsSEXP);
    rcpp_result_gen = Rcpp::wrap(solve_cg_rcpp(l, b, init, args));
    return rcpp_result_gen;
END_RCPP
}
// d_trunc_rcpp
Rcpp::NumericVector d_trunc_rcpp(const Rcpp::NumericVector& x, const Rcpp::NumericVector& lo, const Rcpp::NumericVector& hi, const Rcpp::Function& f, const Rcpp::Function& F, bool log);
RcppExport SEXP _fntl_d_trunc_rcpp(SEXP xSEXP, SEXP loSEXP, SEXP hiSEXP, SEXP fSEXP, SEXP FSEXP, SEXP logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type lo(loSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type hi(hiSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type f(fSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type F(FSEXP);
    Rcpp::traits::input_parameter< bool >::type log(logSEXP);
    rcpp_result_gen = Rcpp::wrap(d_trunc_rcpp(x, lo, hi, f, F, log));
    return rcpp_result_gen;
END_RCPP
}
// p_trunc_rcpp
Rcpp::NumericVector p_trunc_rcpp(const Rcpp::NumericVector& x, const Rcpp::NumericVector& lo, const Rcpp::NumericVector& hi, const Rcpp::Function& F, bool lower, bool log);
RcppExport SEXP _fntl_p_trunc_rcpp(SEXP xSEXP, SEXP loSEXP, SEXP hiSEXP, SEXP FSEXP, SEXP lowerSEXP, SEXP logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type x(xSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type lo(loSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type hi(hiSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type F(FSEXP);
    Rcpp::traits::input_parameter< bool >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< bool >::type log(logSEXP);
    rcpp_result_gen = Rcpp::wrap(p_trunc_rcpp(x, lo, hi, F, lower, log));
    return rcpp_result_gen;
END_RCPP
}
// q_trunc_rcpp
Rcpp::NumericVector q_trunc_rcpp(const Rcpp::NumericVector& p, const Rcpp::NumericVector& lo, const Rcpp::NumericVector& hi, const Rcpp::Function& F, const Rcpp::Function& Finv, bool lower, bool log);
RcppExport SEXP _fntl_q_trunc_rcpp(SEXP pSEXP, SEXP loSEXP, SEXP hiSEXP, SEXP FSEXP, SEXP FinvSEXP, SEXP lowerSEXP, SEXP logSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type p(pSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type lo(loSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type hi(hiSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type F(FSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type Finv(FinvSEXP);
    Rcpp::traits::input_parameter< bool >::type lower(lowerSEXP);
    Rcpp::traits::input_parameter< bool >::type log(logSEXP);
    rcpp_result_gen = Rcpp::wrap(q_trunc_rcpp(p, lo, hi, F, Finv, lower, log));
    return rcpp_result_gen;
END_RCPP
}
// r_trunc_rcpp
Rcpp::NumericVector r_trunc_rcpp(unsigned int n, const Rcpp::NumericVector& lo, const Rcpp::NumericVector& hi, const Rcpp::Function& F, const Rcpp::Function& Finv);
RcppExport SEXP _fntl_r_trunc_rcpp(SEXP nSEXP, SEXP loSEXP, SEXP hiSEXP, SEXP FSEXP, SEXP FinvSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< unsigned int >::type n(nSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type lo(loSEXP);
    Rcpp::traits::input_parameter< const Rcpp::NumericVector& >::type hi(hiSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type F(FSEXP);
    Rcpp::traits::input_parameter< const Rcpp::Function& >::type Finv(FinvSEXP);
    rcpp_result_gen = Rcpp::wrap(r_trunc_rcpp(n, lo, hi, F, Finv));
    return rcpp_result_gen;
END_RCPP
}
// findroot_args_rcpp
Rcpp::List findroot_args_rcpp();
RcppExport SEXP _fntl_findroot_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(findroot_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// optimize_args_rcpp
Rcpp::List optimize_args_rcpp();
RcppExport SEXP _fntl_optimize_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(optimize_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// integrate_args_rcpp
Rcpp::List integrate_args_rcpp();
RcppExport SEXP _fntl_integrate_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(integrate_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// cg_args_rcpp
Rcpp::List cg_args_rcpp();
RcppExport SEXP _fntl_cg_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(cg_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// bfgs_args_rcpp
Rcpp::List bfgs_args_rcpp();
RcppExport SEXP _fntl_bfgs_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(bfgs_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// lbfgsb_args_rcpp
Rcpp::List lbfgsb_args_rcpp();
RcppExport SEXP _fntl_lbfgsb_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(lbfgsb_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// neldermead_args_rcpp
Rcpp::List neldermead_args_rcpp();
RcppExport SEXP _fntl_neldermead_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(neldermead_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// nlm_args_rcpp
Rcpp::List nlm_args_rcpp();
RcppExport SEXP _fntl_nlm_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(nlm_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}
// richardson_args_rcpp
Rcpp::List richardson_args_rcpp();
RcppExport SEXP _fntl_richardson_args_rcpp() {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    rcpp_result_gen = Rcpp::wrap(richardson_args_rcpp());
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_fntl_fd_deriv_rcpp", (DL_FUNC) &_fntl_fd_deriv_rcpp, 5},
    {"_fntl_fd_deriv2_rcpp", (DL_FUNC) &_fntl_fd_deriv2_rcpp, 7},
    {"_fntl_deriv_rcpp", (DL_FUNC) &_fntl_deriv_rcpp, 5},
    {"_fntl_deriv2_rcpp", (DL_FUNC) &_fntl_deriv2_rcpp, 6},
    {"_fntl_gradient_rcpp", (DL_FUNC) &_fntl_gradient_rcpp, 3},
    {"_fntl_jacobian_rcpp", (DL_FUNC) &_fntl_jacobian_rcpp, 3},
    {"_fntl_hessian_rcpp", (DL_FUNC) &_fntl_hessian_rcpp, 3},
    {"_fntl_findroot_bisect_rcpp", (DL_FUNC) &_fntl_findroot_bisect_rcpp, 4},
    {"_fntl_findroot_brent_rcpp", (DL_FUNC) &_fntl_findroot_brent_rcpp, 4},
    {"_fntl_goldensection_rcpp", (DL_FUNC) &_fntl_goldensection_rcpp, 4},
    {"_fntl_optimize_brent_rcpp", (DL_FUNC) &_fntl_optimize_brent_rcpp, 4},
    {"_fntl_integrate_rcpp", (DL_FUNC) &_fntl_integrate_rcpp, 4},
    {"_fntl_cg1_rcpp", (DL_FUNC) &_fntl_cg1_rcpp, 4},
    {"_fntl_cg2_rcpp", (DL_FUNC) &_fntl_cg2_rcpp, 3},
    {"_fntl_bfgs1_rcpp", (DL_FUNC) &_fntl_bfgs1_rcpp, 4},
    {"_fntl_bfgs2_rcpp", (DL_FUNC) &_fntl_bfgs2_rcpp, 3},
    {"_fntl_lbfgsb1_rcpp", (DL_FUNC) &_fntl_lbfgsb1_rcpp, 4},
    {"_fntl_lbfgsb2_rcpp", (DL_FUNC) &_fntl_lbfgsb2_rcpp, 3},
    {"_fntl_neldermead_rcpp", (DL_FUNC) &_fntl_neldermead_rcpp, 3},
    {"_fntl_nlm1_rcpp", (DL_FUNC) &_fntl_nlm1_rcpp, 5},
    {"_fntl_nlm2_rcpp", (DL_FUNC) &_fntl_nlm2_rcpp, 4},
    {"_fntl_nlm3_rcpp", (DL_FUNC) &_fntl_nlm3_rcpp, 3},
    {"_fntl_mat_apply_rcpp", (DL_FUNC) &_fntl_mat_apply_rcpp, 2},
    {"_fntl_row_apply_rcpp", (DL_FUNC) &_fntl_row_apply_rcpp, 2},
    {"_fntl_col_apply_rcpp", (DL_FUNC) &_fntl_col_apply_rcpp, 2},
    {"_fntl_which_rcpp", (DL_FUNC) &_fntl_which_rcpp, 2},
    {"_fntl_outer1_rcpp", (DL_FUNC) &_fntl_outer1_rcpp, 2},
    {"_fntl_outer2_rcpp", (DL_FUNC) &_fntl_outer2_rcpp, 3},
    {"_fntl_outer1_matvec_rcpp", (DL_FUNC) &_fntl_outer1_matvec_rcpp, 3},
    {"_fntl_outer2_matvec_rcpp", (DL_FUNC) &_fntl_outer2_matvec_rcpp, 4},
    {"_fntl_outer1_triplet_rcpp", (DL_FUNC) &_fntl_outer1_triplet_rcpp, 3},
    {"_fntl_outer2_triplet_rcpp", (DL_FUNC) &_fntl_outer2_triplet_rcpp, 4},
    {"_fntl_solve_cg_rcpp", (DL_FUNC) &_fntl_solve_cg_rcpp, 4},
    {"_fntl_d_trunc_rcpp", (DL_FUNC) &_fntl_d_trunc_rcpp, 6},
    {"_fntl_p_trunc_rcpp", (DL_FUNC) &_fntl_p_trunc_rcpp, 6},
    {"_fntl_q_trunc_rcpp", (DL_FUNC) &_fntl_q_trunc_rcpp, 7},
    {"_fntl_r_trunc_rcpp", (DL_FUNC) &_fntl_r_trunc_rcpp, 5},
    {"_fntl_findroot_args_rcpp", (DL_FUNC) &_fntl_findroot_args_rcpp, 0},
    {"_fntl_optimize_args_rcpp", (DL_FUNC) &_fntl_optimize_args_rcpp, 0},
    {"_fntl_integrate_args_rcpp", (DL_FUNC) &_fntl_integrate_args_rcpp, 0},
    {"_fntl_cg_args_rcpp", (DL_FUNC) &_fntl_cg_args_rcpp, 0},
    {"_fntl_bfgs_args_rcpp", (DL_FUNC) &_fntl_bfgs_args_rcpp, 0},
    {"_fntl_lbfgsb_args_rcpp", (DL_FUNC) &_fntl_lbfgsb_args_rcpp, 0},
    {"_fntl_neldermead_args_rcpp", (DL_FUNC) &_fntl_neldermead_args_rcpp, 0},
    {"_fntl_nlm_args_rcpp", (DL_FUNC) &_fntl_nlm_args_rcpp, 0},
    {"_fntl_richardson_args_rcpp", (DL_FUNC) &_fntl_richardson_args_rcpp, 0},
    {NULL, NULL, 0}
};

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