[Adephylo-commits] r151 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 12 13:17:26 CET 2010


Author: jombart
Date: 2010-03-12 13:17:26 +0100 (Fri, 12 Mar 2010)
New Revision: 151

Added:
   pkg/src/sptips.h
Modified:
   pkg/src/sptips.c
Log:
Added a header file for sptips.
Commented out debugging stuff.


Modified: pkg/src/sptips.c
===================================================================
--- pkg/src/sptips.c	2010-03-11 23:19:46 UTC (rev 150)
+++ pkg/src/sptips.c	2010-03-12 12:17:26 UTC (rev 151)
@@ -443,13 +443,13 @@
 /*
 
 library(adephylo)
-tre=rtree(1000)
+tre=rtree(10)
 plot(tre)
 nodelabels()
 tiplabels()
 
-res <- resId <- integer(1e8)
-resSize=as.integer(1e8)
+res <- resId <- integer(1e5)
+resSize=as.integer(1e5)
 
 # void spalltips(int *ances, int *desc, int *N, int *nTips, int *res, int *resId, int *resSize){
 

Added: pkg/src/sptips.h
===================================================================
--- pkg/src/sptips.h	                        (rev 0)
+++ pkg/src/sptips.h	2010-03-12 12:17:26 UTC (rev 151)
@@ -0,0 +1,29 @@
+/* Notes:
+   these functions are used to find the shortest path between specified pairs of tips.
+   The algorithm proceeds as follows:
+   1) find the paths (pathA, pathB) to the root
+   2) find the MRCA, defined as the first term of pathA in pathB (same as the converse)
+   3) from A, go back to MRCA, adding crossed nodes to the result, not including the MRCA
+   4) from B, go back to MRCA, adding crossed nodes to the result, not including the MRCA
+   5) add the MRCA to the output
+   6) return the output
+*/
+
+
+#include <math.h>
+#include <time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <R.h>
+#include <R_ext/Utils.h>
+#include "adesub.h"
+
+
+int intAinB(int a, int *b, int lengthB);
+void intANotInB(int *a, int *b, int lengthA, int lengthB, int *res, int *resSize);
+void unionInt(int *a, int *b, int lengthA, int lengthB, int *res, int *resSize);
+void intersectInt(int *a, int *b, int lengthA, int lengthB, int *res, int *resSize);
+void pathTipToRoot(int tip, int *ances, int *desc, int N, int *res, int *resSize);
+int mrca2tips(int *ances, int*desc, int a, int b, int N);
+void sp2tips(int *ances, int *desc, int N, int tipA, int tipB, int *res, int *resSize);
+void spalltips(int *ances, int *desc, int *N, int *nTips, int *res, int *resId, int *resSize);



More information about the Adephylo-commits mailing list