[Adephylo-commits] r144 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 10 14:00:37 CET 2010


Author: jombart
Date: 2010-03-10 14:00:37 +0100 (Wed, 10 Mar 2010)
New Revision: 144

Modified:
   pkg/src/sptips.c
Log:
forgot to commit this - what the hell is this??


Modified: pkg/src/sptips.c
===================================================================
--- pkg/src/sptips.c	2010-03-07 19:51:29 UTC (rev 143)
+++ pkg/src/sptips.c	2010-03-10 13:00:37 UTC (rev 144)
@@ -277,19 +277,31 @@
 */
 void sptips(int *ances, int *desc, int N, int tipA, int tipB, int N, int **res, inr *resSize){
 	/* declarations */
-	int k, *pathAroot, *pathBroot, *lengthPathA, *lengthPathB, myMrca;
+	int i, k, *pathAroot, *pathBroot, *lengthPathA, *lengthPathB, myMrca;
 
 	/* allocate memory for local variables */
 	vecintalloc(&ancesLoc, N);
 	vecintalloc(&descLoc, N);
 
+
+	/* create local vectors for ancestors and descendents */
+	ancesLoc[0] = N;
+	descLoc[0] = N;
+	for(i=0; i<N; i++){
+		ancesLoc[i+1] = ances[i];
+		descLoc[i+1] = desc[i];
+	}
+
+
 	/* find paths to the root */
 	pathTipToRoot(tipA, ances, desc, N, pathAroot, lengthPathA);
 	pathTipToRoot(tipB, ances, desc, N, pathBroot, lengthPathB);
 
+
 	/* find the MRCA between both tips */
 	myMrca = mrca(ances, desc, tipsA, tipsB, N);
 
+
 	/* go back the paths and stop at MRCA (exclude MRCA) */
 	/* for A */
 	k = 1;
@@ -300,6 +312,7 @@
 		k++;
 	}
 
+
 	/* for B */
 	k = 1;
 	while(pathBroot[k] != myMrca){ /* ### reprendre ici.*/
@@ -328,6 +341,22 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 void sharedAll(int *matAll, int *nRow, int *nCol, double *resVec)
 {
 /* Declare local C variables */



More information about the Adephylo-commits mailing list