bpp-core3  3.0.0
PowellMultiDimensions.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_NUMERIC_FUNCTION_POWELLMULTIDIMENSIONS_H
6 #define BPP_NUMERIC_FUNCTION_POWELLMULTIDIMENSIONS_H
7 
8 
9 #include "../VectorTools.h"
10 #include "AbstractOptimizer.h"
11 #include "DirectionFunction.h"
12 
13 namespace bpp
14 {
25  public AbstractOptimizer
26 {
27 public:
30  {
31 public:
34  virtual ~PMDStopCondition() {}
35 
36  PMDStopCondition* clone() const { return new PMDStopCondition(*this); }
37 
38 public:
39  bool isToleranceReached() const;
40  double getCurrentTolerance() const;
41  };
42 
43  friend class PMDStopCondition;
44 
45 protected:
46  double fp_;
47  double fret_;
50 
51  unsigned int ncom_;
53  std::shared_ptr<DirectionFunction> f1dim_;
54 
55 public:
56  PowellMultiDimensions(std::shared_ptr<FunctionInterface> function);
58 
59  PowellMultiDimensions* clone() const { return new PowellMultiDimensions(*this); }
60 
61 public:
67  double optimize();
70  void doInit(const ParameterList& params);
71 
72  double doStep();
73 };
74 } // end of namespace bpp.
75 #endif // BPP_NUMERIC_FUNCTION_POWELLMULTIDIMENSIONS_H
bool isToleranceReached() const
Tell if the we reached the desired tolerance with a given new set of estimates.
void doInit(const ParameterList &params)
This function is called by the init() method and contains all calculations.
Powell&#39;s multi-dimensions optimization algorithm for one parameter.
double optimize()
Basic implementation.
PowellMultiDimensions(std::shared_ptr< FunctionInterface > function)
The parameter list object.
Definition: ParameterList.h:27
double doStep()
This function is called by the step() method and contains all calculations.
Partial implementation of the Optimizer interface.
double getCurrentTolerance() const
Get the current tolerance.
Partial implementation of the OptimizationStopCondition interface.
PowellMultiDimensions * clone() const
Create a copy of this object and send a pointer to it.
PMDStopCondition * clone() const
Create a copy of this object and send a pointer to it.
std::vector< Vdouble > VVdouble
Definition: VectorTools.h:35
std::shared_ptr< DirectionFunction > f1dim_