public ReRootedTree(RootedTree source,Node ingroupNode,Node outgroupNode,double ingroupBranchLength) throws NoEdgeException {
  this.source=source;
  List<Node> children=new ArrayList<Node>();
  Node node1=createNodes(source,outgroupNode,ingroupNode);
  setLength(node1,ingroupBranchLength);
  children.add(node1);
  Node node2=createNodes(source,ingroupNode,outgroupNode);
  double l=source.getEdgeLength(ingroupNode,outgroupNode);
  if (outgroupNode == source.getRootNode()) {
    for (    Node adj : source.getAdjacencies(outgroupNode)) {
      if (adj != ingroupNode) {
        l+=source.getEdgeLength(outgroupNode,adj);
      }
    }
  }
  setLength(node2,Math.max(l - ingroupBranchLength,0.0));
  children.add(node2);
  createInternalNode(null,children);
}

public ReRootedTree ( RootedTree source , Node ingroupNode , Node outgroupNode , double ingroupBranchLength ) throws NoEdgeException { this . source = source ; List < Node > children = new ArrayList < Node > ( ) ; Node node1 = createNodes ( source , outgroupNode , ingroupNode ) ; setLength ( node1 , ingroupBranchLength ) ; children . add ( node1 ) ; Node node2 = createNodes ( source , ingroupNode , outgroupNode ) ; double l = source . getEdgeLength ( ingroupNode , outgroupNode ) ; if ( outgroupNode == source . getRootNode ( ) ) { for ( Node adj : source . getAdjacencies ( outgroupNode ) ) { if ( adj != ingroupNode ) { l += source . getEdgeLength ( outgroupNode , adj ) ; } } } setLength ( node2 , Math . max ( l - ingroupBranchLength , 0.0 ) ) ; children . add ( node2 ) ; createInternalNode ( null , children ) ; }
make a copy of the given unrooted tree
