1 ## additive.R (2011-10-11)
3 ## Incomplete Distance Matrix Filling
5 ## Copyright 2011 Andrei-Alin Popescu
7 ## This file is part of the R-package `ape'.
8 ## See the file ../COPYING for licensing issues.
10 .addit_ultra <- function(libs, X)
12 if (is.matrix(X)) X <- as.dist(X)
17 labels <- attr(X, "Labels")
18 if (is.null(labels)) labels <- as.character(1:N)
20 ans <- .C(libs, as.double(X), as.integer(N),
21 as.integer(m), double(N*N), PACKAGE = "ape")
22 matrix(ans[[4]], N, N)
25 additive <- function(X) .addit_ultra("additive", X)
27 ultrametric <- function(X) .addit_ultra("ultrametric", X)