virtual void processNode(InternalNode &V) { V.setLeftSubstMatrix(Q.instantiate(V.getLeftDistance())); V.setRightSubstMatrix(Q.instantiate(V.getRightDistance())); int id=V.getID(); if(id>largestID) largestID=id; ++numNodes; }
virtual void processNode(InternalNode &u) { int id=u.getID(); PhylogenyNode *left=u.getLeft(), *right=u.getRight(); NthOrdSubstMatrix &leftPt=*u.getLeftSubstMatrix(); NthOrdSubstMatrix &rightPt=*u.getRightSubstMatrix(); Array2D<double>::RowIn2DArray<double> row=L[id]; for(Symbol a=0 ; a<numAlpha ; ++a) { row[a]= processInternalChild(a,left,leftPt,&u)+ processInternalChild(a,right,rightPt,&u); } }
virtual void processNode(InternalNode &u) { int id=u.getID(); Array2D<double>::RowIn2DArray<double> row=L[id]; Taxon *taxon=static_cast<Taxon*>(u.getDecoration()); SubstitutionMatrix &leftPt=getMatrix(*taxon,LEFT); SubstitutionMatrix &rightPt=getMatrix(*taxon,RIGHT); int left=u.getLeft()->getID(), right=u.getRight()->getID(); for(Symbol a=0 ; a<numAlpha ; ++a) if(a!=gap) row[a]= processInternalChild(a,left,leftPt)+ processInternalChild(a,right,rightPt); }
virtual void processNode(InternalNode &u) { int id=u.getID(); int left=u.getLeft()->getID(), right=u.getRight()->getID(); NthOrdSubstMatrix &leftPt=*u.getLeftSubstMatrix(); NthOrdSubstMatrix &rightPt=*u.getRightSubstMatrix(); Array2D<double>::RowIn2DArray<double> row=L[id]; for(Symbol a=0 ; a<numAlpha ; ++a) { if(gapSymbols.isMember(a)) continue; row[a]= processInternalChild(a,left,leftPt,0,0)+ processInternalChild(a,right,rightPt,0,0); } }
virtual void processNode(InternalNode &u) { int id=u.getID(); Array2D<double>::RowIn2DArray<double> row=L[id]; int left=u.getLeft()->getID(), right=u.getRight()->getID(); NthOrdSubstMatrix &leftPt=*u.getLeftSubstMatrix(); NthOrdSubstMatrix &rightPt=*u.getRightSubstMatrix(); Sequence nmer; for(int i=0 ; i<numNmers ; ++i) { nmer.fromInt(i,numCols,alphabetMap); row[i]= processInternalChild(nmer,left,leftPt)+ processInternalChild(nmer,right,rightPt); } }
virtual void processNode(InternalNode &u) { int id=u.getID(); NthOrdSubstMatrix &leftPt=*u.getLeftSubstMatrix(); NthOrdSubstMatrix &rightPt=*u.getRightSubstMatrix(); int left=u.getLeft()->getID(), right=u.getRight()->getID(); Array2D<double>::RowIn2DArray<double> row=L[id]; Symbol a=A.getIthTrack(id)[column]; if(gapSymbols.isMember(a)) for(a=0 ; a<numAlpha ; ++a) { if(gapSymbols.isMember(a)) continue; row[a]= processInternalChild(a,id,left,leftPt)+ processInternalChild(a,id,right,rightPt); } else { for(Symbol b=0 ; b<numAlpha ; ++b) row[b]=NEGATIVE_INFINITY; double l=processInternalChild(a,id,left,leftPt); double r=processInternalChild(a,id,right,rightPt); row[a]=l+r; } }