aboutsummaryrefslogtreecommitdiff
path: root/sys/libbio/phylo.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/libbio/phylo.c')
-rw-r--r--sys/libbio/phylo.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/sys/libbio/phylo.c b/sys/libbio/phylo.c
index 1bb5bc7..920102b 100644
--- a/sys/libbio/phylo.c
+++ b/sys/libbio/phylo.c
@@ -107,7 +107,7 @@ phylo·postorder(bio·Node *clade, void *(*op)(bio·Node*, void*), void *ctx)
{
bio·Node *it;
- for (it = clade->child; it != nil; it = it->sibling) {
+ for(it = clade->child; it != nil; it = it->sibling) {
ctx = phylo·postorder(it, op, ctx);
}
@@ -120,13 +120,26 @@ phylo·preorder(bio·Node *clade, void *(*op)(bio·Node*, void*), void *ctx)
bio·Node *it;
ctx = op(clade, ctx);
- for (it = clade->child; it != nil; it = it->sibling) {
+ for(it = clade->child; it != nil; it = it->sibling) {
ctx = phylo·preorder(it, op, ctx);
}
return ctx;
}
+int
+phylo·collectpostorder(bio·Node *clade, bio·Node **list)
+{
+ bio·Node *it;
+ int n;
+
+ for(n = 0, it = clade->child; it != nil; it = it->sibling) {
+ n += phylo·collectpostorder(it, list+n);
+ }
+
+ return n;
+}
+
static
inline
void*
@@ -412,18 +425,3 @@ phylo·reroot(bio·Tree *tree, bio·Node *node, double d)
return 0;
}
#undef PREC
-
-// -----------------------------------------------------------------------
-// ancestral inference
-
-struct phylo·InferOpts
-{
- int nstates;
- double *Q;
-};
-
-error
-phylo·inferancestral(bio·Tree *tree, struct phylo·InferOpts opts)
-{
- return 0;
-}