R/RcppExports.R

Defines functions read_distances_list_CPP read_fasta_from_file_CPP ACF_spherical_CPP fit_SBM_from_sampled_transitions_CPP fit_SBM_diffusivity_from_transitions_CPP TSBM_LL_of_sampled_transitions_CPP TSBM_LL_of_transitions_CPP SBM_get_average_transition_angle_CPP SBM_get_SBM_PD_functor_CPP SBM_LLs_of_sampled_transitions_CPP SBM_LLs_of_transitions_CPP move_points_on_sphere_CPP simulate_TSBM_on_tree_CPP simulate_SBM_trajectory_CPP simulate_SBM_on_tree_CPP draw_SBM_geodesic_angle_CPP get_all_pairwise_geodesic_angles_CPP geodesic_angles_CPP simulate_deterministic_HBD_MSC_CPP generate_gene_tree_in_species_tree_MSC_HGT_DL_CPP generate_gene_tree_in_species_tree_MSC_CPP generate_random_tree_tdSSE_CPP generate_random_tree_Mk_rates_CPP generate_random_tree_OU_rates_CPP generate_random_tree_BM_rates_CPP get_branching_ages_from_LTT_CPP generate_tree_from_PSR_CPP get_tree_from_sampling_branching_ages_CPP get_tree_from_branching_ages_CPP generate_random_tree_HBDS_CPP generate_random_tree_CPP simulate_neutral_gene_evolution_CPP simulate_multivariate_Brownian_motion_model_CPP simulate_scalar_Brownian_motion_model_CPP simulate_reflected_Ornstein_Uhlenbeck_on_tree_CPP simulate_Ornstein_Uhlenbeck_on_tree_CPP simulate_fixed_rates_Markov_model_CPP get_congruent_HBDS_CPP simulate_deterministic_HBDS_CPP get_HBDS_model_loglikelihood_CPP HBD_PSR_loglikelihood_CPP HBD_PDR_loglikelihood_CPP HBD_model_loglikelihood_CPP CR_HBD_model_loglikelihood_CPP get_PSR_of_HBD_model_CPP get_PSR_of_CR_HBD_model_CPP get_PSR_from_PDR_HBD_CPP simulate_deterministic_HBD_model_CPP get_MuSSE_loglikelihood_CPP get_MuSSE_loglikelihood_classic_CPP ASR_binomial_CPP apply_BM_parsimony_to_missing_clades_CPP ASR_via_independent_contrasts_CPP get_mean_state_per_node_CPP ASR_via_squared_change_parsimony_CPP apply_attributes_to_descendants_CPP apply_fixed_rate_Markov_model_to_missing_clades_CPP TR_Mk_loglikelihood_ICs_CPP Mk_loglikelihood_CPP ASR_with_fixed_rates_Markov_model_CPP WMPR_ASR_CPP is_monophyletic_tip_set_CPP get_most_recent_common_ancestor_CPP get_most_recent_common_ancestors_CPP get_pairwise_ancestries_CPP get_mrca_defining_tips_CPP get_trait_stats_at_times_CPP get_phylogenetic_independent_contrasts_CPP get_trait_richness_collectors_curve_CPP get_empirical_state_frequencies_per_node_CPP ACF_continuous_trait_CPP get_discrete_trait_depth_CPP get_trait_depth_consenTRAIT_CPP read_Newick_string_CPP tree_to_Newick_string_CPP get_phylogram_geometry_CPP propagate_max_ages_downstream_CPP propagate_min_ages_upstream_CPP relative_to_absolute_node_ages_CPP get_Robinson_Foulds_distance_CPP match_tree_nodes_CPP congruify_trees_CPP consensus_taxonomies_CPP join_rooted_trees_CPP get_independent_sister_tips_CPP assign_clades_to_taxa_CPP pick_random_tips_CPP merge_short_edges_CPP shift_clade_times_CPP merge_nodes_to_multifurcations_CPP multifurcations_to_bifurcations_CPP extend_tree_to_height_CPP split_tree_at_height_CPP trim_tree_at_height_CPP collapse_tree_at_resolution_CPP find_edge_splitting_tree_CPP find_root_for_monophyletic_clade_CPP eliminate_bifurcating_root_CPP get_subtree_with_specific_tips_CPP get_subtrees_at_nodes_CPP get_subtree_at_node_CPP get_subtree_with_specific_clades_CPP get_tree_with_collapsed_monofurcations_CPP root_tree_at_node_CPP sort_tree_edges_root_to_tips_CPP get_all_distances_to_tip_CPP extract_deep_frame_CPP extract_tip_neighborhood_CPP get_ancestral_nodes_CPP get_Colless_Imbalance_CPP get_gamma_statistic_CPP extract_fasttree_constraints_CPP tree_to_clade_list_CPP date_tree_via_RED_CPP get_relative_evolutionary_divergences_CPP get_speciation_extinction_events_CPP tree_has_multifurcations_CPP get_LTT_BD_CPP count_clades_at_times_CPP count_clades_at_regular_times_CPP count_transitions_between_clades_CPP get_farthest_tip_pair_CPP get_distances_between_clades_CPP get_distance_matrix_between_clades_CPP get_farthest_tips_per_edge_CPP get_farthest_tip_per_clade_CPP get_closest_tip_per_clade_CPP get_distances_from_root_CPP get_min_max_tip_distance_from_root_CPP get_child_count_per_node_CPP get_mean_depth_per_node_CPP get_total_tip_count_per_node_CPP get_sum_of_edge_lengths_per_clade_CPP get_adjacent_edges_per_edge_CPP get_paths_root_to_tips_CPP get_outgoing_edges_per_clade_CPP get_tree_traversal_root_to_tips_CPP get_root_clade_CPP get_incoming_edges_per_clade_CPP get_diversities_from_birth_and_death_events_CPP reconstruct_past_diversifications_CPP reconstruct_past_diversity_from_biased_coalescent_CPP reconstruct_past_diversity_from_coalescent_CPP simulate_deterministic_diversity_growth_CPP get_Poisson_event_times_CPP get_bounded_BM_time_series_CPP get_Ornstein_Uhlenbeck_time_series_CPP monotonize_series_via_interpolation_CPP monotonize_series_by_pruning_CPP get_inhomogeneous_grid_1D_CPP smoothenTimeSeriesSavitzkyGolay_CPP fit_exp_Poisson_moving_window_CPP fit_exp_LeastLogSquares_moving_window_CPP exponentiate_matrix_for_multiple_scalings_CPP get_derivative_CPP get_antiderivative_CPP derivatives_of_grid_curve_CPP get_spline_CPP evaluate_spline_CPP split_undirected_graph_CPP first_Wasserstein_distance_CPP place_sorted_values_into_bins_CPP get_member_lists_from_group_assignments_CPP dense_binary_matrix_row2column_major_CPP evaluate_univariate_expression_CPP

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

evaluate_univariate_expression_CPP <- function(expression, Xname, X) {
    .Call(`_castor_evaluate_univariate_expression_CPP`, expression, Xname, X)
}

dense_binary_matrix_row2column_major_CPP <- function(NR, NC, dense_rows, Rindexing) {
    .Call(`_castor_dense_binary_matrix_row2column_major_CPP`, NR, NC, dense_rows, Rindexing)
}

get_member_lists_from_group_assignments_CPP <- function(Ngroups, pool2group) {
    .Call(`_castor_get_member_lists_from_group_assignments_CPP`, Ngroups, pool2group)
}

place_sorted_values_into_bins_CPP <- function(items, bin_mins, bin_maxs) {
    .Call(`_castor_place_sorted_values_into_bins_CPP`, items, bin_mins, bin_maxs)
}

first_Wasserstein_distance_CPP <- function(X, Y) {
    .Call(`_castor_first_Wasserstein_distance_CPP`, X, Y)
}

split_undirected_graph_CPP <- function(Nnodes, Nedges, edges) {
    .Call(`_castor_split_undirected_graph_CPP`, Nnodes, Nedges, edges)
}

evaluate_spline_CPP <- function(Xgrid, Ygrid, splines_degree, Xtarget, extrapolate, derivative) {
    .Call(`_castor_evaluate_spline_CPP`, Xgrid, Ygrid, splines_degree, Xtarget, extrapolate, derivative)
}

get_spline_CPP <- function(Xgrid, Ygrid, splines_degree) {
    .Call(`_castor_get_spline_CPP`, Xgrid, Ygrid, splines_degree)
}

derivatives_of_grid_curve_CPP <- function(Xgrid, Ygrid) {
    .Call(`_castor_derivatives_of_grid_curve_CPP`, Xgrid, Ygrid)
}

get_antiderivative_CPP <- function(Xgrid, Xstart, Ygrid, splines_degree, Xtarget) {
    .Call(`_castor_get_antiderivative_CPP`, Xgrid, Xstart, Ygrid, splines_degree, Xtarget)
}

get_derivative_CPP <- function(Xgrid, Ygrid, splines_degree, Xtarget) {
    .Call(`_castor_get_derivative_CPP`, Xgrid, Ygrid, splines_degree, Xtarget)
}

exponentiate_matrix_for_multiple_scalings_CPP <- function(NR, A, scalings, epsilon, NPmin, NPmax, enforce_probability_matrix) {
    .Call(`_castor_exponentiate_matrix_for_multiple_scalings_CPP`, NR, A, scalings, epsilon, NPmin, NPmax, enforce_probability_matrix)
}

fit_exp_LeastLogSquares_moving_window_CPP <- function(X, Y, window_size, trim_window_at_bounds) {
    .Call(`_castor_fit_exp_LeastLogSquares_moving_window_CPP`, X, Y, window_size, trim_window_at_bounds)
}

fit_exp_Poisson_moving_window_CPP <- function(X, Y, scalings, window_size, trim_window_at_bounds) {
    .Call(`_castor_fit_exp_Poisson_moving_window_CPP`, X, Y, scalings, window_size, trim_window_at_bounds)
}

smoothenTimeSeriesSavitzkyGolay_CPP <- function(times, data, windowTimeSpan, windowIndexSpan, order) {
    .Call(`_castor_smoothenTimeSeriesSavitzkyGolay_CPP`, times, data, windowTimeSpan, windowIndexSpan, order)
}

get_inhomogeneous_grid_1D_CPP <- function(Xstart, Xend, Ngrid, densityX, densityY, xepsilon) {
    .Call(`_castor_get_inhomogeneous_grid_1D_CPP`, Xstart, Xend, Ngrid, densityX, densityY, xepsilon)
}

monotonize_series_by_pruning_CPP <- function(values, increasing, prefer_later_data) {
    .Call(`_castor_monotonize_series_by_pruning_CPP`, values, increasing, prefer_later_data)
}

monotonize_series_via_interpolation_CPP <- function(times, values, increasing, prefer_later_data) {
    .Call(`_castor_monotonize_series_via_interpolation_CPP`, times, values, increasing, prefer_later_data)
}

get_Ornstein_Uhlenbeck_time_series_CPP <- function(times, start_value, stationary_mean, stationary_std, decay_rate) {
    .Call(`_castor_get_Ornstein_Uhlenbeck_time_series_CPP`, times, start_value, stationary_mean, stationary_std, decay_rate)
}

get_bounded_BM_time_series_CPP <- function(times, start_value, diffusivity, lower, upper) {
    .Call(`_castor_get_bounded_BM_time_series_CPP`, times, start_value, diffusivity, lower, upper)
}

get_Poisson_event_times_CPP <- function(time_grid, rates, splines_degree, Nevents, time0) {
    .Call(`_castor_get_Poisson_event_times_CPP`, time_grid, rates, splines_degree, Nevents, time0)
}

simulate_deterministic_diversity_growth_CPP <- function(birth_rate_intercept, birth_rate_factor, birth_rate_exponent, death_rate_intercept, death_rate_factor, death_rate_exponent, resolution, rarefaction, Nsplits, additional_rates_times, additional_birth_rates_pc, additional_death_rates_pc, additional_periodic, times, start_time, final_time, start_diversity, final_diversity, reverse, include_coalescent, include_probabilities, include_birth_rates, include_death_rates, include_Nevents, runtime_out_seconds) {
    .Call(`_castor_simulate_deterministic_diversity_growth_CPP`, birth_rate_intercept, birth_rate_factor, birth_rate_exponent, death_rate_intercept, death_rate_factor, death_rate_exponent, resolution, rarefaction, Nsplits, additional_rates_times, additional_birth_rates_pc, additional_death_rates_pc, additional_periodic, times, start_time, final_time, start_diversity, final_diversity, reverse, include_coalescent, include_probabilities, include_birth_rates, include_death_rates, include_Nevents, runtime_out_seconds)
}

reconstruct_past_diversity_from_coalescent_CPP <- function(times, raw_coalescent_diversities, birth_rates_pc, rarefaction, max_age, smoothing_span, smoothing_order) {
    .Call(`_castor_reconstruct_past_diversity_from_coalescent_CPP`, times, raw_coalescent_diversities, birth_rates_pc, rarefaction, max_age, smoothing_span, smoothing_order)
}

reconstruct_past_diversity_from_biased_coalescent_CPP <- function(times, raw_coalescent_diversities, birth_rates_pc, discovery_fractions, discovery_fraction_slopes, max_age, smoothing_span, smoothing_order) {
    .Call(`_castor_reconstruct_past_diversity_from_biased_coalescent_CPP`, times, raw_coalescent_diversities, birth_rates_pc, discovery_fractions, discovery_fraction_slopes, max_age, smoothing_span, smoothing_order)
}

reconstruct_past_diversifications_CPP <- function(times, raw_diversities, birth_rates_pc, rarefaction, Nsplits, max_age, smoothing_span, smoothing_order) {
    .Call(`_castor_reconstruct_past_diversifications_CPP`, times, raw_diversities, birth_rates_pc, rarefaction, Nsplits, max_age, smoothing_span, smoothing_order)
}

get_diversities_from_birth_and_death_events_CPP <- function(times, birth_times, death_times, start_diversity, Nsplits) {
    .Call(`_castor_get_diversities_from_birth_and_death_events_CPP`, times, birth_times, death_times, start_diversity, Nsplits)
}

get_incoming_edges_per_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_incoming_edges_per_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_root_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_root_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_tree_traversal_root_to_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, include_tips) {
    .Call(`_castor_get_tree_traversal_root_to_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge, include_tips)
}

get_outgoing_edges_per_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_outgoing_edges_per_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_paths_root_to_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_paths_root_to_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_adjacent_edges_per_edge_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_adjacent_edges_per_edge_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_sum_of_edge_lengths_per_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_sum_of_edge_lengths_per_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

get_total_tip_count_per_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_total_tip_count_per_node_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_mean_depth_per_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_mean_depth_per_node_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

get_child_count_per_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_child_count_per_node_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_min_max_tip_distance_from_root_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_min_max_tip_distance_from_root_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

get_distances_from_root_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_distances_from_root_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

get_closest_tip_per_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips, only_descending_tips, verbose, verbose_prefix) {
    .Call(`_castor_get_closest_tip_per_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips, only_descending_tips, verbose, verbose_prefix)
}

get_farthest_tip_per_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips, only_descending_tips, verbose, verbose_prefix) {
    .Call(`_castor_get_farthest_tip_per_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips, only_descending_tips, verbose, verbose_prefix)
}

get_farthest_tips_per_edge_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips) {
    .Call(`_castor_get_farthest_tips_per_edge_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, onlyToTips)
}

get_distance_matrix_between_clades_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, focal_clades, verbose, verbose_prefix) {
    .Call(`_castor_get_distance_matrix_between_clades_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, focal_clades, verbose, verbose_prefix)
}

get_distances_between_clades_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, cladesA, cladesB, verbose, verbose_prefix) {
    .Call(`_castor_get_distances_between_clades_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, cladesA, cladesB, verbose, verbose_prefix)
}

get_farthest_tip_pair_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_farthest_tip_pair_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

count_transitions_between_clades_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, clade_states, cladesA, cladesB) {
    .Call(`_castor_count_transitions_between_clades_CPP`, Ntips, Nnodes, Nedges, tree_edge, clade_states, cladesA, cladesB)
}

count_clades_at_regular_times_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, Ntimes, min_time, max_time, ultrametric, degree, include_slopes) {
    .Call(`_castor_count_clades_at_regular_times_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, Ntimes, min_time, max_time, ultrametric, degree, include_slopes)
}

count_clades_at_times_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, times, degree) {
    .Call(`_castor_count_clades_at_times_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, times, degree)
}

get_LTT_BD_CPP <- function(birth_times, death_times, time_grid) {
    .Call(`_castor_get_LTT_BD_CPP`, birth_times, death_times, time_grid)
}

tree_has_multifurcations_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_tree_has_multifurcations_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_speciation_extinction_events_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, min_age, max_age, only_clades, omit_clades) {
    .Call(`_castor_get_speciation_extinction_events_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, min_age, max_age, only_clades, omit_clades)
}

get_relative_evolutionary_divergences_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_relative_evolutionary_divergences_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

date_tree_via_RED_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, anchor_node, anchor_age) {
    .Call(`_castor_date_tree_via_RED_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, anchor_node, anchor_age)
}

tree_to_clade_list_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, postorder) {
    .Call(`_castor_tree_to_clade_list_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, postorder)
}

extract_fasttree_constraints_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_extract_fasttree_constraints_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

get_gamma_statistic_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_gamma_statistic_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

get_Colless_Imbalance_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, normalized) {
    .Call(`_castor_get_Colless_Imbalance_CPP`, Ntips, Nnodes, Nedges, tree_edge, normalized)
}

get_ancestral_nodes_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, descendants, Nsplits) {
    .Call(`_castor_get_ancestral_nodes_CPP`, Ntips, Nnodes, Nedges, tree_edge, descendants, Nsplits)
}

extract_tip_neighborhood_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, focal_tip, Nbackward, Nforward) {
    .Call(`_castor_extract_tip_neighborhood_CPP`, Ntips, Nnodes, Nedges, tree_edge, focal_tip, Nbackward, Nforward)
}

extract_deep_frame_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, Nsplits) {
    .Call(`_castor_extract_deep_frame_CPP`, Ntips, Nnodes, Nedges, tree_edge, Nsplits)
}

get_all_distances_to_tip_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, focal_tip) {
    .Call(`_castor_get_all_distances_to_tip_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, focal_tip)
}

sort_tree_edges_root_to_tips_CPP <- function(Ntips, Nnodes, Nedges, depth_first_search, root_to_tips, tree_edge) {
    .Call(`_castor_sort_tree_edges_root_to_tips_CPP`, Ntips, Nnodes, Nedges, depth_first_search, root_to_tips, tree_edge)
}

root_tree_at_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, new_root_node) {
    .Call(`_castor_root_tree_at_node_CPP`, Ntips, Nnodes, Nedges, tree_edge, new_root_node)
}

get_tree_with_collapsed_monofurcations_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, force_keep_root, force_keep_nodes) {
    .Call(`_castor_get_tree_with_collapsed_monofurcations_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, force_keep_root, force_keep_nodes)
}

get_subtree_with_specific_clades_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, clades_to_keep, collapse_monofurcations, force_keep_root, keep_all_children_of_explicit_clades_to_keep, keep_all_tips_of_explicit_clades_to_keep) {
    .Call(`_castor_get_subtree_with_specific_clades_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, clades_to_keep, collapse_monofurcations, force_keep_root, keep_all_children_of_explicit_clades_to_keep, keep_all_tips_of_explicit_clades_to_keep)
}

get_subtree_at_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, new_root_node) {
    .Call(`_castor_get_subtree_at_node_CPP`, Ntips, Nnodes, Nedges, tree_edge, new_root_node)
}

get_subtrees_at_nodes_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, new_root_nodes) {
    .Call(`_castor_get_subtrees_at_nodes_CPP`, Ntips, Nnodes, Nedges, tree_edge, new_root_nodes)
}

get_subtree_with_specific_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tips_to_keep, collapse_monofurcations, force_keep_root) {
    .Call(`_castor_get_subtree_with_specific_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tips_to_keep, collapse_monofurcations, force_keep_root)
}

eliminate_bifurcating_root_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_eliminate_bifurcating_root_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

find_root_for_monophyletic_clade_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, is_rooted, target_tips, as_MRCA) {
    .Call(`_castor_find_root_for_monophyletic_clade_CPP`, Ntips, Nnodes, Nedges, tree_edge, is_rooted, target_tips, as_MRCA)
}

find_edge_splitting_tree_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, is_rooted, target_tips, include_misplaced) {
    .Call(`_castor_find_edge_splitting_tree_CPP`, Ntips, Nnodes, Nedges, tree_edge, is_rooted, target_tips, include_misplaced)
}

collapse_tree_at_resolution_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, resolution, shorten, criterion) {
    .Call(`_castor_collapse_tree_at_resolution_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, resolution, shorten, criterion)
}

trim_tree_at_height_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, max_distance_from_root) {
    .Call(`_castor_trim_tree_at_height_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, max_distance_from_root)
}

split_tree_at_height_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, root_edge, split_height) {
    .Call(`_castor_split_tree_at_height_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, root_edge, split_height)
}

extend_tree_to_height_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, new_height) {
    .Call(`_castor_extend_tree_to_height_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, new_height)
}

multifurcations_to_bifurcations_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, dummy_edge_length) {
    .Call(`_castor_multifurcations_to_bifurcations_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, dummy_edge_length)
}

merge_nodes_to_multifurcations_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, nodes_to_merge, merge_with_parents, keep_ancestral_ages) {
    .Call(`_castor_merge_nodes_to_multifurcations_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, nodes_to_merge, merge_with_parents, keep_ancestral_ages)
}

shift_clade_times_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, clades_to_shift, time_shifts, shift_descendants, negative_edge_lengths) {
    .Call(`_castor_shift_clade_times_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, clades_to_shift, time_shifts, shift_descendants, negative_edge_lengths)
}

merge_short_edges_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, edge_length_epsilon, force_keep_tips) {
    .Call(`_castor_merge_short_edges_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, edge_length_epsilon, force_keep_tips)
}

pick_random_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, Nrandoms, Nsubsets, with_replacement) {
    .Call(`_castor_pick_random_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge, Nrandoms, Nsubsets, with_replacement)
}

assign_clades_to_taxa_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, representatives) {
    .Call(`_castor_assign_clades_to_taxa_CPP`, Ntips, Nnodes, Nedges, tree_edge, representatives)
}

get_independent_sister_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge) {
    .Call(`_castor_get_independent_sister_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge)
}

join_rooted_trees_CPP <- function(Ntips1, Nnodes1, Nedges1, tree_edge1, edge_length1, Ntips2, Nnodes2, Nedges2, tree_edge2, edge_length2, target_edge1, target_edge_length1, root_edge_length2) {
    .Call(`_castor_join_rooted_trees_CPP`, Ntips1, Nnodes1, Nedges1, tree_edge1, edge_length1, Ntips2, Nnodes2, Nedges2, tree_edge2, edge_length2, target_edge1, target_edge_length1, root_edge_length2)
}

consensus_taxonomies_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, tip_taxonomies, delimiter) {
    .Call(`_castor_consensus_taxonomies_CPP`, Ntips, Nnodes, Nedges, tree_edge, tip_taxonomies, delimiter)
}

congruify_trees_CPP <- function(RNtips, RNnodes, RNedges, Rtree_edge, TNtips, TNnodes, TNedges, Ttree_edge, mapping) {
    .Call(`_castor_congruify_trees_CPP`, RNtips, RNnodes, RNedges, Rtree_edge, TNtips, TNnodes, TNedges, Ttree_edge, mapping)
}

match_tree_nodes_CPP <- function(Ntips, Nnodes, Nedges, tree_edgeA, tree_edgeB, tipsA2B) {
    .Call(`_castor_match_tree_nodes_CPP`, Ntips, Nnodes, Nedges, tree_edgeA, tree_edgeB, tipsA2B)
}

get_Robinson_Foulds_distance_CPP <- function(Ntips, NnodesA, NedgesA, tree_edgeA, NnodesB, NedgesB, tree_edgeB, tipsA2B) {
    .Call(`_castor_get_Robinson_Foulds_distance_CPP`, Ntips, NnodesA, NedgesA, tree_edgeA, NnodesB, NedgesB, tree_edgeB, tipsA2B)
}

relative_to_absolute_node_ages_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, traversal_queue, relative_node_ages, min_abs_node_ages, max_abs_node_ages) {
    .Call(`_castor_relative_to_absolute_node_ages_CPP`, Ntips, Nnodes, Nedges, tree_edge, traversal_queue, relative_node_ages, min_abs_node_ages, max_abs_node_ages)
}

propagate_min_ages_upstream_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, traversal_queue, anchor_nodes, anchor_min_ages) {
    .Call(`_castor_propagate_min_ages_upstream_CPP`, Ntips, Nnodes, Nedges, tree_edge, traversal_queue, anchor_nodes, anchor_min_ages)
}

propagate_max_ages_downstream_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, traversal_queue, anchor_nodes, anchor_max_ages) {
    .Call(`_castor_propagate_max_ages_downstream_CPP`, Ntips, Nnodes, Nedges, tree_edge, traversal_queue, anchor_nodes, anchor_max_ages)
}

get_phylogram_geometry_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length) {
    .Call(`_castor_get_phylogram_geometry_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length)
}

tree_to_Newick_string_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_labels, node_labels, edge_labels, edge_numbers, digits, root_edge_length, quoting) {
    .Call(`_castor_tree_to_Newick_string_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_labels, node_labels, edge_labels, edge_numbers, digits, root_edge_length, quoting)
}

read_Newick_string_CPP <- function(input, underscores_as_blanks, interpret_quotes, look_for_edge_names, look_for_edge_numbers) {
    .Call(`_castor_read_Newick_string_CPP`, input, underscores_as_blanks, interpret_quotes, look_for_edge_names, look_for_edge_numbers)
}

get_trait_depth_consenTRAIT_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, state_per_tip, threshold_fraction, count_singletons, weighted, singleton_threshold, Npermutations, verbose, verbose_prefix) {
    .Call(`_castor_get_trait_depth_consenTRAIT_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, state_per_tip, threshold_fraction, count_singletons, weighted, singleton_threshold, Npermutations, verbose, verbose_prefix)
}

get_discrete_trait_depth_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, state_per_tip, threshold_fraction, count_singletons, weighted, singleton_threshold, Npermutations, verbose, verbose_prefix) {
    .Call(`_castor_get_discrete_trait_depth_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, state_per_tip, threshold_fraction, count_singletons, weighted, singleton_threshold, Npermutations, verbose, verbose_prefix)
}

ACF_continuous_trait_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, state_per_tip, max_Npairs, phylodistance_grid, max_phylodistance, grid_is_uniform, verbose, verbose_prefix) {
    .Call(`_castor_ACF_continuous_trait_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, state_per_tip, max_Npairs, phylodistance_grid, max_phylodistance, grid_is_uniform, verbose, verbose_prefix)
}

get_empirical_state_frequencies_per_node_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, tip_states) {
    .Call(`_castor_get_empirical_state_frequencies_per_node_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, tip_states)
}

get_trait_richness_collectors_curve_CPP <- function(Ntips, Nnodes, Nedges, Ntraits, root, tree_edge, edge_length, tip2first_trait, tip2last_trait, traits, rarefaction_depths, Nrepeats, tip_distribution, use_realized_depths) {
    .Call(`_castor_get_trait_richness_collectors_curve_CPP`, Ntips, Nnodes, Nedges, Ntraits, root, tree_edge, edge_length, tip2first_trait, tip2last_trait, traits, rarefaction_depths, Nrepeats, tip_distribution, use_realized_depths)
}

get_phylogenetic_independent_contrasts_CPP <- function(Ntips, Nnodes, Nedges, Ntraits, tree_edge, edge_length, tip_states, scaled, only_bifurcations, include_zero_phylodistances) {
    .Call(`_castor_get_phylogenetic_independent_contrasts_CPP`, Ntips, Nnodes, Nedges, Ntraits, tree_edge, edge_length, tip_states, scaled, only_bifurcations, include_zero_phylodistances)
}

get_trait_stats_at_times_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, times, states, return_states) {
    .Call(`_castor_get_trait_stats_at_times_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, times, states, return_states)
}

get_mrca_defining_tips_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, mrcas, verbose, verbose_prefix) {
    .Call(`_castor_get_mrca_defining_tips_CPP`, Ntips, Nnodes, Nedges, tree_edge, mrcas, verbose, verbose_prefix)
}

get_pairwise_ancestries_CPP <- function(Ntips, Nnodes, Nedges, root, tree_edge, focal_clades) {
    .Call(`_castor_get_pairwise_ancestries_CPP`, Ntips, Nnodes, Nedges, root, tree_edge, focal_clades)
}

get_most_recent_common_ancestors_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, cladesA, cladesB, verbose, verbose_prefix) {
    .Call(`_castor_get_most_recent_common_ancestors_CPP`, Ntips, Nnodes, Nedges, tree_edge, cladesA, cladesB, verbose, verbose_prefix)
}

get_most_recent_common_ancestor_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, descendants) {
    .Call(`_castor_get_most_recent_common_ancestor_CPP`, Ntips, Nnodes, Nedges, tree_edge, descendants)
}

is_monophyletic_tip_set_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, focal_tips) {
    .Call(`_castor_is_monophyletic_tip_set_CPP`, Ntips, Nnodes, Nedges, tree_edge, focal_tips)
}

WMPR_ASR_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, tip_states, transition_costs, branch_length_exponent, weight_posteriors_by_scenario_counts, verbose, verbose_prefix) {
    .Call(`_castor_WMPR_ASR_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, tip_states, transition_costs, branch_length_exponent, weight_posteriors_by_scenario_counts, verbose, verbose_prefix)
}

ASR_with_fixed_rates_Markov_model_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, eigenvalues, EVmatrix, inverse_EVmatrix, prior_probabilities_per_tip, root_prior_type, root_prior, include_ancestral_likelihoods, reroot, runtime_out_seconds, exponentiation_accuracy, max_polynomials, store_exponentials) {
    .Call(`_castor_ASR_with_fixed_rates_Markov_model_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, eigenvalues, EVmatrix, inverse_EVmatrix, prior_probabilities_per_tip, root_prior_type, root_prior, include_ancestral_likelihoods, reroot, runtime_out_seconds, exponentiation_accuracy, max_polynomials, store_exponentials)
}

Mk_loglikelihood_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, prior_probabilities_per_tip, root_prior_type, root_prior, oldest_age, runtime_out_seconds, exponentiation_accuracy, max_polynomials) {
    .Call(`_castor_Mk_loglikelihood_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, prior_probabilities_per_tip, root_prior_type, root_prior, oldest_age, runtime_out_seconds, exponentiation_accuracy, max_polynomials)
}

TR_Mk_loglikelihood_ICs_CPP <- function(Nstates, phylodistances, transitions, transition_matrix, runtime_out_seconds, exponentiation_accuracy, max_polynomials) {
    .Call(`_castor_TR_Mk_loglikelihood_ICs_CPP`, Nstates, phylodistances, transitions, transition_matrix, runtime_out_seconds, exponentiation_accuracy, max_polynomials)
}

apply_fixed_rate_Markov_model_to_missing_clades_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, exponentiation_accuracy, max_polynomials, likelihoods_known, likelihoods, unknown_likelihoods_as_priors) {
    .Call(`_castor_apply_fixed_rate_Markov_model_to_missing_clades_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, exponentiation_accuracy, max_polynomials, likelihoods_known, likelihoods, unknown_likelihoods_as_priors)
}

apply_attributes_to_descendants_CPP <- function(Ntips, Nnodes, Nedges, Nattributes, tree_edge, attributes_known, attributes) {
    .Call(`_castor_apply_attributes_to_descendants_CPP`, Ntips, Nnodes, Nedges, Nattributes, tree_edge, attributes_known, attributes)
}

ASR_via_squared_change_parsimony_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states, global) {
    .Call(`_castor_ASR_via_squared_change_parsimony_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states, global)
}

get_mean_state_per_node_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states) {
    .Call(`_castor_get_mean_state_per_node_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states)
}

ASR_via_independent_contrasts_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states, include_standard_errors) {
    .Call(`_castor_ASR_via_independent_contrasts_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_states, include_standard_errors)
}

apply_BM_parsimony_to_missing_clades_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, states_known, states) {
    .Call(`_castor_apply_BM_parsimony_to_missing_clades_CPP`, Ntips, Nnodes, Nedges, tree_edge, states_known, states)
}

ASR_binomial_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, tip_states, reveal_probs, state0_probs, min_revealed) {
    .Call(`_castor_ASR_binomial_CPP`, Ntips, Nnodes, Nedges, tree_edge, tip_states, reveal_probs, state0_probs, min_revealed)
}

get_MuSSE_loglikelihood_classic_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, node_ages, transition_rates, speciation_rates, extinction_rates, sampling_rates, initial_D_per_tip, initial_E_per_state, root_prior, runtime_out_seconds) {
    .Call(`_castor_get_MuSSE_loglikelihood_classic_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, node_ages, transition_rates, speciation_rates, extinction_rates, sampling_rates, initial_D_per_tip, initial_E_per_state, root_prior, runtime_out_seconds)
}

get_MuSSE_loglikelihood_CPP <- function(Ntips, Nnodes, Nedges, Nstates, oldest_age, tree_edge, clade_ages, transition_rates, speciation_rates, extinction_rates, sampling_rates, initial_D_per_tip, initial_E_per_state, root_prior_type, root_prior, root_conditioning, include_ancestral_likelihoods, include_warnings, max_condition_number, relative_ODE_step, E_value_step, D_temporal_resolution, runtime_out_seconds) {
    .Call(`_castor_get_MuSSE_loglikelihood_CPP`, Ntips, Nnodes, Nedges, Nstates, oldest_age, tree_edge, clade_ages, transition_rates, speciation_rates, extinction_rates, sampling_rates, initial_D_per_tip, initial_E_per_state, root_prior_type, root_prior, root_conditioning, include_ancestral_likelihoods, include_warnings, max_condition_number, relative_ODE_step, E_value_step, D_temporal_resolution, runtime_out_seconds)
}

simulate_deterministic_HBD_model_CPP <- function(census_age, oldest_age, age_grid, lambdas, mus, mu_over_lambda, PDRs, anchor_age, anchor_rho, anchor_lambda, anchor_LTT, splines_degree, relative_dt, allow_unreal) {
    .Call(`_castor_simulate_deterministic_HBD_model_CPP`, census_age, oldest_age, age_grid, lambdas, mus, mu_over_lambda, PDRs, anchor_age, anchor_rho, anchor_lambda, anchor_LTT, splines_degree, relative_dt, allow_unreal)
}

get_PSR_from_PDR_HBD_CPP <- function(age0, oldest_age, age_grid, PDR, rholambda0, splines_degree, relative_dt, include_nLTT0) {
    .Call(`_castor_get_PSR_from_PDR_HBD_CPP`, age0, oldest_age, age_grid, PDR, rholambda0, splines_degree, relative_dt, include_nLTT0)
}

get_PSR_of_CR_HBD_model_CPP <- function(age0, oldest_age, lambda, mu, rho0, relative_dt) {
    .Call(`_castor_get_PSR_of_CR_HBD_model_CPP`, age0, oldest_age, lambda, mu, rho0, relative_dt)
}

get_PSR_of_HBD_model_CPP <- function(age0, oldest_age, age_grid, lambda, mu, rho0, splines_degree, relative_dt) {
    .Call(`_castor_get_PSR_of_HBD_model_CPP`, age0, oldest_age, age_grid, lambda, mu, rho0, splines_degree, relative_dt)
}

CR_HBD_model_loglikelihood_CPP <- function(branching_ages, oldest_age, rarefaction, lambda, mu, condition) {
    .Call(`_castor_CR_HBD_model_loglikelihood_CPP`, branching_ages, oldest_age, rarefaction, lambda, mu, condition)
}

HBD_model_loglikelihood_CPP <- function(branching_ages, oldest_age, rarefaction, age_grid, lambdas, mus, splines_degree, condition, relative_dt, runtime_out_seconds) {
    .Call(`_castor_HBD_model_loglikelihood_CPP`, branching_ages, oldest_age, rarefaction, age_grid, lambdas, mus, splines_degree, condition, relative_dt, runtime_out_seconds)
}

HBD_PDR_loglikelihood_CPP <- function(branching_ages, oldest_age, rholambda0, age_grid, PDRs, splines_degree, condition, relative_dt, runtime_out_seconds, diff_PDR, diff_PDR_degree) {
    .Call(`_castor_HBD_PDR_loglikelihood_CPP`, branching_ages, oldest_age, rholambda0, age_grid, PDRs, splines_degree, condition, relative_dt, runtime_out_seconds, diff_PDR, diff_PDR_degree)
}

HBD_PSR_loglikelihood_CPP <- function(branching_ages, oldest_age, age_grid, PSRs, splines_degree, condition, relative_dt, runtime_out_seconds) {
    .Call(`_castor_HBD_PSR_loglikelihood_CPP`, branching_ages, oldest_age, age_grid, PSRs, splines_degree, condition, relative_dt, runtime_out_seconds)
}

get_HBDS_model_loglikelihood_CPP <- function(branching_ages, Ptip_ages, Pnode_ages, CSA_ages, CSA_probs, CSA_kappas, concentrated_tip_counts, concentrated_node_counts, oldest_age, age_grid, lambdas, mus, psis, kappas, splines_degree, condition, relative_ODE_step, E_value_step, runtime_out_seconds) {
    .Call(`_castor_get_HBDS_model_loglikelihood_CPP`, branching_ages, Ptip_ages, Pnode_ages, CSA_ages, CSA_probs, CSA_kappas, concentrated_tip_counts, concentrated_node_counts, oldest_age, age_grid, lambdas, mus, psis, kappas, splines_degree, condition, relative_ODE_step, E_value_step, runtime_out_seconds)
}

simulate_deterministic_HBDS_CPP <- function(CSA_ages, CSA_probs, CSA_kappas, age_grid, lambdas, mus, psis, kappas, splines_degree, age0, N0, LTT0, requested_ages, ODE_relative_dt, ODE_relative_dy, runtime_out_seconds) {
    .Call(`_castor_simulate_deterministic_HBDS_CPP`, CSA_ages, CSA_probs, CSA_kappas, age_grid, lambdas, mus, psis, kappas, splines_degree, age0, N0, LTT0, requested_ages, ODE_relative_dt, ODE_relative_dy, runtime_out_seconds)
}

get_congruent_HBDS_CPP <- function(CSA_ages, CSA_pulled_probs, CSA_PSRs, age_grid, PSRs, PDRs, lambda_psis, lambdas, mus, psis, Reffs, removal_rates, lambda0, splines_degree, ODE_relative_dt, ODE_relative_dy, runtime_out_seconds) {
    .Call(`_castor_get_congruent_HBDS_CPP`, CSA_ages, CSA_pulled_probs, CSA_PSRs, age_grid, PSRs, PDRs, lambda_psis, lambdas, mus, psis, Reffs, removal_rates, lambda0, splines_degree, ODE_relative_dt, ODE_relative_dy, runtime_out_seconds)
}

simulate_fixed_rates_Markov_model_CPP <- function(Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, root_probabilities, include_tips, include_nodes, Nsimulations) {
    .Call(`_castor_simulate_fixed_rates_Markov_model_CPP`, Ntips, Nnodes, Nedges, Nstates, tree_edge, edge_length, transition_matrix, root_probabilities, include_tips, include_nodes, Nsimulations)
}

simulate_Ornstein_Uhlenbeck_on_tree_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, stationary_mean, stationary_std, decay_rate, include_tips, include_nodes, Nsimulations) {
    .Call(`_castor_simulate_Ornstein_Uhlenbeck_on_tree_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, stationary_mean, stationary_std, decay_rate, include_tips, include_nodes, Nsimulations)
}

simulate_reflected_Ornstein_Uhlenbeck_on_tree_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, reflection_point, stationary_std, decay_rate, include_tips, include_nodes, Nsimulations) {
    .Call(`_castor_simulate_reflected_Ornstein_Uhlenbeck_on_tree_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, reflection_point, stationary_std, decay_rate, include_tips, include_nodes, Nsimulations)
}

simulate_scalar_Brownian_motion_model_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, root_states, diffusivity, include_tips, include_nodes, Nsimulations) {
    .Call(`_castor_simulate_scalar_Brownian_motion_model_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, root_states, diffusivity, include_tips, include_nodes, Nsimulations)
}

simulate_multivariate_Brownian_motion_model_CPP <- function(Ntips, Nnodes, Nedges, Ntraits, Ndegrees, tree_edge, edge_length, root_states, sigma, include_tips, include_nodes, Nsimulations) {
    .Call(`_castor_simulate_multivariate_Brownian_motion_model_CPP`, Ntips, Nnodes, Nedges, Ntraits, Ndegrees, tree_edge, edge_length, root_states, sigma, include_tips, include_nodes, Nsimulations)
}

simulate_neutral_gene_evolution_CPP <- function(Ntips, Nnodes, Nedges, Nsites, Nstates, tree_edge, edge_length, root_states, mutation_rate, include_tips, include_nodes, include_gene_distances, Nsimulations) {
    .Call(`_castor_simulate_neutral_gene_evolution_CPP`, Ntips, Nnodes, Nedges, Nsites, Nstates, tree_edge, edge_length, root_states, mutation_rate, include_tips, include_nodes, include_gene_distances, Nsimulations)
}

generate_random_tree_CPP <- function(max_tips, max_extant_tips, max_time, max_time_since_equilibrium, birth_rate_intercept, birth_rate_factor, birth_rate_exponent, death_rate_intercept, death_rate_factor, death_rate_exponent, additional_rates_times, additional_birth_rates_pc, additional_death_rates_pc, additional_periodic, coalescent, Nsplits, as_generations, no_full_extinction, include_birth_times, include_death_times) {
    .Call(`_castor_generate_random_tree_CPP`, max_tips, max_extant_tips, max_time, max_time_since_equilibrium, birth_rate_intercept, birth_rate_factor, birth_rate_exponent, death_rate_intercept, death_rate_factor, death_rate_exponent, additional_rates_times, additional_birth_rates_pc, additional_death_rates_pc, additional_periodic, coalescent, Nsplits, as_generations, no_full_extinction, include_birth_times, include_death_times)
}

generate_random_tree_HBDS_CPP <- function(max_sampled_tips, max_sampled_nodes, max_extant_tips, max_extinct_tips, max_tips, max_time, time_grid, birth_rates, death_rates, sampling_rates, retention_probs, splines_degree, CSA_times, CSA_probs, CSA_kappas, as_generations, no_full_extinction, runtime_out_seconds, include_extant, include_extinct, include_birth_times, include_death_times) {
    .Call(`_castor_generate_random_tree_HBDS_CPP`, max_sampled_tips, max_sampled_nodes, max_extant_tips, max_extinct_tips, max_tips, max_time, time_grid, birth_rates, death_rates, sampling_rates, retention_probs, splines_degree, CSA_times, CSA_probs, CSA_kappas, as_generations, no_full_extinction, runtime_out_seconds, include_extant, include_extinct, include_birth_times, include_death_times)
}

get_tree_from_branching_ages_CPP <- function(branching_ages) {
    .Call(`_castor_get_tree_from_branching_ages_CPP`, branching_ages)
}

get_tree_from_sampling_branching_ages_CPP <- function(sampling_ages, branching_ages) {
    .Call(`_castor_get_tree_from_sampling_branching_ages_CPP`, sampling_ages, branching_ages)
}

generate_tree_from_PSR_CPP <- function(age_grid, PSR, splines_degree, Ntips, stem_age, crown_age, relative_dt, force_max_age, Ntrees) {
    .Call(`_castor_generate_tree_from_PSR_CPP`, age_grid, PSR, splines_degree, Ntips, stem_age, crown_age, relative_dt, force_max_age, Ntrees)
}

get_branching_ages_from_LTT_CPP <- function(ages, LTT) {
    .Call(`_castor_get_branching_ages_from_LTT_CPP`, ages, LTT)
}

generate_random_tree_BM_rates_CPP <- function(max_tips, max_time, max_time_since_equilibrium, birth_rate_diffusivity, min_birth_rate_pc, max_birth_rate_pc, death_rate_diffusivity, min_death_rate_pc, max_death_rate_pc, root_birth_rate_pc, root_death_rate_pc, coalescent, Nsplits, as_generations, include_event_times, include_rates) {
    .Call(`_castor_generate_random_tree_BM_rates_CPP`, max_tips, max_time, max_time_since_equilibrium, birth_rate_diffusivity, min_birth_rate_pc, max_birth_rate_pc, death_rate_diffusivity, min_death_rate_pc, max_death_rate_pc, root_birth_rate_pc, root_death_rate_pc, coalescent, Nsplits, as_generations, include_event_times, include_rates)
}

generate_random_tree_OU_rates_CPP <- function(max_tips, max_time, max_time_since_equilibrium, birth_rate_pc_mean, birth_rate_pc_decay_rate, birth_rate_pc_std, min_birth_rate_pc, max_birth_rate_pc, death_rate_pc_mean, death_rate_pc_std, death_rate_pc_decay_rate, min_death_rate_pc, max_death_rate_pc, root_birth_rate_pc, root_death_rate_pc, coalescent, Nsplits, as_generations, include_event_times, include_rates) {
    .Call(`_castor_generate_random_tree_OU_rates_CPP`, max_tips, max_time, max_time_since_equilibrium, birth_rate_pc_mean, birth_rate_pc_decay_rate, birth_rate_pc_std, min_birth_rate_pc, max_birth_rate_pc, death_rate_pc_mean, death_rate_pc_std, death_rate_pc_decay_rate, min_death_rate_pc, max_death_rate_pc, root_birth_rate_pc, root_death_rate_pc, coalescent, Nsplits, as_generations, include_event_times, include_rates)
}

generate_random_tree_Mk_rates_CPP <- function(max_tips, max_extant_tips, max_sampled_tips, max_time, max_time_since_equilibrium, max_events, Nstates, start_state, state_birth_rates, state_death_rates, state_sampling_rates, transition_matrix_A, transition_matrix_C, as_generations, no_full_extinction, include_extant, include_extinct, include_event_times, include_rates) {
    .Call(`_castor_generate_random_tree_Mk_rates_CPP`, max_tips, max_extant_tips, max_sampled_tips, max_time, max_time_since_equilibrium, max_events, Nstates, start_state, state_birth_rates, state_death_rates, state_sampling_rates, transition_matrix_A, transition_matrix_C, as_generations, no_full_extinction, include_extant, include_extinct, include_event_times, include_rates)
}

generate_random_tree_tdSSE_CPP <- function(max_tips, max_time, max_events, Nstates, start_state, time_grid, state_birth_rates, state_death_rates, transition_matrix_A, transition_matrix_C, splines_degree, coalescent, Nsplits, as_generations, no_full_extinction, include_birth_times, include_death_times) {
    .Call(`_castor_generate_random_tree_tdSSE_CPP`, max_tips, max_time, max_events, Nstates, start_state, time_grid, state_birth_rates, state_death_rates, transition_matrix_A, transition_matrix_C, splines_degree, coalescent, Nsplits, as_generations, no_full_extinction, include_birth_times, include_death_times)
}

generate_gene_tree_in_species_tree_MSC_CPP <- function(NStips, NSnodes, NSedges, tree_edge, edge_length, population_sizes, generation_times, mutation_rates, allele_counts, gene_edge_unit, Nsites, bottleneck_at_speciation, force_coalescence_at_root, ploidy) {
    .Call(`_castor_generate_gene_tree_in_species_tree_MSC_CPP`, NStips, NSnodes, NSedges, tree_edge, edge_length, population_sizes, generation_times, mutation_rates, allele_counts, gene_edge_unit, Nsites, bottleneck_at_speciation, force_coalescence_at_root, ploidy)
}

generate_gene_tree_in_species_tree_MSC_HGT_DL_CPP <- function(NStips, NSnodes, NSedges, tree_edge, edge_length, population_sizes, generation_times, mutation_rates, HGT_rates, duplication_rates, loss_rates, allele_counts, gene_edge_unit, Nsites, bottleneck_at_speciation, force_coalescence_at_root, ploidy, HGT_source_by_locus, HGT_only_to_empty_clades, no_loss_before_time, runtime_out_seconds, include_event_times) {
    .Call(`_castor_generate_gene_tree_in_species_tree_MSC_HGT_DL_CPP`, NStips, NSnodes, NSedges, tree_edge, edge_length, population_sizes, generation_times, mutation_rates, HGT_rates, duplication_rates, loss_rates, allele_counts, gene_edge_unit, Nsites, bottleneck_at_speciation, force_coalescence_at_root, ploidy, HGT_source_by_locus, HGT_only_to_empty_clades, no_loss_before_time, runtime_out_seconds, include_event_times)
}

simulate_deterministic_HBD_MSC_CPP <- function(oldest_age, age_grid, PSRs, CTs, rho0, sLTT0, gLTT0, splines_degree, relative_dt) {
    .Call(`_castor_simulate_deterministic_HBD_MSC_CPP`, oldest_age, age_grid, PSRs, CTs, rho0, sLTT0, gLTT0, splines_degree, relative_dt)
}

geodesic_angles_CPP <- function(latitudes1, longitudes1, latitudes2, longitudes2) {
    .Call(`_castor_geodesic_angles_CPP`, latitudes1, longitudes1, latitudes2, longitudes2)
}

get_all_pairwise_geodesic_angles_CPP <- function(latitudes1, longitudes1, latitudes2, longitudes2) {
    .Call(`_castor_get_all_pairwise_geodesic_angles_CPP`, latitudes1, longitudes1, latitudes2, longitudes2)
}

draw_SBM_geodesic_angle_CPP <- function(tD) {
    .Call(`_castor_draw_SBM_geodesic_angle_CPP`, tD)
}

simulate_SBM_on_tree_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, radius, diffusivity, root_theta, root_phi) {
    .Call(`_castor_simulate_SBM_on_tree_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, radius, diffusivity, root_theta, root_phi)
}

simulate_SBM_trajectory_CPP <- function(times, radius, diffusivity, start_theta, start_phi) {
    .Call(`_castor_simulate_SBM_trajectory_CPP`, times, radius, diffusivity, start_theta, start_phi)
}

simulate_TSBM_on_tree_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, radius, time_grid, diffusivities, splines_degree, root_theta, root_phi) {
    .Call(`_castor_simulate_TSBM_on_tree_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, radius, time_grid, diffusivities, splines_degree, root_theta, root_phi)
}

move_points_on_sphere_CPP <- function(radius, old_latitudes, old_longitudes, distances, directions) {
    .Call(`_castor_move_points_on_sphere_CPP`, radius, old_latitudes, old_longitudes, distances, directions)
}

SBM_LLs_of_transitions_CPP <- function(radius, time_steps, distances, diffusivities, max_error, max_Legendre_terms) {
    .Call(`_castor_SBM_LLs_of_transitions_CPP`, radius, time_steps, distances, diffusivities, max_error, max_Legendre_terms)
}

SBM_LLs_of_sampled_transitions_CPP <- function(radius, time_steps, old_thetas, old_phis, new_thetas, new_phis, diffusivities, Nlat, Nlon, sampling_rates, max_error, max_Legendre_terms) {
    .Call(`_castor_SBM_LLs_of_sampled_transitions_CPP`, radius, time_steps, old_thetas, old_phis, new_thetas, new_phis, diffusivities, Nlat, Nlon, sampling_rates, max_error, max_Legendre_terms)
}

SBM_get_SBM_PD_functor_CPP <- function(max_error, max_Legendre_terms) {
    .Call(`_castor_SBM_get_SBM_PD_functor_CPP`, max_error, max_Legendre_terms)
}

SBM_get_average_transition_angle_CPP <- function(tD, max_error, max_Legendre_terms) {
    .Call(`_castor_SBM_get_average_transition_angle_CPP`, tD, max_error, max_Legendre_terms)
}

TSBM_LL_of_transitions_CPP <- function(radius, MRCA_times, child_times1, child_times2, distances, time_grid, diffusivities, splines_degree, SBM_PD_functor) {
    .Call(`_castor_TSBM_LL_of_transitions_CPP`, radius, MRCA_times, child_times1, child_times2, distances, time_grid, diffusivities, splines_degree, SBM_PD_functor)
}

TSBM_LL_of_sampled_transitions_CPP <- function(radius, MRCA_times, child_times1, child_times2, old_thetas, old_phis, new_thetas, new_phis, time_grid, diffusivities, splines_degree, Nlat, Nlon, sampling_rates, SBM_PD_functor) {
    .Call(`_castor_TSBM_LL_of_sampled_transitions_CPP`, radius, MRCA_times, child_times1, child_times2, old_thetas, old_phis, new_thetas, new_phis, time_grid, diffusivities, splines_degree, Nlat, Nlon, sampling_rates, SBM_PD_functor)
}

fit_SBM_diffusivity_from_transitions_CPP <- function(radius, time_steps, distances, max_error, max_Legendre_terms, opt_epsilon, max_iterations, min_diffusivity, max_diffusivity, Nbootstraps, SBM_PD_functor) {
    .Call(`_castor_fit_SBM_diffusivity_from_transitions_CPP`, radius, time_steps, distances, max_error, max_Legendre_terms, opt_epsilon, max_iterations, min_diffusivity, max_diffusivity, Nbootstraps, SBM_PD_functor)
}

fit_SBM_from_sampled_transitions_CPP <- function(radius, time_steps, old_thetas, old_phis, new_thetas, new_phis, Nlat, Nlon, sampling_rates, max_error, max_Legendre_terms, opt_epsilon, max_iterations, min_diffusivity, max_diffusivity, Nbootstraps) {
    .Call(`_castor_fit_SBM_from_sampled_transitions_CPP`, radius, time_steps, old_thetas, old_phis, new_thetas, new_phis, Nlat, Nlon, sampling_rates, max_error, max_Legendre_terms, opt_epsilon, max_iterations, min_diffusivity, max_diffusivity, Nbootstraps)
}

ACF_spherical_CPP <- function(Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_latitudes, tip_longitudes, max_Npairs, phylodistance_grid, max_phylodistance, grid_is_uniform, verbose, verbose_prefix) {
    .Call(`_castor_ACF_spherical_CPP`, Ntips, Nnodes, Nedges, tree_edge, edge_length, tip_latitudes, tip_longitudes, max_Npairs, phylodistance_grid, max_phylodistance, grid_is_uniform, verbose, verbose_prefix)
}

read_fasta_from_file_CPP <- function(fasta_path, include_headers, include_sequences) {
    .Call(`_castor_read_fasta_from_file_CPP`, fasta_path, include_headers, include_sequences)
}

read_distances_list_CPP <- function(file_path, delimiter, comment_prefix, distances_column, min_distance, max_distance, max_Nedges, verbose_interval, verbose_prefix) {
    .Call(`_castor_read_distances_list_CPP`, file_path, delimiter, comment_prefix, distances_column, min_distance, max_distance, max_Nedges, verbose_interval, verbose_prefix)
}

Try the castor package in your browser

Any scripts or data that you put into this service are public.

castor documentation built on Aug. 18, 2023, 1:07 a.m.