⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 str_addelementlen.c

📁 fastDNAml is an attempt to solve the same problem as DNAML, but to do so faster and using less memo
💻 C
字号:
#include  <stdlib.h>#include  <stdio.h>#include  <string.h>#include  <math.h>#include  "fastDNAml_types.h"#include  "fastDNAml_funcs.h"extern FILE *dbgfp;boolean  str_addElementLen (char **treestrp, tree *tr, nodeptr p)  { /* str_addElementLen */    double   z, branch;    nodeptr  q;    int      n, ch;    if ((ch = str_treeGetCh(treestrp)) == '(') { /*  A new internal node */      n = (tr->nextnode)++;      if (n > 2*(tr->mxtips) - 2) {        if (tr->rooted || n > 2*(tr->mxtips) - 1) {          printf("ERROR: too many internal nodes.  Is tree rooted?\n");          printf("Deepest splitting should be a trifurcation.\n");          return  FALSE;        }        else {          tr->rooted = TRUE;        }      }      q = tr->nodep[n];      if (! str_addElementLen(treestrp, tr, q->next))          return FALSE;      if (! str_treeNeedCh(treestrp, ',', "in"))               return FALSE;      if (! str_addElementLen(treestrp, tr, q->next->next))    return FALSE;      if (! str_treeNeedCh(treestrp, ')', "in"))               return FALSE;    /*if (! str_treeFlushLabel(treestrp))                      return FALSE;*//*DKB-orig*/    }    else {                           /*  A new tip */    /*n = str_treeFindTipName(treestrp, tr, ch);*/ /*DKB-orig*/      if(ch=='\'') (*treestrp)--;                  /*DKB-change*/      n = str_treeFindTipName(treestrp, tr);       /*DKB-change*/      if (n <= 0) return FALSE;      q = tr->nodep[n];      if (tr->start->number > n)  tr->start = q;      (tr->ntips)++;    }    /*  Master and Slave always use lengths */    if (! str_treeNeedCh(treestrp, ':', "in"))                 return FALSE;    if (! str_treeProcessLength(treestrp, &branch))            return FALSE;    z = exp(-branch / tr->rdta->fracchange);    if (z > zmax)  z = zmax;    hookup(p, q, z);    return  TRUE;  } /* str_addElementLen */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -