コード例 #1
0
 /*..........................................ContinuousHistory................*/
 private void fillDistribution(Tree tree, int node, ContinuousAdjustable dist) {
   if (tree.nodeIsTerminal(node)) {
     int t = tree.taxonNumberOfNode(node);
     for (int i = 0; i < getNumItems(); i++) dist.setState(t, i, getState(node, i));
   } else
     for (int d = tree.firstDaughterOfNode(node); tree.nodeExists(d); d = tree.nextSisterOfNode(d))
       fillDistribution(tree, d, dist);
 }
コード例 #2
0
 /*..........................................ContinuousHistory................*/
 public void calcMinMaxStates(Tree tree, int node) {
   for (int i = 0; i < getNumItems(); i++) {
     double s = getState(node, i);
     maxState = MesquiteDouble.maximum(maxState, s);
     minState = MesquiteDouble.minimum(minState, s);
   }
   for (int d = tree.firstDaughterOfNode(node); tree.nodeExists(d); d = tree.nextSisterOfNode(d))
     calcMinMaxStates(tree, d);
 }