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

#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

// cpp_n_annotations
IntegerVector cpp_n_annotations(S4 dag, bool unify);
RcppExport SEXP _simona_cpp_n_annotations(SEXP dagSEXP, SEXP unifySEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type unify(unifySEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_annotations(dag, unify));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_annotations_with_intersect
IntegerVector cpp_n_annotations_with_intersect(S4 dag, IntegerVector anno_id);
RcppExport SEXP _simona_cpp_n_annotations_with_intersect(SEXP dagSEXP, SEXP anno_idSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type anno_id(anno_idSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_annotations_with_intersect(dag, anno_id));
    return rcpp_result_gen;
END_RCPP
}
// cpp_get_term_annotations
IntegerMatrix cpp_get_term_annotations(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_get_term_annotations(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_get_term_annotations(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_get_annotated_terms
IntegerMatrix cpp_get_annotated_terms(S4 dag, IntegerVector anno_id);
RcppExport SEXP _simona_cpp_get_annotated_terms(SEXP dagSEXP, SEXP anno_idSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type anno_id(anno_idSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_get_annotated_terms(dag, anno_id));
    return rcpp_result_gen;
END_RCPP
}
// cpp_max_ancestor_v
NumericMatrix cpp_max_ancestor_v(S4 dag, IntegerVector nodes, NumericVector v);
RcppExport SEXP _simona_cpp_max_ancestor_v(SEXP dagSEXP, SEXP nodesSEXP, SEXP vSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type v(vSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_max_ancestor_v(dag, nodes, v));
    return rcpp_result_gen;
END_RCPP
}
// cpp_max_ancestor_id
IntegerMatrix cpp_max_ancestor_id(S4 dag, IntegerVector nodes, NumericVector v, bool use_max_dist);
RcppExport SEXP _simona_cpp_max_ancestor_id(SEXP dagSEXP, SEXP nodesSEXP, SEXP vSEXP, SEXP use_max_distSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type v(vSEXP);
    Rcpp::traits::input_parameter< bool >::type use_max_dist(use_max_distSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_max_ancestor_id(dag, nodes, v, use_max_dist));
    return rcpp_result_gen;
END_RCPP
}
// cpp_max_ancestor_path_sum_value
NumericMatrix cpp_max_ancestor_path_sum_value(S4 dag, IntegerVector nodes, NumericVector v, NumericVector addv, bool use_max_dist);
RcppExport SEXP _simona_cpp_max_ancestor_path_sum_value(SEXP dagSEXP, SEXP nodesSEXP, SEXP vSEXP, SEXP addvSEXP, SEXP use_max_distSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type v(vSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type addv(addvSEXP);
    Rcpp::traits::input_parameter< bool >::type use_max_dist(use_max_distSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_max_ancestor_path_sum_value(dag, nodes, v, addv, use_max_dist));
    return rcpp_result_gen;
END_RCPP
}
// cpp_longest_distances_from_LCA
List cpp_longest_distances_from_LCA(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_longest_distances_from_LCA(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_longest_distances_from_LCA(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_longest_distances_directed
IntegerMatrix cpp_longest_distances_directed(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_longest_distances_directed(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_longest_distances_directed(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_shortest_distances_directed
IntegerMatrix cpp_shortest_distances_directed(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_shortest_distances_directed(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_shortest_distances_directed(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_nearest_common_ancestor
IntegerMatrix cpp_nearest_common_ancestor(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_nearest_common_ancestor(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_nearest_common_ancestor(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_shortest_distances_via_NCA
IntegerMatrix cpp_shortest_distances_via_NCA(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_shortest_distances_via_NCA(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_shortest_distances_via_NCA(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_shortest_path_length
int cpp_tpl_shortest_path_length(S4 dag, int from, int to);
RcppExport SEXP _simona_cpp_tpl_shortest_path_length(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_shortest_path_length(dag, from, to));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_longest_path_length
int cpp_tpl_longest_path_length(S4 dag, int from, int to);
RcppExport SEXP _simona_cpp_tpl_longest_path_length(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_longest_path_length(dag, from, to));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_shortest_path
IntegerVector cpp_tpl_shortest_path(S4 dag, int from, int to);
RcppExport SEXP _simona_cpp_tpl_shortest_path(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_shortest_path(dag, from, to));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_longest_path
IntegerVector cpp_tpl_longest_path(S4 dag, int from, int to);
RcppExport SEXP _simona_cpp_tpl_longest_path(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_longest_path(dag, from, to));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_shortest_path_sum_value
double cpp_tpl_shortest_path_sum_value(S4 dag, int from, int to, NumericVector value);
RcppExport SEXP _simona_cpp_tpl_shortest_path_sum_value(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP valueSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type value(valueSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_shortest_path_sum_value(dag, from, to, value));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tpl_longest_path_sum_value
double cpp_tpl_longest_path_sum_value(S4 dag, int from, int to, NumericVector value);
RcppExport SEXP _simona_cpp_tpl_longest_path_sum_value(SEXP dagSEXP, SEXP fromSEXP, SEXP toSEXP, SEXP valueSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from(fromSEXP);
    Rcpp::traits::input_parameter< int >::type to(toSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type value(valueSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tpl_longest_path_sum_value(dag, from, to, value));
    return rcpp_result_gen;
END_RCPP
}
// intersectToList_logical
List intersectToList_logical(List lt, StringVector x);
RcppExport SEXP _simona_intersectToList_logical(SEXP ltSEXP, SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt(ltSEXP);
    Rcpp::traits::input_parameter< StringVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(intersectToList_logical(lt, x));
    return rcpp_result_gen;
END_RCPP
}
// cpp_partition_by_size
IntegerVector cpp_partition_by_size(S4 tree, int size);
RcppExport SEXP _simona_cpp_partition_by_size(SEXP treeSEXP, SEXP sizeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< int >::type size(sizeSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_partition_by_size(tree, size));
    return rcpp_result_gen;
END_RCPP
}
// cpp_random_aggregatioin
NumericMatrix cpp_random_aggregatioin(IntegerVector size, NumericVector value, int perm);
RcppExport SEXP _simona_cpp_random_aggregatioin(SEXP sizeSEXP, SEXP valueSEXP, SEXP permSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type size(sizeSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type value(valueSEXP);
    Rcpp::traits::input_parameter< int >::type perm(permSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_random_aggregatioin(size, value, perm));
    return rcpp_result_gen;
END_RCPP
}
// cpp_node_pos_in_tree
DataFrame cpp_node_pos_in_tree(S4 tree, IntegerVector bin_size, double start, double end);
RcppExport SEXP _simona_cpp_node_pos_in_tree(SEXP treeSEXP, SEXP bin_sizeSEXP, SEXP startSEXP, SEXP endSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type bin_size(bin_sizeSEXP);
    Rcpp::traits::input_parameter< double >::type start(startSEXP);
    Rcpp::traits::input_parameter< double >::type end(endSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_node_pos_in_tree(tree, bin_size, start, end));
    return rcpp_result_gen;
END_RCPP
}
// cpp_calc_n_neighbours
IntegerVector cpp_calc_n_neighbours(NumericVector x, double range);
RcppExport SEXP _simona_cpp_calc_n_neighbours(SEXP xSEXP, SEXP rangeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< double >::type range(rangeSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_calc_n_neighbours(x, range));
    return rcpp_result_gen;
END_RCPP
}
// cpp_reorder_by_score
List cpp_reorder_by_score(List lt_children, NumericVector score);
RcppExport SEXP _simona_cpp_reorder_by_score(SEXP lt_childrenSEXP, SEXP scoreSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt_children(lt_childrenSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type score(scoreSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_reorder_by_score(lt_children, score));
    return rcpp_result_gen;
END_RCPP
}
// cpp_permutate_children
List cpp_permutate_children(List lt_children);
RcppExport SEXP _simona_cpp_permutate_children(SEXP lt_childrenSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt_children(lt_childrenSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_permutate_children(lt_children));
    return rcpp_result_gen;
END_RCPP
}
// cpp_get_force_counterpart
List cpp_get_force_counterpart(List lt_children_dag, List lt_parents_dag, List lt_children_tree, List lt_parents_tree, int root);
RcppExport SEXP _simona_cpp_get_force_counterpart(SEXP lt_children_dagSEXP, SEXP lt_parents_dagSEXP, SEXP lt_children_treeSEXP, SEXP lt_parents_treeSEXP, SEXP rootSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt_children_dag(lt_children_dagSEXP);
    Rcpp::traits::input_parameter< List >::type lt_parents_dag(lt_parents_dagSEXP);
    Rcpp::traits::input_parameter< List >::type lt_children_tree(lt_children_treeSEXP);
    Rcpp::traits::input_parameter< List >::type lt_parents_tree(lt_parents_treeSEXP);
    Rcpp::traits::input_parameter< int >::type root(rootSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_get_force_counterpart(lt_children_dag, lt_parents_dag, lt_children_tree, lt_parents_tree, root));
    return rcpp_result_gen;
END_RCPP
}
// cpp_get_force
NumericVector cpp_get_force(List lt_counterpart, NumericVector x, IntegerVector depth, bool on_circle);
RcppExport SEXP _simona_cpp_get_force(SEXP lt_counterpartSEXP, SEXP xSEXP, SEXP depthSEXP, SEXP on_circleSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt_counterpart(lt_counterpartSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type depth(depthSEXP);
    Rcpp::traits::input_parameter< bool >::type on_circle(on_circleSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_get_force(lt_counterpart, x, depth, on_circle));
    return rcpp_result_gen;
END_RCPP
}
// move_index
IntegerVector move_index(NumericVector x, IntegerVector sorted_od, int k, bool decreasing);
RcppExport SEXP _simona_move_index(SEXP xSEXP, SEXP sorted_odSEXP, SEXP kSEXP, SEXP decreasingSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type sorted_od(sorted_odSEXP);
    Rcpp::traits::input_parameter< int >::type k(kSEXP);
    Rcpp::traits::input_parameter< bool >::type decreasing(decreasingSEXP);
    rcpp_result_gen = Rcpp::wrap(move_index(x, sorted_od, k, decreasing));
    return rcpp_result_gen;
END_RCPP
}
// calc_x_offset
NumericVector calc_x_offset(IntegerVector children, IntegerVector prev_od, IntegerVector new_od, NumericVector width);
RcppExport SEXP _simona_calc_x_offset(SEXP childrenSEXP, SEXP prev_odSEXP, SEXP new_odSEXP, SEXP widthSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type children(childrenSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type prev_od(prev_odSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type new_od(new_odSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type width(widthSEXP);
    rcpp_result_gen = Rcpp::wrap(calc_x_offset(children, prev_od, new_od, width));
    return rcpp_result_gen;
END_RCPP
}
// reorder_children
IntegerVector reorder_children(IntegerVector children, IntegerVector n_cp, NumericVector force, NumericVector width, IntegerVector depth, NumericVector new_x, List lt_children);
RcppExport SEXP _simona_reorder_children(SEXP childrenSEXP, SEXP n_cpSEXP, SEXP forceSEXP, SEXP widthSEXP, SEXP depthSEXP, SEXP new_xSEXP, SEXP lt_childrenSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type children(childrenSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type n_cp(n_cpSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type force(forceSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type width(widthSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type depth(depthSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type new_x(new_xSEXP);
    Rcpp::traits::input_parameter< List >::type lt_children(lt_childrenSEXP);
    rcpp_result_gen = Rcpp::wrap(reorder_children(children, n_cp, force, width, depth, new_x, lt_children));
    return rcpp_result_gen;
END_RCPP
}
// cpp_reorder_tree_x
NumericVector cpp_reorder_tree_x(S4 tree, List lt_counterpart, NumericVector x, NumericVector width, int times);
RcppExport SEXP _simona_cpp_reorder_tree_x(SEXP treeSEXP, SEXP lt_counterpartSEXP, SEXP xSEXP, SEXP widthSEXP, SEXP timesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type tree(treeSEXP);
    Rcpp::traits::input_parameter< List >::type lt_counterpart(lt_counterpartSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type width(widthSEXP);
    Rcpp::traits::input_parameter< int >::type times(timesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_reorder_tree_x(tree, lt_counterpart, x, width, times));
    return rcpp_result_gen;
END_RCPP
}
// n_links_from_two_groups_of_nodes
int n_links_from_two_groups_of_nodes(S4 dag, IntegerVector nodes1, IntegerVector nodes2);
RcppExport SEXP _simona_n_links_from_two_groups_of_nodes(SEXP dagSEXP, SEXP nodes1SEXP, SEXP nodes2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes1(nodes1SEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes2(nodes2SEXP);
    rcpp_result_gen = Rcpp::wrap(n_links_from_two_groups_of_nodes(dag, nodes1, nodes2));
    return rcpp_result_gen;
END_RCPP
}
// cpp_sim_aic
NumericMatrix cpp_sim_aic(S4 dag, IntegerVector nodes, NumericVector ic);
RcppExport SEXP _simona_cpp_sim_aic(SEXP dagSEXP, SEXP nodesSEXP, SEXP icSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type ic(icSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_sim_aic(dag, nodes, ic));
    return rcpp_result_gen;
END_RCPP
}
// cpp_sim_wang
NumericVector cpp_sim_wang(S4 dag, IntegerVector nodes, NumericVector contribution, bool correct);
RcppExport SEXP _simona_cpp_sim_wang(SEXP dagSEXP, SEXP nodesSEXP, SEXP contributionSEXP, SEXP correctSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type contribution(contributionSEXP);
    Rcpp::traits::input_parameter< bool >::type correct(correctSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_sim_wang(dag, nodes, contribution, correct));
    return rcpp_result_gen;
END_RCPP
}
// cpp_wang_sv_to_sim
NumericMatrix cpp_wang_sv_to_sim(NumericMatrix sv);
RcppExport SEXP _simona_cpp_wang_sv_to_sim(SEXP svSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericMatrix >::type sv(svSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_wang_sv_to_sim(sv));
    return rcpp_result_gen;
END_RCPP
}
// cpp_sim_wang_edge
NumericMatrix cpp_sim_wang_edge(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_sim_wang_edge(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_sim_wang_edge(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_sim_zhong
NumericMatrix cpp_sim_zhong(S4 dag, IntegerVector nodes, bool depth_via_LCA);
RcppExport SEXP _simona_cpp_sim_zhong(SEXP dagSEXP, SEXP nodesSEXP, SEXP depth_via_LCASEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< bool >::type depth_via_LCA(depth_via_LCASEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_sim_zhong(dag, nodes, depth_via_LCA));
    return rcpp_result_gen;
END_RCPP
}
// cpp_common_ancestor_mean_IC_XGraSM
NumericMatrix cpp_common_ancestor_mean_IC_XGraSM(S4 dag, IntegerVector nodes, NumericVector ic);
RcppExport SEXP _simona_cpp_common_ancestor_mean_IC_XGraSM(SEXP dagSEXP, SEXP nodesSEXP, SEXP icSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type ic(icSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_common_ancestor_mean_IC_XGraSM(dag, nodes, ic));
    return rcpp_result_gen;
END_RCPP
}
// cpp_common_ancestor_mean_IC_EISI
NumericMatrix cpp_common_ancestor_mean_IC_EISI(S4 dag, IntegerVector nodes, NumericVector ic);
RcppExport SEXP _simona_cpp_common_ancestor_mean_IC_EISI(SEXP dagSEXP, SEXP nodesSEXP, SEXP icSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type ic(icSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_common_ancestor_mean_IC_EISI(dag, nodes, ic));
    return rcpp_result_gen;
END_RCPP
}
// cpp_sim_ancestor
NumericMatrix cpp_sim_ancestor(S4 dag, IntegerVector nodes);
RcppExport SEXP _simona_cpp_sim_ancestor(SEXP dagSEXP, SEXP nodesSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_sim_ancestor(dag, nodes));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ic_meng
NumericVector cpp_ic_meng(S4 dag, bool correct);
RcppExport SEXP _simona_cpp_ic_meng(SEXP dagSEXP, SEXP correctSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type correct(correctSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ic_meng(dag, correct));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ic_wang
NumericVector cpp_ic_wang(S4 dag, NumericVector contribution);
RcppExport SEXP _simona_cpp_ic_wang(SEXP dagSEXP, SEXP contributionSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type contribution(contributionSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ic_wang(dag, contribution));
    return rcpp_result_gen;
END_RCPP
}
// cpp_max_leaves_id
IntegerVector cpp_max_leaves_id(S4 dag, IntegerVector nodes, NumericVector v);
RcppExport SEXP _simona_cpp_max_leaves_id(SEXP dagSEXP, SEXP nodesSEXP, SEXP vSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type v(vSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_max_leaves_id(dag, nodes, v));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ancestors
IntegerVector cpp_ancestors(S4 dag, int node, bool include_self);
RcppExport SEXP _simona_cpp_ancestors(SEXP dagSEXP, SEXP nodeSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ancestors(dag, node, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ancestors_within_background
IntegerVector cpp_ancestors_within_background(S4 dag, int node, IntegerVector background, bool include_self);
RcppExport SEXP _simona_cpp_ancestors_within_background(SEXP dagSEXP, SEXP nodeSEXP, SEXP backgroundSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type background(backgroundSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ancestors_within_background(dag, node, background, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_offspring
IntegerVector cpp_offspring(S4 dag, int node, bool include_self);
RcppExport SEXP _simona_cpp_offspring(SEXP dagSEXP, SEXP nodeSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_offspring(dag, node, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_all_offspring
LogicalMatrix cpp_all_offspring(S4 dag, bool include_self);
RcppExport SEXP _simona_cpp_all_offspring(SEXP dagSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_all_offspring(dag, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_offspring_within_background
IntegerVector cpp_offspring_within_background(S4 dag, int node, IntegerVector background, bool include_self);
RcppExport SEXP _simona_cpp_offspring_within_background(SEXP dagSEXP, SEXP nodeSEXP, SEXP backgroundSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type background(backgroundSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_offspring_within_background(dag, node, background, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_connected_leaves
IntegerVector cpp_connected_leaves(S4 dag, int node);
RcppExport SEXP _simona_cpp_connected_leaves(SEXP dagSEXP, SEXP nodeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_connected_leaves(dag, node));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_ancestors
IntegerVector cpp_n_ancestors(S4 dag, bool include_self);
RcppExport SEXP _simona_cpp_n_ancestors(SEXP dagSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_ancestors(dag, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_ancestors_on_tree
IntegerVector cpp_n_ancestors_on_tree(S4 dag, bool include_self);
RcppExport SEXP _simona_cpp_n_ancestors_on_tree(SEXP dagSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_ancestors_on_tree(dag, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_offspring
IntegerVector cpp_n_offspring(S4 dag, bool include_self);
RcppExport SEXP _simona_cpp_n_offspring(SEXP dagSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_offspring(dag, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_offspring_on_tree
IntegerVector cpp_n_offspring_on_tree(S4 dag, bool include_self);
RcppExport SEXP _simona_cpp_n_offspring_on_tree(SEXP dagSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_offspring_on_tree(dag, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_offspring_with_intersect
IntegerVector cpp_n_offspring_with_intersect(S4 dag, IntegerVector nodes, bool include_self);
RcppExport SEXP _simona_cpp_n_offspring_with_intersect(SEXP dagSEXP, SEXP nodesSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_offspring_with_intersect(dag, nodes, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_leaves
IntegerVector cpp_n_leaves(S4 dag);
RcppExport SEXP _simona_cpp_n_leaves(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_leaves(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_n_leaves_on_tree
IntegerVector cpp_n_leaves_on_tree(S4 dag);
RcppExport SEXP _simona_cpp_n_leaves_on_tree(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_n_leaves_on_tree(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ancestors_of_a_group
IntegerVector cpp_ancestors_of_a_group(S4 dag, IntegerVector nodes, int type, bool include_self);
RcppExport SEXP _simona_cpp_ancestors_of_a_group(SEXP dagSEXP, SEXP nodesSEXP, SEXP typeSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< int >::type type(typeSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ancestors_of_a_group(dag, nodes, type, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_ancestors_of_two_groups
IntegerVector cpp_ancestors_of_two_groups(S4 dag, IntegerVector nodes1, IntegerVector nodes2, int type, bool include_self);
RcppExport SEXP _simona_cpp_ancestors_of_two_groups(SEXP dagSEXP, SEXP nodes1SEXP, SEXP nodes2SEXP, SEXP typeSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes1(nodes1SEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes2(nodes2SEXP);
    Rcpp::traits::input_parameter< int >::type type(typeSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_ancestors_of_two_groups(dag, nodes1, nodes2, type, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_offspring_of_a_group
IntegerVector cpp_offspring_of_a_group(S4 dag, IntegerVector nodes, bool include_self);
RcppExport SEXP _simona_cpp_offspring_of_a_group(SEXP dagSEXP, SEXP nodesSEXP, SEXP include_selfSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< bool >::type include_self(include_selfSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_offspring_of_a_group(dag, nodes, include_self));
    return rcpp_result_gen;
END_RCPP
}
// cpp_offspring_aggregate
NumericVector cpp_offspring_aggregate(S4 dag, NumericVector value, int method);
RcppExport SEXP _simona_cpp_offspring_aggregate(SEXP dagSEXP, SEXP valueSEXP, SEXP methodSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type value(valueSEXP);
    Rcpp::traits::input_parameter< int >::type method(methodSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_offspring_aggregate(dag, value, method));
    return rcpp_result_gen;
END_RCPP
}
// cpp_is_reachable
LogicalMatrix cpp_is_reachable(S4 dag, IntegerVector nodes, bool directed);
RcppExport SEXP _simona_cpp_is_reachable(SEXP dagSEXP, SEXP nodesSEXP, SEXP directedSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type nodes(nodesSEXP);
    Rcpp::traits::input_parameter< bool >::type directed(directedSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_is_reachable(dag, nodes, directed));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_depth
IntegerVector cpp_dag_depth(S4 dag);
RcppExport SEXP _simona_cpp_dag_depth(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_depth(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_dist_from_root
IntegerVector cpp_dag_dist_from_root(S4 dag);
RcppExport SEXP _simona_cpp_dag_dist_from_root(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_dist_from_root(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_longest_dist_to_offspring
IntegerVector cpp_dag_longest_dist_to_offspring(S4 dag, IntegerVector from_node, LogicalVector l_background);
RcppExport SEXP _simona_cpp_dag_longest_dist_to_offspring(SEXP dagSEXP, SEXP from_nodeSEXP, SEXP l_backgroundSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type from_node(from_nodeSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type l_background(l_backgroundSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_longest_dist_to_offspring(dag, from_node, l_background));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_shortest_dist_to_offspring
IntegerVector cpp_dag_shortest_dist_to_offspring(S4 dag, IntegerVector from_node, LogicalVector l_background);
RcppExport SEXP _simona_cpp_dag_shortest_dist_to_offspring(SEXP dagSEXP, SEXP from_nodeSEXP, SEXP l_backgroundSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type from_node(from_nodeSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type l_background(l_backgroundSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_shortest_dist_to_offspring(dag, from_node, l_background));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_height
IntegerVector cpp_dag_height(S4 dag);
RcppExport SEXP _simona_cpp_dag_height(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_height(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_dist_to_leaves
IntegerVector cpp_dag_dist_to_leaves(S4 dag);
RcppExport SEXP _simona_cpp_dag_dist_to_leaves(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_dist_to_leaves(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_longest_dist_from_ancestors
IntegerVector cpp_dag_longest_dist_from_ancestors(S4 dag, IntegerVector to_node, LogicalVector l_background);
RcppExport SEXP _simona_cpp_dag_longest_dist_from_ancestors(SEXP dagSEXP, SEXP to_nodeSEXP, SEXP l_backgroundSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type to_node(to_nodeSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type l_background(l_backgroundSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_longest_dist_from_ancestors(dag, to_node, l_background));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_shortest_dist_from_ancestors
IntegerVector cpp_dag_shortest_dist_from_ancestors(S4 dag, IntegerVector to_node, LogicalVector l_background);
RcppExport SEXP _simona_cpp_dag_shortest_dist_from_ancestors(SEXP dagSEXP, SEXP to_nodeSEXP, SEXP l_backgroundSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type to_node(to_nodeSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type l_background(l_backgroundSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_shortest_dist_from_ancestors(dag, to_node, l_background));
    return rcpp_result_gen;
END_RCPP
}
// cpp_check_cyclic_node
List cpp_check_cyclic_node(S4 dag, int node);
RcppExport SEXP _simona_cpp_check_cyclic_node(SEXP dagSEXP, SEXP nodeSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type node(nodeSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_check_cyclic_node(dag, node));
    return rcpp_result_gen;
END_RCPP
}
// cpp_dag_shortest_path_to_offspring_sum_value
List cpp_dag_shortest_path_to_offspring_sum_value(S4 dag, int from_node, NumericVector value, LogicalVector l_background);
RcppExport SEXP _simona_cpp_dag_shortest_path_to_offspring_sum_value(SEXP dagSEXP, SEXP from_nodeSEXP, SEXP valueSEXP, SEXP l_backgroundSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    Rcpp::traits::input_parameter< int >::type from_node(from_nodeSEXP);
    Rcpp::traits::input_parameter< NumericVector >::type value(valueSEXP);
    Rcpp::traits::input_parameter< LogicalVector >::type l_background(l_backgroundSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_dag_shortest_path_to_offspring_sum_value(dag, from_node, value, l_background));
    return rcpp_result_gen;
END_RCPP
}
// cpp_mark_tree_links
List cpp_mark_tree_links(S4 dag);
RcppExport SEXP _simona_cpp_mark_tree_links(SEXP dagSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< S4 >::type dag(dagSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_mark_tree_links(dag));
    return rcpp_result_gen;
END_RCPP
}
// cpp_tree_lt_parents_from_children
List cpp_tree_lt_parents_from_children(List lt_children);
RcppExport SEXP _simona_cpp_tree_lt_parents_from_children(SEXP lt_childrenSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< List >::type lt_children(lt_childrenSEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_tree_lt_parents_from_children(lt_children));
    return rcpp_result_gen;
END_RCPP
}
// cpp_match_index
IntegerVector cpp_match_index(IntegerVector ind1, IntegerVector ind2);
RcppExport SEXP _simona_cpp_match_index(SEXP ind1SEXP, SEXP ind2SEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< IntegerVector >::type ind1(ind1SEXP);
    Rcpp::traits::input_parameter< IntegerVector >::type ind2(ind2SEXP);
    rcpp_result_gen = Rcpp::wrap(cpp_match_index(ind1, ind2));
    return rcpp_result_gen;
END_RCPP
}
// cross_sum
NumericMatrix cross_sum(NumericVector x);
RcppExport SEXP _simona_cross_sum(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(cross_sum(x));
    return rcpp_result_gen;
END_RCPP
}
// cross_multiply
NumericMatrix cross_multiply(NumericVector x);
RcppExport SEXP _simona_cross_multiply(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(cross_multiply(x));
    return rcpp_result_gen;
END_RCPP
}
// cross_minus
NumericMatrix cross_minus(NumericVector x);
RcppExport SEXP _simona_cross_minus(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(cross_minus(x));
    return rcpp_result_gen;
END_RCPP
}
// cross_max
NumericMatrix cross_max(NumericVector x);
RcppExport SEXP _simona_cross_max(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(cross_max(x));
    return rcpp_result_gen;
END_RCPP
}
// cross_min
NumericMatrix cross_min(NumericVector x);
RcppExport SEXP _simona_cross_min(SEXP xSEXP) {
BEGIN_RCPP
    Rcpp::RObject rcpp_result_gen;
    Rcpp::RNGScope rcpp_rngScope_gen;
    Rcpp::traits::input_parameter< NumericVector >::type x(xSEXP);
    rcpp_result_gen = Rcpp::wrap(cross_min(x));
    return rcpp_result_gen;
END_RCPP
}

static const R_CallMethodDef CallEntries[] = {
    {"_simona_cpp_n_annotations", (DL_FUNC) &_simona_cpp_n_annotations, 2},
    {"_simona_cpp_n_annotations_with_intersect", (DL_FUNC) &_simona_cpp_n_annotations_with_intersect, 2},
    {"_simona_cpp_get_term_annotations", (DL_FUNC) &_simona_cpp_get_term_annotations, 2},
    {"_simona_cpp_get_annotated_terms", (DL_FUNC) &_simona_cpp_get_annotated_terms, 2},
    {"_simona_cpp_max_ancestor_v", (DL_FUNC) &_simona_cpp_max_ancestor_v, 3},
    {"_simona_cpp_max_ancestor_id", (DL_FUNC) &_simona_cpp_max_ancestor_id, 4},
    {"_simona_cpp_max_ancestor_path_sum_value", (DL_FUNC) &_simona_cpp_max_ancestor_path_sum_value, 5},
    {"_simona_cpp_longest_distances_from_LCA", (DL_FUNC) &_simona_cpp_longest_distances_from_LCA, 2},
    {"_simona_cpp_longest_distances_directed", (DL_FUNC) &_simona_cpp_longest_distances_directed, 2},
    {"_simona_cpp_shortest_distances_directed", (DL_FUNC) &_simona_cpp_shortest_distances_directed, 2},
    {"_simona_cpp_nearest_common_ancestor", (DL_FUNC) &_simona_cpp_nearest_common_ancestor, 2},
    {"_simona_cpp_shortest_distances_via_NCA", (DL_FUNC) &_simona_cpp_shortest_distances_via_NCA, 2},
    {"_simona_cpp_tpl_shortest_path_length", (DL_FUNC) &_simona_cpp_tpl_shortest_path_length, 3},
    {"_simona_cpp_tpl_longest_path_length", (DL_FUNC) &_simona_cpp_tpl_longest_path_length, 3},
    {"_simona_cpp_tpl_shortest_path", (DL_FUNC) &_simona_cpp_tpl_shortest_path, 3},
    {"_simona_cpp_tpl_longest_path", (DL_FUNC) &_simona_cpp_tpl_longest_path, 3},
    {"_simona_cpp_tpl_shortest_path_sum_value", (DL_FUNC) &_simona_cpp_tpl_shortest_path_sum_value, 4},
    {"_simona_cpp_tpl_longest_path_sum_value", (DL_FUNC) &_simona_cpp_tpl_longest_path_sum_value, 4},
    {"_simona_intersectToList_logical", (DL_FUNC) &_simona_intersectToList_logical, 2},
    {"_simona_cpp_partition_by_size", (DL_FUNC) &_simona_cpp_partition_by_size, 2},
    {"_simona_cpp_random_aggregatioin", (DL_FUNC) &_simona_cpp_random_aggregatioin, 3},
    {"_simona_cpp_node_pos_in_tree", (DL_FUNC) &_simona_cpp_node_pos_in_tree, 4},
    {"_simona_cpp_calc_n_neighbours", (DL_FUNC) &_simona_cpp_calc_n_neighbours, 2},
    {"_simona_cpp_reorder_by_score", (DL_FUNC) &_simona_cpp_reorder_by_score, 2},
    {"_simona_cpp_permutate_children", (DL_FUNC) &_simona_cpp_permutate_children, 1},
    {"_simona_cpp_get_force_counterpart", (DL_FUNC) &_simona_cpp_get_force_counterpart, 5},
    {"_simona_cpp_get_force", (DL_FUNC) &_simona_cpp_get_force, 4},
    {"_simona_move_index", (DL_FUNC) &_simona_move_index, 4},
    {"_simona_calc_x_offset", (DL_FUNC) &_simona_calc_x_offset, 4},
    {"_simona_reorder_children", (DL_FUNC) &_simona_reorder_children, 7},
    {"_simona_cpp_reorder_tree_x", (DL_FUNC) &_simona_cpp_reorder_tree_x, 5},
    {"_simona_n_links_from_two_groups_of_nodes", (DL_FUNC) &_simona_n_links_from_two_groups_of_nodes, 3},
    {"_simona_cpp_sim_aic", (DL_FUNC) &_simona_cpp_sim_aic, 3},
    {"_simona_cpp_sim_wang", (DL_FUNC) &_simona_cpp_sim_wang, 4},
    {"_simona_cpp_wang_sv_to_sim", (DL_FUNC) &_simona_cpp_wang_sv_to_sim, 1},
    {"_simona_cpp_sim_wang_edge", (DL_FUNC) &_simona_cpp_sim_wang_edge, 2},
    {"_simona_cpp_sim_zhong", (DL_FUNC) &_simona_cpp_sim_zhong, 3},
    {"_simona_cpp_common_ancestor_mean_IC_XGraSM", (DL_FUNC) &_simona_cpp_common_ancestor_mean_IC_XGraSM, 3},
    {"_simona_cpp_common_ancestor_mean_IC_EISI", (DL_FUNC) &_simona_cpp_common_ancestor_mean_IC_EISI, 3},
    {"_simona_cpp_sim_ancestor", (DL_FUNC) &_simona_cpp_sim_ancestor, 2},
    {"_simona_cpp_ic_meng", (DL_FUNC) &_simona_cpp_ic_meng, 2},
    {"_simona_cpp_ic_wang", (DL_FUNC) &_simona_cpp_ic_wang, 2},
    {"_simona_cpp_max_leaves_id", (DL_FUNC) &_simona_cpp_max_leaves_id, 3},
    {"_simona_cpp_ancestors", (DL_FUNC) &_simona_cpp_ancestors, 3},
    {"_simona_cpp_ancestors_within_background", (DL_FUNC) &_simona_cpp_ancestors_within_background, 4},
    {"_simona_cpp_offspring", (DL_FUNC) &_simona_cpp_offspring, 3},
    {"_simona_cpp_all_offspring", (DL_FUNC) &_simona_cpp_all_offspring, 2},
    {"_simona_cpp_offspring_within_background", (DL_FUNC) &_simona_cpp_offspring_within_background, 4},
    {"_simona_cpp_connected_leaves", (DL_FUNC) &_simona_cpp_connected_leaves, 2},
    {"_simona_cpp_n_ancestors", (DL_FUNC) &_simona_cpp_n_ancestors, 2},
    {"_simona_cpp_n_ancestors_on_tree", (DL_FUNC) &_simona_cpp_n_ancestors_on_tree, 2},
    {"_simona_cpp_n_offspring", (DL_FUNC) &_simona_cpp_n_offspring, 2},
    {"_simona_cpp_n_offspring_on_tree", (DL_FUNC) &_simona_cpp_n_offspring_on_tree, 2},
    {"_simona_cpp_n_offspring_with_intersect", (DL_FUNC) &_simona_cpp_n_offspring_with_intersect, 3},
    {"_simona_cpp_n_leaves", (DL_FUNC) &_simona_cpp_n_leaves, 1},
    {"_simona_cpp_n_leaves_on_tree", (DL_FUNC) &_simona_cpp_n_leaves_on_tree, 1},
    {"_simona_cpp_ancestors_of_a_group", (DL_FUNC) &_simona_cpp_ancestors_of_a_group, 4},
    {"_simona_cpp_ancestors_of_two_groups", (DL_FUNC) &_simona_cpp_ancestors_of_two_groups, 5},
    {"_simona_cpp_offspring_of_a_group", (DL_FUNC) &_simona_cpp_offspring_of_a_group, 3},
    {"_simona_cpp_offspring_aggregate", (DL_FUNC) &_simona_cpp_offspring_aggregate, 3},
    {"_simona_cpp_is_reachable", (DL_FUNC) &_simona_cpp_is_reachable, 3},
    {"_simona_cpp_dag_depth", (DL_FUNC) &_simona_cpp_dag_depth, 1},
    {"_simona_cpp_dag_dist_from_root", (DL_FUNC) &_simona_cpp_dag_dist_from_root, 1},
    {"_simona_cpp_dag_longest_dist_to_offspring", (DL_FUNC) &_simona_cpp_dag_longest_dist_to_offspring, 3},
    {"_simona_cpp_dag_shortest_dist_to_offspring", (DL_FUNC) &_simona_cpp_dag_shortest_dist_to_offspring, 3},
    {"_simona_cpp_dag_height", (DL_FUNC) &_simona_cpp_dag_height, 1},
    {"_simona_cpp_dag_dist_to_leaves", (DL_FUNC) &_simona_cpp_dag_dist_to_leaves, 1},
    {"_simona_cpp_dag_longest_dist_from_ancestors", (DL_FUNC) &_simona_cpp_dag_longest_dist_from_ancestors, 3},
    {"_simona_cpp_dag_shortest_dist_from_ancestors", (DL_FUNC) &_simona_cpp_dag_shortest_dist_from_ancestors, 3},
    {"_simona_cpp_check_cyclic_node", (DL_FUNC) &_simona_cpp_check_cyclic_node, 2},
    {"_simona_cpp_dag_shortest_path_to_offspring_sum_value", (DL_FUNC) &_simona_cpp_dag_shortest_path_to_offspring_sum_value, 4},
    {"_simona_cpp_mark_tree_links", (DL_FUNC) &_simona_cpp_mark_tree_links, 1},
    {"_simona_cpp_tree_lt_parents_from_children", (DL_FUNC) &_simona_cpp_tree_lt_parents_from_children, 1},
    {"_simona_cpp_match_index", (DL_FUNC) &_simona_cpp_match_index, 2},
    {"_simona_cross_sum", (DL_FUNC) &_simona_cross_sum, 1},
    {"_simona_cross_multiply", (DL_FUNC) &_simona_cross_multiply, 1},
    {"_simona_cross_minus", (DL_FUNC) &_simona_cross_minus, 1},
    {"_simona_cross_max", (DL_FUNC) &_simona_cross_max, 1},
    {"_simona_cross_min", (DL_FUNC) &_simona_cross_min, 1},
    {NULL, NULL, 0}
};

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