X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fbionjs.c;h=2ec13d49139dc2bce6f0f9562ebd31970e5a97aa;hb=dc2dda7eb763b4e140f1e5adb7fa8bfaa2661f6d;hp=b3f599b8a679c4e0819b1e399cd61a53fb252d61;hpb=ef34642fe85694df0a80ef534137b8f6b427b67e;p=ape.git diff --git a/src/bionjs.c b/src/bionjs.c index b3f599b..2ec13d4 100644 --- a/src/bionjs.c +++ b/src/bionjs.c @@ -1,6 +1,6 @@ -/* bionjs.c 2011-10-11 */ +/* bionjs.c 2012-04-02 */ -/* Copyright 2011 Andrei-Alin Popescu */ +/* Copyright 2011-2012 Andrei-Alin Popescu */ /* This file is part of the R-package `ape'. */ /* See the file ../COPYING for licensing issues. */ @@ -65,6 +65,10 @@ void bionjs(double *D, int *N, int *edge1, int *edge2, double *edge_length,int* if(k==i || k==j) { + /* added 2012-04-02: */ + if(i!=k)R[give_index(i,j,n)]+=D[give_index(i,k,n)]; + if(j!=k)R[give_index(i,j,n)]+=D[give_index(j,k,n)]; + /* end of addition */ s[give_index(i,j,n)]++; continue; } @@ -141,9 +145,9 @@ void bionjs(double *D, int *N, int *edge1, int *edge2, double *edge_length,int* } } - /*Rprintf("agglomerating %i and %i, Q=%f \n",OTU1,OTU2,smallest_S); + //Rprintf("agglomerating %i and %i, Q=%f \n",OTU1,OTU2,smallest_S); - for(i=1;i