bpp-phyl3  3.0.0
bpp::NNITopologyListener Class Reference

Listener used internally by the optimizeTreeNNI method. More...

#include <Bpp/Phyl/Legacy/OptimizationTools.h>

+ Inheritance diagram for bpp::NNITopologyListener:
+ Collaboration diagram for bpp::NNITopologyListener:

Public Member Functions

 NNITopologyListener (std::shared_ptr< NNITopologySearch > ts, const ParameterList &parameters, double tolerance, std::shared_ptr< OutputStream > messenger, std::shared_ptr< OutputStream > profiler, unsigned int verbose, const std::string &optMethod, unsigned int nStep, bool reparametrization)
 Build a new NNITopologyListener object. More...
 
 NNITopologyListener (const NNITopologyListener &tl)
 
NNITopologyListeneroperator= (const NNITopologyListener &tl)
 
NNITopologyListenerclone () const
 
virtual ~NNITopologyListener ()
 
void topologyChangeTested (const TopologyChangeEvent &event)
 Notify a topology change event. More...
 
void topologyChangeSuccessful (const TopologyChangeEvent &event)
 Tell that a topology change is definitive. More...
 
void setNumericalOptimizationCounter (unsigned int c)
 
virtual void topologyChangePerformed (const TopologyChangeEvent &event)
 Notify a topology change event. More...
 

Private Attributes

std::shared_ptr< NNITopologySearchtopoSearch_
 
ParameterList parameters_
 
double tolerance_
 
std::shared_ptr< OutputStreammessenger_
 
std::shared_ptr< OutputStreamprofiler_
 
unsigned int verbose_
 
unsigned int optimizeCounter_
 
unsigned int optimizeNumerical_
 
std::string optMethod_
 
unsigned int nStep_
 
bool reparametrization_
 

Detailed Description

Listener used internally by the optimizeTreeNNI method.

Definition at line 23 of file OptimizationTools.h.

Constructor & Destructor Documentation

◆ NNITopologyListener() [1/2]

bpp::NNITopologyListener::NNITopologyListener ( std::shared_ptr< NNITopologySearch ts,
const ParameterList parameters,
double  tolerance,
std::shared_ptr< OutputStream messenger,
std::shared_ptr< OutputStream profiler,
unsigned int  verbose,
const std::string &  optMethod,
unsigned int  nStep,
bool  reparametrization 
)
inline

Build a new NNITopologyListener object.

This listener listens to a NNITopologySearch object, and optimizes numerical parameters every n topological movements. Optimization is performed using the optimizeNumericalParameters method (see there documentation for more details).

Parameters
tsThe NNITopologySearch object attached to this listener.
parametersThe list of parameters to optimize. Use tl->getIndependentParameters() in order to estimate all parameters.
toleranceTolerance to use during optimization.
messengerWhere to output messages.
profilerWhere to output optimization steps.
verboseVerbose level during optimization.
optMethodOptimization method to use.
nStepThe number of optimization steps to perform.
reparametrizationTell if parameters should be transformed in order to remove constraints. This can improve optimization, but is a bit slower.

Definition at line 57 of file OptimizationTools.h.

Referenced by clone().

◆ NNITopologyListener() [2/2]

bpp::NNITopologyListener::NNITopologyListener ( const NNITopologyListener tl)
inline

Definition at line 79 of file OptimizationTools.h.

◆ ~NNITopologyListener()

virtual bpp::NNITopologyListener::~NNITopologyListener ( )
inlinevirtual

Definition at line 111 of file OptimizationTools.h.

Member Function Documentation

◆ clone()

NNITopologyListener* bpp::NNITopologyListener::clone ( ) const
inlinevirtual

Implements bpp::TopologyListener.

Definition at line 109 of file OptimizationTools.h.

References NNITopologyListener().

◆ operator=()

NNITopologyListener& bpp::NNITopologyListener::operator= ( const NNITopologyListener tl)
inline

◆ setNumericalOptimizationCounter()

void bpp::NNITopologyListener::setNumericalOptimizationCounter ( unsigned int  c)
inline

Definition at line 116 of file OptimizationTools.h.

References optimizeNumerical_.

◆ topologyChangePerformed()

virtual void bpp::TopologyListener::topologyChangePerformed ( const TopologyChangeEvent event)
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().

Parameters
eventThe topology change event.

Definition at line 67 of file TopologySearch.h.

References bpp::TopologyListener::topologyChangeSuccessful(), and bpp::TopologyListener::topologyChangeTested().

◆ topologyChangeSuccessful()

void NNITopologyListener::topologyChangeSuccessful ( const TopologyChangeEvent event)
virtual

Tell that a topology change is definitive.

This method is called after the topologyChangeTested() method.

Parameters
eventThe topology change event.

Implements bpp::TopologyListener.

Definition at line 358 of file OptimizationTools.cpp.

References bpp::LegacyOptimizationTools::optimizeNumericalParameters().

◆ topologyChangeTested()

void bpp::NNITopologyListener::topologyChangeTested ( const TopologyChangeEvent event)
inlinevirtual

Notify a topology change event.

Parameters
eventThe topology change event.

Implements bpp::TopologyListener.

Definition at line 114 of file OptimizationTools.h.

Member Data Documentation

◆ messenger_

std::shared_ptr<OutputStream> bpp::NNITopologyListener::messenger_
private

Definition at line 30 of file OptimizationTools.h.

Referenced by operator=().

◆ nStep_

unsigned int bpp::NNITopologyListener::nStep_
private

Definition at line 36 of file OptimizationTools.h.

Referenced by operator=().

◆ optimizeCounter_

unsigned int bpp::NNITopologyListener::optimizeCounter_
private

Definition at line 33 of file OptimizationTools.h.

Referenced by operator=().

◆ optimizeNumerical_

unsigned int bpp::NNITopologyListener::optimizeNumerical_
private

Definition at line 34 of file OptimizationTools.h.

Referenced by operator=(), and setNumericalOptimizationCounter().

◆ optMethod_

std::string bpp::NNITopologyListener::optMethod_
private

Definition at line 35 of file OptimizationTools.h.

Referenced by operator=().

◆ parameters_

ParameterList bpp::NNITopologyListener::parameters_
private

Definition at line 28 of file OptimizationTools.h.

Referenced by operator=().

◆ profiler_

std::shared_ptr<OutputStream> bpp::NNITopologyListener::profiler_
private

Definition at line 31 of file OptimizationTools.h.

Referenced by operator=().

◆ reparametrization_

bool bpp::NNITopologyListener::reparametrization_
private

Definition at line 37 of file OptimizationTools.h.

Referenced by operator=().

◆ tolerance_

double bpp::NNITopologyListener::tolerance_
private

Definition at line 29 of file OptimizationTools.h.

Referenced by operator=().

◆ topoSearch_

std::shared_ptr<NNITopologySearch> bpp::NNITopologyListener::topoSearch_
private

Definition at line 27 of file OptimizationTools.h.

Referenced by operator=().

◆ verbose_

unsigned int bpp::NNITopologyListener::verbose_
private

Definition at line 32 of file OptimizationTools.h.

Referenced by operator=().


The documentation for this class was generated from the following files: