- if (method == "BHV01" && (is.null(x$edge.length) || is.null(y$edge.length)))
- stop("trees must have branch lengths for Billera et al.'s distance.")
- n <- length(x$tip.label)
- bp1 <- .Call("bipartition", x$edge, n, x$Nnode, PACKAGE = "ape")
+ if (method == "score" && (is.null(x$edge.length) || is.null(y$edge.length)))
+ stop("trees must have branch lengths for Billera et al.'s distance.")
+ nx <- length(x$tip.label)
+ x <- unroot(x)
+ y <- unroot(y)
+ bp1 <- .Call("bipartition", x$edge, nx, x$Nnode, PACKAGE = "ape")