aboutsummaryrefslogtreecommitdiff
path: root/sys/libbio/phylo.c
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-09-08 15:51:40 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-09-08 15:51:53 -0700
commitc0a7b53baf2a6e7bf9bc1fbec7ac05e43ac59154 (patch)
tree385b83f4d505da960820932f7357eb46b31abac3 /sys/libbio/phylo.c
parent8c0475f97675245d1bcbb112dc79c9f490fad361 (diff)
checkin
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;
-}