bpp-phyl3  3.0.0
bpp::NNITopologyListener2 Class Reference

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

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

+ Inheritance diagram for bpp::NNITopologyListener2:
+ Collaboration diagram for bpp::NNITopologyListener2:

Public Member Functions

 NNITopologyListener2 (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, bool reparametrization)
 Build a new NNITopologyListener2 object. More...
 
 NNITopologyListener2 (const NNITopologyListener2 &tl)
 
NNITopologyListener2operator= (const NNITopologyListener2 &tl)
 
NNITopologyListener2clone () const
 
virtual ~NNITopologyListener2 ()
 
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_
 
bool reparametrization_
 

Detailed Description

Listener used internally by the optimizeTreeNNI2 method.

Definition at line 122 of file OptimizationTools.h.

Constructor & Destructor Documentation

◆ NNITopologyListener2() [1/2]

bpp::NNITopologyListener2::NNITopologyListener2 ( 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,
bool  reparametrization 
)
inline

Build a new NNITopologyListener2 object.

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

Parameters
tsThe NNITopologySearch object attached to this listener.
parametersThe list of parameters to optimize. Use ts->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.
reparametrizationTell if parameters should be transformed in order to remove constraints. This can improve optimization, but is a bit slower.

Definition at line 154 of file OptimizationTools.h.

Referenced by clone().

◆ NNITopologyListener2() [2/2]

bpp::NNITopologyListener2::NNITopologyListener2 ( const NNITopologyListener2 tl)
inline

Definition at line 174 of file OptimizationTools.h.

◆ ~NNITopologyListener2()

virtual bpp::NNITopologyListener2::~NNITopologyListener2 ( )
inlinevirtual

Definition at line 204 of file OptimizationTools.h.

Member Function Documentation

◆ clone()

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

Implements bpp::TopologyListener.

Definition at line 202 of file OptimizationTools.h.

References NNITopologyListener2().

◆ operator=()

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

◆ setNumericalOptimizationCounter()

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

Definition at line 209 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 NNITopologyListener2::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 372 of file OptimizationTools.cpp.

References bpp::LegacyOptimizationTools::optimizeNumericalParameters2().

◆ topologyChangeTested()

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

Notify a topology change event.

Parameters
eventThe topology change event.

Implements bpp::TopologyListener.

Definition at line 207 of file OptimizationTools.h.

Member Data Documentation

◆ messenger_

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

Definition at line 129 of file OptimizationTools.h.

Referenced by operator=().

◆ optimizeCounter_

unsigned int bpp::NNITopologyListener2::optimizeCounter_
private

Definition at line 132 of file OptimizationTools.h.

Referenced by operator=().

◆ optimizeNumerical_

unsigned int bpp::NNITopologyListener2::optimizeNumerical_
private

Definition at line 133 of file OptimizationTools.h.

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

◆ optMethod_

std::string bpp::NNITopologyListener2::optMethod_
private

Definition at line 134 of file OptimizationTools.h.

Referenced by operator=().

◆ parameters_

ParameterList bpp::NNITopologyListener2::parameters_
private

Definition at line 127 of file OptimizationTools.h.

Referenced by operator=().

◆ profiler_

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

Definition at line 130 of file OptimizationTools.h.

Referenced by operator=().

◆ reparametrization_

bool bpp::NNITopologyListener2::reparametrization_
private

Definition at line 135 of file OptimizationTools.h.

Referenced by operator=().

◆ tolerance_

double bpp::NNITopologyListener2::tolerance_
private

Definition at line 128 of file OptimizationTools.h.

Referenced by operator=().

◆ topoSearch_

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

Definition at line 126 of file OptimizationTools.h.

Referenced by operator=().

◆ verbose_

unsigned int bpp::NNITopologyListener2::verbose_
private

Definition at line 131 of file OptimizationTools.h.

Referenced by operator=().


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