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

// rcpp_new_optimization_problem
SEXP rcpp_new_optimization_problem(std::size_t nrow, std::size_t ncol, std::size_t ncell);
RcppExport SEXP _multiscape_rcpp_new_optimization_problem(SEXP nrowSEXP, SEXP ncolSEXP, SEXP ncellSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< std::size_t >::type nrow(nrowSEXP);
    Rcpp::traits::input_parameter< std::size_t >::type ncol(ncolSEXP);
    Rcpp::traits::input_parameter< std::size_t >::type ncell(ncellSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_new_optimization_problem(nrow, ncol, ncell));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_optimization_problem_as_list
Rcpp::List rcpp_optimization_problem_as_list(SEXP x);
RcppExport SEXP _multiscape_rcpp_optimization_problem_as_list(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_optimization_problem_as_list(x));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_get_optimization_problem_ncol
std::size_t rcpp_get_optimization_problem_ncol(SEXP x);
RcppExport SEXP _multiscape_rcpp_get_optimization_problem_ncol(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_get_optimization_problem_ncol(x));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_get_optimization_problem_nrow
std::size_t rcpp_get_optimization_problem_nrow(SEXP x);
RcppExport SEXP _multiscape_rcpp_get_optimization_problem_nrow(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_get_optimization_problem_nrow(x));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_get_optimization_problem_ncell
std::size_t rcpp_get_optimization_problem_ncell(SEXP x);
RcppExport SEXP _multiscape_rcpp_get_optimization_problem_ncell(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_get_optimization_problem_ncell(x));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_get_optimization_problem_A
Rcpp::List rcpp_get_optimization_problem_A(SEXP x);
RcppExport SEXP _multiscape_rcpp_get_optimization_problem_A(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_get_optimization_problem_A(x));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_action_locks
Rcpp::List rcpp_add_action_locks(SEXP x, Rcpp::DataFrame dist_actions_data);
RcppExport SEXP _multiscape_rcpp_add_action_locks(SEXP xSEXP, SEXP dist_actions_dataSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_action_locks(x, dist_actions_data));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_action_max_per_pu
Rcpp::List rcpp_add_action_max_per_pu(SEXP x, Rcpp::DataFrame dist_actions_data, int max_per_pu, Rcpp::IntegerVector internal_pu_ids, Rcpp::IntegerVector internal_action_ids);
RcppExport SEXP _multiscape_rcpp_add_action_max_per_pu(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP max_per_puSEXP, SEXP internal_pu_idsSEXP, SEXP internal_action_idsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< int >::type max_per_pu(max_per_puSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type internal_pu_ids(internal_pu_idsSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type internal_action_ids(internal_action_idsSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_action_max_per_pu(x, dist_actions_data, max_per_pu, internal_pu_ids, internal_action_ids));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_base_variables
Rcpp::List rcpp_add_base_variables(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_features_data, bool add_z);
RcppExport SEXP _multiscape_rcpp_add_base_variables(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_features_dataSEXP, SEXP add_zSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_features_data(dist_features_dataSEXP);
    Rcpp::traits::input_parameter< bool >::type add_z(add_zSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_base_variables(x, pu_data, dist_actions_data, dist_features_data, add_z));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_linear_constraint
Rcpp::List rcpp_add_linear_constraint(SEXP model_ptr, Rcpp::IntegerVector j0, Rcpp::NumericVector x, std::string sense, double rhs, std::string name, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_linear_constraint(SEXP model_ptrSEXP, SEXP j0SEXP, SEXP xSEXP, SEXP senseSEXP, SEXP rhsSEXP, SEXP nameSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type model_ptr(model_ptrSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type j0(j0SEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< std::string >::type sense(senseSEXP);
    Rcpp::traits::input_parameter< double >::type rhs(rhsSEXP);
    Rcpp::traits::input_parameter< std::string >::type name(nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_linear_constraint(model_ptr, j0, x, sense, rhs, name, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_linking_w_le_sum_x
Rcpp::List rcpp_add_linking_w_le_sum_x(SEXP x, Rcpp::DataFrame dist_actions_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_linking_w_le_sum_x(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_linking_w_le_sum_x(x, dist_actions_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_linking_x_le_w
Rcpp::List rcpp_add_linking_x_le_w(SEXP x, Rcpp::DataFrame dist_actions_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_linking_x_le_w(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_linking_x_le_w(x, dist_actions_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_linking_z_le_w
Rcpp::List rcpp_add_linking_z_le_w(SEXP x, Rcpp::DataFrame dist_features_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_linking_z_le_w(SEXP xSEXP, SEXP dist_features_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_features_data(dist_features_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_linking_z_le_w(x, dist_features_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_max_benefit
Rcpp::List rcpp_add_objective_max_benefit(SEXP x, Rcpp::NumericVector coef_x, double weight, double weight_multiplier, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_max_benefit(SEXP xSEXP, SEXP coef_xSEXP, SEXP weightSEXP, SEXP weight_multiplierSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type coef_x(coef_xSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< double >::type weight_multiplier(weight_multiplierSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_max_benefit(x, coef_x, weight, weight_multiplier, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_max_net_profit
Rcpp::List rcpp_add_objective_max_net_profit(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_profit_data, std::string profit_col, bool include_pu_cost, bool include_action_cost, double weight, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_max_net_profit(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_profit_dataSEXP, SEXP profit_colSEXP, SEXP include_pu_costSEXP, SEXP include_action_costSEXP, SEXP weightSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_profit_data(dist_profit_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type profit_col(profit_colSEXP);
    Rcpp::traits::input_parameter< bool >::type include_pu_cost(include_pu_costSEXP);
    Rcpp::traits::input_parameter< bool >::type include_action_cost(include_action_costSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_max_net_profit(x, pu_data, dist_actions_data, dist_profit_data, profit_col, include_pu_cost, include_action_cost, weight, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_max_profit
Rcpp::List rcpp_add_objective_max_profit(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_profit_data, std::string profit_col, double weight, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_max_profit(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP dist_profit_dataSEXP, SEXP profit_colSEXP, SEXP weightSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_profit_data(dist_profit_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type profit_col(profit_colSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_max_profit(x, dist_actions_data, dist_profit_data, profit_col, weight, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_min_cost
Rcpp::List rcpp_add_objective_min_cost(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, double weight, bool include_pu_cost, bool include_action_cost, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_min_cost(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP weightSEXP, SEXP include_pu_costSEXP, SEXP include_action_costSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< bool >::type include_pu_cost(include_pu_costSEXP);
    Rcpp::traits::input_parameter< bool >::type include_action_cost(include_action_costSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_min_cost(x, pu_data, dist_actions_data, weight, include_pu_cost, include_action_cost, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_min_fragmentation
Rcpp::List rcpp_add_objective_min_fragmentation(SEXP x, Rcpp::DataFrame relation_data, double weight, double weight_multiplier, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_min_fragmentation(SEXP xSEXP, SEXP relation_dataSEXP, SEXP weightSEXP, SEXP weight_multiplierSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type relation_data(relation_dataSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< double >::type weight_multiplier(weight_multiplierSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_min_fragmentation(x, relation_data, weight, weight_multiplier, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_min_fragmentation_actions
Rcpp::List rcpp_add_objective_min_fragmentation_actions(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame relation_data, Rcpp::Nullable<Rcpp::IntegerVector> actions_to_use, Rcpp::Nullable<Rcpp::NumericVector> action_weights, double weight, double weight_multiplier, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_min_fragmentation_actions(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP relation_dataSEXP, SEXP actions_to_useSEXP, SEXP action_weightsSEXP, SEXP weightSEXP, SEXP weight_multiplierSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type relation_data(relation_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type actions_to_use(actions_to_useSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::NumericVector> >::type action_weights(action_weightsSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< double >::type weight_multiplier(weight_multiplierSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_min_fragmentation_actions(x, dist_actions_data, relation_data, actions_to_use, action_weights, weight, weight_multiplier, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_min_intervention_impact
Rcpp::List rcpp_add_objective_min_intervention_impact(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_features_data, Rcpp::String subset_key, std::string impact_col, Rcpp::IntegerVector features_to_use, Rcpp::IntegerVector actions_to_use, std::string internal_feature_col, double weight, double weight_multiplier, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_min_intervention_impact(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_features_dataSEXP, SEXP subset_keySEXP, SEXP impact_colSEXP, SEXP features_to_useSEXP, SEXP actions_to_useSEXP, SEXP internal_feature_colSEXP, SEXP weightSEXP, SEXP weight_multiplierSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_features_data(dist_features_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::String >::type subset_key(subset_keySEXP);
    Rcpp::traits::input_parameter< std::string >::type impact_col(impact_colSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type features_to_use(features_to_useSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type actions_to_use(actions_to_useSEXP);
    Rcpp::traits::input_parameter< std::string >::type internal_feature_col(internal_feature_colSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< double >::type weight_multiplier(weight_multiplierSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_min_intervention_impact(x, pu_data, dist_actions_data, dist_features_data, subset_key, impact_col, features_to_use, actions_to_use, internal_feature_col, weight, weight_multiplier, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_objective_min_loss
Rcpp::List rcpp_add_objective_min_loss(SEXP x, Rcpp::NumericVector coef_x, double weight, double weight_multiplier, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_objective_min_loss(SEXP xSEXP, SEXP coef_xSEXP, SEXP weightSEXP, SEXP weight_multiplierSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type coef_x(coef_xSEXP);
    Rcpp::traits::input_parameter< double >::type weight(weightSEXP);
    Rcpp::traits::input_parameter< double >::type weight_multiplier(weight_multiplierSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_objective_min_loss(x, coef_x, weight, weight_multiplier, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_pu_locks
Rcpp::List rcpp_add_pu_locks(SEXP x, Rcpp::DataFrame pu_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_add_pu_locks(SEXP xSEXP, SEXP pu_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_pu_locks(x, pu_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_target_recovery
Rcpp::List rcpp_add_target_recovery(SEXP x, Rcpp::DataFrame features_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_benefit_data, std::string target_col, double tol);
RcppExport SEXP _multiscape_rcpp_add_target_recovery(SEXP xSEXP, SEXP features_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_benefit_dataSEXP, SEXP target_colSEXP, SEXP tolSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type features_data(features_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_benefit_data(dist_benefit_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type target_col(target_colSEXP);
    Rcpp::traits::input_parameter< double >::type tol(tolSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_add_target_recovery(x, features_data, dist_actions_data, dist_benefit_data, target_col, tol));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_fix_z_ineligible_by_positive_delta
Rcpp::List rcpp_fix_z_ineligible_by_positive_delta(SEXP x, Rcpp::DataFrame dist_features_data, Rcpp::DataFrame dist_benefit_data, bool fix_lb_too, double eps);
RcppExport SEXP _multiscape_rcpp_fix_z_ineligible_by_positive_delta(SEXP xSEXP, SEXP dist_features_dataSEXP, SEXP dist_benefit_dataSEXP, SEXP fix_lb_tooSEXP, SEXP epsSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_features_data(dist_features_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_benefit_data(dist_benefit_dataSEXP);
    Rcpp::traits::input_parameter< bool >::type fix_lb_too(fix_lb_tooSEXP);
    Rcpp::traits::input_parameter< double >::type eps(epsSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_fix_z_ineligible_by_positive_delta(x, dist_features_data, dist_benefit_data, fix_lb_too, eps));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_model_add_columns
Rcpp::List rcpp_model_add_columns(SEXP x, Rcpp::NumericVector obj, Rcpp::NumericVector lb, Rcpp::NumericVector ub, Rcpp::CharacterVector vtype, Rcpp::CharacterVector names, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_model_add_columns(SEXP xSEXP, SEXP objSEXP, SEXP lbSEXP, SEXP ubSEXP, SEXP vtypeSEXP, SEXP namesSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type obj(objSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type lb(lbSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type ub(ubSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type vtype(vtypeSEXP);
    Rcpp::traits::input_parameter< Rcpp::CharacterVector >::type names(namesSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_model_add_columns(x, obj, lb, ub, vtype, names, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_model_set_objective_vector
void rcpp_model_set_objective_vector(SEXP x, Rcpp::NumericVector obj, std::string model_sense);
RcppExport SEXP _multiscape_rcpp_model_set_objective_vector(SEXP xSEXP, SEXP objSEXP, SEXP model_senseSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type obj(objSEXP);
    Rcpp::traits::input_parameter< std::string >::type model_sense(model_senseSEXP);
    rcpp_model_set_objective_vector(x, obj, model_sense);
    return R_NilValue;
END_RCPP
}
// rcpp_reset_objective
Rcpp::List rcpp_reset_objective(SEXP x, std::string modelsense);
RcppExport SEXP _multiscape_rcpp_reset_objective(SEXP xSEXP, SEXP modelsenseSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< std::string >::type modelsense(modelsenseSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_reset_objective(x, modelsense));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_add_to_objective
void rcpp_add_to_objective(SEXP x, Rcpp::IntegerVector ind, Rcpp::NumericVector val);
RcppExport SEXP _multiscape_rcpp_add_to_objective(SEXP xSEXP, SEXP indSEXP, SEXP valSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type ind(indSEXP);
    Rcpp::traits::input_parameter< Rcpp::NumericVector >::type val(valSEXP);
    rcpp_add_to_objective(x, ind, val);
    return R_NilValue;
END_RCPP
}
// rcpp_add_to_objective_scalar
void rcpp_add_to_objective_scalar(SEXP x, int ind1, double val);
RcppExport SEXP _multiscape_rcpp_add_to_objective_scalar(SEXP xSEXP, SEXP ind1SEXP, SEXP valSEXP) {
BEGIN_RCPP
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< int >::type ind1(ind1SEXP);
    Rcpp::traits::input_parameter< double >::type val(valSEXP);
    rcpp_add_to_objective_scalar(x, ind1, val);
    return R_NilValue;
END_RCPP
}
// rcpp_prepare_objective_max_benefit
Rcpp::List rcpp_prepare_objective_max_benefit(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_effects_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_max_benefit(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP dist_effects_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_effects_data(dist_effects_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_max_benefit(x, dist_actions_data, dist_effects_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_max_net_profit
Rcpp::List rcpp_prepare_objective_max_net_profit(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_profit_data, std::string profit_col, bool include_pu_cost, bool include_action_cost, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_max_net_profit(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_profit_dataSEXP, SEXP profit_colSEXP, SEXP include_pu_costSEXP, SEXP include_action_costSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_profit_data(dist_profit_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type profit_col(profit_colSEXP);
    Rcpp::traits::input_parameter< bool >::type include_pu_cost(include_pu_costSEXP);
    Rcpp::traits::input_parameter< bool >::type include_action_cost(include_action_costSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_max_net_profit(x, pu_data, dist_actions_data, dist_profit_data, profit_col, include_pu_cost, include_action_cost, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_max_profit
bool rcpp_prepare_objective_max_profit(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_profit_data, std::string profit_col, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_max_profit(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP dist_profit_dataSEXP, SEXP profit_colSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_profit_data(dist_profit_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type profit_col(profit_colSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_max_profit(x, dist_actions_data, dist_profit_data, profit_col, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_min_cost
Rcpp::List rcpp_prepare_objective_min_cost(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, bool include_pu_cost, bool include_action_cost, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_min_cost(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP include_pu_costSEXP, SEXP include_action_costSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< bool >::type include_pu_cost(include_pu_costSEXP);
    Rcpp::traits::input_parameter< bool >::type include_action_cost(include_action_costSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_min_cost(x, pu_data, dist_actions_data, include_pu_cost, include_action_cost, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_min_fragmentation
Rcpp::List rcpp_prepare_objective_min_fragmentation(SEXP x, Rcpp::DataFrame relation_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_min_fragmentation(SEXP xSEXP, SEXP relation_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type relation_data(relation_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_min_fragmentation(x, relation_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_min_fragmentation_actions
Rcpp::List rcpp_prepare_objective_min_fragmentation_actions(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame relation_data, Rcpp::Nullable<Rcpp::IntegerVector> actions_to_use, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_min_fragmentation_actions(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP relation_dataSEXP, SEXP actions_to_useSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type relation_data(relation_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::Nullable<Rcpp::IntegerVector> >::type actions_to_use(actions_to_useSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_min_fragmentation_actions(x, dist_actions_data, relation_data, actions_to_use, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_min_intervention_impact
Rcpp::List rcpp_prepare_objective_min_intervention_impact(SEXP x, Rcpp::DataFrame pu_data, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_features_data, std::string subset_key, std::string impact_col, Rcpp::IntegerVector features_to_use, Rcpp::IntegerVector actions_to_use, std::string internal_feature_col, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_min_intervention_impact(SEXP xSEXP, SEXP pu_dataSEXP, SEXP dist_actions_dataSEXP, SEXP dist_features_dataSEXP, SEXP subset_keySEXP, SEXP impact_colSEXP, SEXP features_to_useSEXP, SEXP actions_to_useSEXP, SEXP internal_feature_colSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type pu_data(pu_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_features_data(dist_features_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type subset_key(subset_keySEXP);
    Rcpp::traits::input_parameter< std::string >::type impact_col(impact_colSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type features_to_use(features_to_useSEXP);
    Rcpp::traits::input_parameter< Rcpp::IntegerVector >::type actions_to_use(actions_to_useSEXP);
    Rcpp::traits::input_parameter< std::string >::type internal_feature_col(internal_feature_colSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_min_intervention_impact(x, pu_data, dist_actions_data, dist_features_data, subset_key, impact_col, features_to_use, actions_to_use, internal_feature_col, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
// rcpp_prepare_objective_min_loss
Rcpp::List rcpp_prepare_objective_min_loss(SEXP x, Rcpp::DataFrame dist_actions_data, Rcpp::DataFrame dist_effects_data, std::string block_name, std::string tag);
RcppExport SEXP _multiscape_rcpp_prepare_objective_min_loss(SEXP xSEXP, SEXP dist_actions_dataSEXP, SEXP dist_effects_dataSEXP, SEXP block_nameSEXP, SEXP tagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< SEXP >::type x(xSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_actions_data(dist_actions_dataSEXP);
    Rcpp::traits::input_parameter< Rcpp::DataFrame >::type dist_effects_data(dist_effects_dataSEXP);
    Rcpp::traits::input_parameter< std::string >::type block_name(block_nameSEXP);
    Rcpp::traits::input_parameter< std::string >::type tag(tagSEXP);
    rcpp_result_gen = Rcpp::wrap(rcpp_prepare_objective_min_loss(x, dist_actions_data, dist_effects_data, block_name, tag));
    return rcpp_result_gen;
END_RCPP
}
