Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/build_postorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void random_tree(int *parent_of, int *left, int *right, const int *n_tip) {
extern SEXP RANDOM_TREE(SEXP ntip) {
const int n_tip = INTEGER(ntip)[0];
if (n_tip < 2) {
Rf_error("n_tip must be at least two");
(Rf_error)("n_tip must be at least two");
}
SEXP RESULT = PROTECT(allocVector(VECSXP, 3)),
PARENT_OF = PROTECT(allocVector(INTSXP, n_tip + n_tip - 1)),
Expand All @@ -155,7 +155,7 @@ extern SEXP RANDOM_TREE(SEXP ntip) {
extern SEXP RANDOM_TREE_SCORE(SEXP ntip, SEXP MorphyHandl) {
const int n_tip = INTEGER(ntip)[0];
if (n_tip < 2) {
Rf_error("n_tip must be at least two");
(Rf_error)("n_tip must be at least two");
}
Morphy handl = R_ExternalPtrAddr(MorphyHandl);
SEXP RESULT = PROTECT(allocVector(INTSXP, 1));
Expand Down
6 changes: 3 additions & 3 deletions src/rearrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,13 @@ List all_spr (const IntegerMatrix edge,
// So we test for these exceptions in R.
// # nocov begin
if (n_edge < 5) {
Rf_error("No SPR rearrangements possible on a tree with < 5 edges");
Rcpp::stop("No SPR rearrangements possible on a tree with < 5 edges");
}
if (edge(0, 0) != root_node) {
Rf_error("edge[1,] must connect root to leaf. Try Preorder(root(tree)).");
Rcpp::stop("edge[1,] must connect root to leaf. Try Preorder(root(tree)).");
}
if (edge(1, 0) != root_node) {
Rf_error("edge[2,] must connect root to leaf. Try Preorder(root(tree)).");
Rcpp::stop("edge[2,] must connect root to leaf. Try Preorder(root(tree)).");
}
// # nocov end

Expand Down
Loading