bpp-core3  3.0.0
bpp::MetaOptimizerInfos Class Reference

Provide a list of optimizer and corresponding options to be used with the MetaOptimizer class. More...

#include <Bpp/Numeric/Function/MetaOptimizer.h>

+ Inheritance diagram for bpp::MetaOptimizerInfos:
+ Collaboration diagram for bpp::MetaOptimizerInfos:

Public Member Functions

 MetaOptimizerInfos ()
 
 MetaOptimizerInfos (const MetaOptimizerInfos &infos)
 
MetaOptimizerInfosoperator= (const MetaOptimizerInfos &infos)
 
virtual ~MetaOptimizerInfos ()
 
MetaOptimizerInfosclone () const override
 Create a copy of this object and send a pointer to it. More...
 
virtual void addOptimizer (const std::string &name, std::shared_ptr< OptimizerInterface > optimizer, const std::vector< std::string > &params, unsigned short derivatives=0, const std::string &type=IT_TYPE_STEP)
 Add a new optimizer to the set. More...
 
virtual const std::string & getName (size_t i) const
 
virtual OptimizerInterfaceoptimizer (size_t i)
 
virtual const OptimizerInterfaceoptimizer (size_t i) const
 
virtual std::shared_ptr< OptimizerInterfacegetOptimizer (size_t i)
 
virtual std::shared_ptr< const OptimizerInterfacegetOptimizer (size_t i) const
 
virtual std::vector< std::string > & getParameterNames (size_t i)
 
virtual const std::vector< std::string > & getParameterNames (size_t i) const
 
virtual std::string & getIterationType (size_t i)
 
virtual const std::string & getIterationType (size_t i) const
 
virtual bool requiresFirstOrderDerivatives (size_t i) const
 
virtual bool requiresSecondOrderDerivatives (size_t i) const
 
virtual size_t getNumberOfOptimizers () const
 

Static Public Attributes

static std::string IT_TYPE_STEP = "step"
 
static std::string IT_TYPE_FULL = "full"
 

Private Attributes

std::vector< std::string > names_
 
std::vector< std::shared_ptr< OptimizerInterface > > optimizers_
 
std::vector< std::vector< std::string > > parameterNames_
 
std::vector< unsigned short > derivatives_
 
std::vector< std::string > itTypes_
 

Detailed Description

Provide a list of optimizer and corresponding options to be used with the MetaOptimizer class.

Definition at line 19 of file MetaOptimizer.h.

Constructor & Destructor Documentation

◆ MetaOptimizerInfos() [1/2]

bpp::MetaOptimizerInfos::MetaOptimizerInfos ( )
inline

Definition at line 34 of file MetaOptimizer.h.

Referenced by clone().

◆ MetaOptimizerInfos() [2/2]

bpp::MetaOptimizerInfos::MetaOptimizerInfos ( const MetaOptimizerInfos infos)
inline

Definition at line 35 of file MetaOptimizer.h.

References optimizers_.

◆ ~MetaOptimizerInfos()

virtual bpp::MetaOptimizerInfos::~MetaOptimizerInfos ( )
inlinevirtual

Definition at line 62 of file MetaOptimizer.h.

Member Function Documentation

◆ addOptimizer()

virtual void bpp::MetaOptimizerInfos::addOptimizer ( const std::string &  name,
std::shared_ptr< OptimizerInterface optimizer,
const std::vector< std::string > &  params,
unsigned short  derivatives = 0,
const std::string &  type = IT_TYPE_STEP 
)
inlinevirtual

Add a new optimizer to the set.

Parameters
namethe name of the optimizer. It is used for display only.
optimizerA pointer toward the optimizer to add. The set will own the underlying object, which will be destroyed together with the set.
paramsA list of parameter names to optimize with this optimizer.
derivatives0, 1 or 2: does this parameter use no, first order or second order derivatives?
typeFor each optimization step, shall we perform a full optimization with this optimizer or only one step?

Definition at line 77 of file MetaOptimizer.h.

◆ clone()

MetaOptimizerInfos* bpp::MetaOptimizerInfos::clone ( ) const
inlineoverridevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implements bpp::Clonable.

Definition at line 65 of file MetaOptimizer.h.

References MetaOptimizerInfos().

◆ getIterationType() [1/2]

virtual std::string& bpp::MetaOptimizerInfos::getIterationType ( size_t  i)
inlinevirtual
Returns
The type of iteration to perform for the ith optimizer in the set.

Definition at line 123 of file MetaOptimizer.h.

◆ getIterationType() [2/2]

virtual const std::string& bpp::MetaOptimizerInfos::getIterationType ( size_t  i) const
inlinevirtual
Returns
The type of iteration to perform for the ith optimizer in the set.

Definition at line 127 of file MetaOptimizer.h.

◆ getName()

virtual const std::string& bpp::MetaOptimizerInfos::getName ( size_t  i) const
inlinevirtual
Returns
The display name of the ith optimizer in the set.

Definition at line 89 of file MetaOptimizer.h.

◆ getNumberOfOptimizers()

virtual size_t bpp::MetaOptimizerInfos::getNumberOfOptimizers ( ) const
inlinevirtual
Returns
The number of optimizers in the set.

Definition at line 141 of file MetaOptimizer.h.

◆ getOptimizer() [1/2]

virtual std::shared_ptr<OptimizerInterface> bpp::MetaOptimizerInfos::getOptimizer ( size_t  i)
inlinevirtual
Returns
A shared pointer toward the ith optimizer in the set.

Definition at line 104 of file MetaOptimizer.h.

◆ getOptimizer() [2/2]

virtual std::shared_ptr<const OptimizerInterface> bpp::MetaOptimizerInfos::getOptimizer ( size_t  i) const
inlinevirtual
Returns
A shared pointer toward the ith optimizer in the set.

Definition at line 109 of file MetaOptimizer.h.

◆ getParameterNames() [1/2]

virtual std::vector<std::string>& bpp::MetaOptimizerInfos::getParameterNames ( size_t  i)
inlinevirtual
Returns
The parameter names associated to the ith optimizer in the set.

Definition at line 114 of file MetaOptimizer.h.

◆ getParameterNames() [2/2]

virtual const std::vector<std::string>& bpp::MetaOptimizerInfos::getParameterNames ( size_t  i) const
inlinevirtual
Returns
The parameter names associated to the ith optimizer in the set.

Definition at line 118 of file MetaOptimizer.h.

◆ operator=()

MetaOptimizerInfos& bpp::MetaOptimizerInfos::operator= ( const MetaOptimizerInfos infos)
inline

Definition at line 48 of file MetaOptimizer.h.

References derivatives_, itTypes_, names_, optimizers_, and parameterNames_.

◆ optimizer() [1/2]

virtual OptimizerInterface& bpp::MetaOptimizerInfos::optimizer ( size_t  i)
inlinevirtual
Returns
The ith optimizer in the set.

Definition at line 94 of file MetaOptimizer.h.

◆ optimizer() [2/2]

virtual const OptimizerInterface& bpp::MetaOptimizerInfos::optimizer ( size_t  i) const
inlinevirtual
Returns
The ith optimizer in the set.

Definition at line 99 of file MetaOptimizer.h.

◆ requiresFirstOrderDerivatives()

virtual bool bpp::MetaOptimizerInfos::requiresFirstOrderDerivatives ( size_t  i) const
inlinevirtual
Returns
True if the ith optimizer in the set requires first order derivatives.

Definition at line 132 of file MetaOptimizer.h.

◆ requiresSecondOrderDerivatives()

virtual bool bpp::MetaOptimizerInfos::requiresSecondOrderDerivatives ( size_t  i) const
inlinevirtual
Returns
True if the ith optimizer in the set requires second order derivatives.

Definition at line 136 of file MetaOptimizer.h.

Member Data Documentation

◆ derivatives_

std::vector<unsigned short> bpp::MetaOptimizerInfos::derivatives_
private

Definition at line 30 of file MetaOptimizer.h.

Referenced by operator=().

◆ IT_TYPE_FULL

string MetaOptimizerInfos::IT_TYPE_FULL = "full"
static

Definition at line 24 of file MetaOptimizer.h.

Referenced by bpp::MetaOptimizer::doStep().

◆ IT_TYPE_STEP

string MetaOptimizerInfos::IT_TYPE_STEP = "step"
static

Definition at line 23 of file MetaOptimizer.h.

Referenced by bpp::MetaOptimizer::doStep().

◆ itTypes_

std::vector<std::string> bpp::MetaOptimizerInfos::itTypes_
private

Definition at line 31 of file MetaOptimizer.h.

Referenced by operator=().

◆ names_

std::vector<std::string> bpp::MetaOptimizerInfos::names_
private

Definition at line 27 of file MetaOptimizer.h.

Referenced by operator=().

◆ optimizers_

std::vector< std::shared_ptr<OptimizerInterface> > bpp::MetaOptimizerInfos::optimizers_
private

Definition at line 28 of file MetaOptimizer.h.

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

◆ parameterNames_

std::vector< std::vector<std::string> > bpp::MetaOptimizerInfos::parameterNames_
private

Definition at line 29 of file MetaOptimizer.h.

Referenced by operator=().


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