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