X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fnj.c;h=21b4c1e00f0cbbd164a9b10986262d54da8fb26c;hb=a0436318d70829a2d16134be7ca1d6d454613a20;hp=9d0b8f66a7ae5df84fb072fb228cc3a969ee8476;hpb=bd55cf71ae1a3d20d237d7fdd36af138c21769df;p=ape.git diff --git a/src/nj.c b/src/nj.c index 9d0b8f6..21b4c1e 100644 --- a/src/nj.c +++ b/src/nj.c @@ -1,21 +1,11 @@ -/* nj.c 2010-04-21 */ +/* nj.c 2011-10-20 */ -/* Copyright 2006-2010 Emmanuel Paradis +/* Copyright 2006-2011 Emmanuel Paradis /* This file is part of the R-package `ape'. */ /* See the file ../COPYING for licensing issues. */ -#include - -#define DINDEX(i, j) n*(i - 1) - i*(i - 1)/2 + j - i - 1 -/* works if i < j strictly, and i = 1, ...; - see give_index() below */ - -int give_index(int i, int j, int n) -{ - if (i > j) return(DINDEX(j, i)); - else return(DINDEX(i, j)); -} +#include "ape.h" double sum_dist_to_i(int n, double *D, int i) /* returns the sum of all distances D_ij between i and j