bpp-core3  3.0.0
SimpleMultiDimensions.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_SIMPLEMULTIDIMENSIONS_H
6 #define BPP_NUMERIC_FUNCTION_SIMPLEMULTIDIMENSIONS_H
7 
8 
9 #include "AbstractOptimizer.h"
10 #include "BrentOneDimension.h"
11 
12 namespace bpp
13 {
22  public AbstractOptimizer
23 {
24 private:
25  size_t nbParams_;
26 
27  BrentOneDimension optimizer_; // One dimensional optimizer.
28 
29 public:
30  SimpleMultiDimensions(std::shared_ptr<FunctionInterface> function);
31 
33 
34  SimpleMultiDimensions* clone() const override { return new SimpleMultiDimensions(*this); }
35 
36 public:
42  void setFunction(std::shared_ptr<FunctionInterface> function) override;
45  void doInit(const ParameterList& params) override;
46 
47  double doStep() override;
48 
57 };
58 } // end of namespace bpp.
59 #endif // BPP_NUMERIC_FUNCTION_SIMPLEMULTIDIMENSIONS_H
OptimizerInterface & oneDimensionOptimizer()
This Optimizer is a very simple multi-dimensions optimizer, calling a one dimensional optimizer on ea...
void doInit(const ParameterList &params) override
This function is called by the init() method and contains all calculations.
The parameter list object.
Definition: ParameterList.h:27
const OptimizerInterface & oneDimensionOptimizer() const
SimpleMultiDimensions * clone() const override
Create a copy of this object and send a pointer to it.
double doStep() override
This function is called by the step() method and contains all calculations.
This is the basal interface for all optimization methods.
Definition: Optimizer.h:88
Brent&#39;s optimization for one parameter.
void setFunction(std::shared_ptr< FunctionInterface > function) override
Set the function to optimize.
Partial implementation of the Optimizer interface.
SimpleMultiDimensions(std::shared_ptr< FunctionInterface > function)