bpp-phyl
2.2.0
|
Interface for Nearest Neighbor Interchanges algorithms. More...
#include <Bpp/Phyl/NNISearchable.h>
Public Member Functions | |
NNISearchable () | |
virtual | ~NNISearchable () |
virtual NNISearchable * | clone () const =0 |
virtual double | testNNI (int nodeId) const =0 throw (NodeException) |
Send the score of a NNI movement, without performing it. More... | |
virtual void | doNNI (int nodeId)=0 throw (NodeException) |
Perform a NNI movement. More... | |
virtual const Tree & | getTopology () const =0 |
Get the tree associated to this NNISearchable object. More... | |
virtual double | getTopologyValue () const =0 throw (Exception) |
Get the current score of this NNISearchable object. More... | |
virtual void | topologyChangePerformed (const TopologyChangeEvent &event) |
Notify a topology change event. More... | |
virtual void | topologyChangeTested (const TopologyChangeEvent &event)=0 |
Notify a topology change event. More... | |
virtual void | topologyChangeSuccessful (const TopologyChangeEvent &event)=0 |
Tell that a topology change is definitive. More... | |
Interface for Nearest Neighbor Interchanges algorithms.
This interface defines the methods to work with NNI algorithms.
NNISearchable objects are supposed to work with TreeTemplate objects. NNI are defined as follow:
-------------> +------- C | D --+ X +-- B | | +----+ F | +-- A
Where: -F is the focus (parent) node, -A and B are the son of F -X is the parent of F and so on. Two NNI's are possible for branch (XF):
For unrooted tree, we have at the 'root' node:
-------------> +------- D | X +------- C | | +-- B | | +----+ F | +-- A
In this case, we swap A or B with one of C or D. Which one of C or D depends on the implementation, but will always be the same, so that swapping A or B involve 2 distinct NNI.
Definition at line 96 of file NNISearchable.h.
|
inline |
Definition at line 101 of file NNISearchable.h.
|
inlinevirtual |
Definition at line 102 of file NNISearchable.h.
|
pure virtual |
Implements bpp::TopologyListener.
Implemented in bpp::NNIHomogeneousTreeLikelihood, and bpp::DRTreeParsimonyScore.
Referenced by bpp::NNITopologySearch::searchPhyML().
|
pure virtual |
Perform a NNI movement.
nodeId | The id of the node defining the NNI movement. |
NodeException | If the node does not define a valid NNI. |
Implemented in bpp::NNIHomogeneousTreeLikelihood, and bpp::DRTreeParsimonyScore.
|
pure virtual |
Get the tree associated to this NNISearchable object.
Implemented in bpp::NNIHomogeneousTreeLikelihood, and bpp::DRTreeParsimonyScore.
Referenced by bpp::NNITopologySearch::getTopology().
|
pure virtual |
Get the current score of this NNISearchable object.
Implemented in bpp::NNIHomogeneousTreeLikelihood, and bpp::DRTreeParsimonyScore.
|
pure virtual |
Send the score of a NNI movement, without performing it.
This methods sends the score variation. This variation must be negative if the new point is better, i.e. the object is to be used with a minimizing optimization (for consistence with Optimizer objects).
nodeId | The id of the node defining the NNI movement. |
NodeException | If the node does not define a valid NNI. |
Implemented in bpp::NNIHomogeneousTreeLikelihood, and bpp::DRTreeParsimonyScore.
|
inlinevirtualinherited |
Notify a topology change event.
This method is to be invoked after one or several NNI are performed. It allows appropriate recomputations.
In most case, this is the same as topologyChangeTested() + topologyChangeSuccessful().
event | The topology change event. |
Definition at line 105 of file TopologySearch.h.
References bpp::TopologyListener::topologyChangeSuccessful(), and bpp::TopologyListener::topologyChangeTested().
|
pure virtualinherited |
Tell that a topology change is definitive.
This method is called after the topologyChangeTested() method.
event | The topology change event. |
Implemented in bpp::NNITopologyListener2, bpp::NNIHomogeneousTreeLikelihood, bpp::NNITopologyListener, and bpp::DRTreeParsimonyScore.
Referenced by bpp::TopologyListener::topologyChangePerformed().
|
pure virtualinherited |
Notify a topology change event.
event | The topology change event. |
Implemented in bpp::NNITopologyListener2, bpp::NNIHomogeneousTreeLikelihood, bpp::NNITopologyListener, and bpp::DRTreeParsimonyScore.
Referenced by bpp::TopologyListener::topologyChangePerformed().