]> git.donarmstrong.com Git - ape.git/blobdiff - src/ewLasso.c
final commit for ape 3.0-8
[ape.git] / src / ewLasso.c
index a59f3c77645109662818fca17a16c5b8c889aa76..dc07b8c86c505d62ef9696a80f9a1b125ca8b452 100644 (file)
@@ -22,7 +22,7 @@ int isTripletCover(int nmb, int n, int** s, int stat, int sSoFar[n], int* a)//nu
                 {
                         if(!sSoFar[j])continue;//not in set so far
                         if(!a[i*(n+1)+j]){//if not, then i is not a good candidate for this side
-                                  //Rprintf("failed to find distance between %i and %i, a[%i][%i]=%i \n",i,j,i,j,a[i*(n+1)+j]); 
+                                  //Rprintf("failed to find distance between %i and %i, a[%i][%i]=%i \n",i,j,i,j,a[i*(n+1)+j]);
                                   sw=0;
                               }
                 }
@@ -55,8 +55,8 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
                 {
                  a[i*(n+1)+j]=a[j*(n+1)+i]=0;
                 }
-               else  
-                { 
+               else
+                {
                  a[i*(n+1)+j]=a[j*(n+1)+i]=1;// otherwise edge between pair of taxa (i,j) in G
                 }
           }
@@ -85,7 +85,7 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
    while(comp)
    {
    q[p]=ini;
-   v[ini]=1; 
+   v[ini]=1;
    comp=0;
    int stNBipartiteLoc=0;//check if current connected component is bipartite
    while(p<u)//BFS
@@ -135,7 +135,7 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
    //adjencency matrix of tree, 1 to n are leaves
 
    int *at= R_alloc((2*n-1)*(2*n-1), sizeof(int));
-   
+
    for(i=1;i<=2*n-2;i++)
     {
          for(j=1;j<=2*n-2;j++)at[i*(2*n-1)+j]=0;
@@ -157,7 +157,7 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
     }*/
 
    for(i=n+1;i<=2*n-2;i++)//for each interior vertex
-    {   
+    {
      for(j=1;j<2*n-1;j++)//reset queue and visited veectors
        {
                v[j]=-1;
@@ -165,7 +165,7 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
        }
 
         v[i]=1;//'disconnect' graph at i
-        int *l=(int*)R_alloc(2*n-2, sizeof(int));//vertices adjacent to i              
+        int *l=(int*)R_alloc(2*n-2, sizeof(int));//vertices adjacent to i
 
      int nmb=0;//number of found adjacent vertices of i
 
@@ -220,7 +220,7 @@ void ewLasso(double *D, int *N, int *e1, int *e2)
                        p++;
                  }
           }
-        
+
         /*Rprintf("sides for %i\n",i);
         for(j=0;j<nmb;j++)
          {