-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctionRtoR.hpp
More file actions
38 lines (31 loc) · 1.03 KB
/
FunctionRtoR.hpp
File metadata and controls
38 lines (31 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef FUNCTIONRTOR_HPP
#define FUNCTIONRTOR_HPP
#include "Traits.hpp"
#include "FactoryTraits.hpp"
#include <string>
#include <iostream>
class FunctionRtoR final: FunctionTraits{
public:
FunctionRtoR(FunctionType _fun): fun(_fun){};
// Solver settings:
void setSovler(std::string s);
void setOptions(const point _a,
const point _b,
const double _tol_rel,
const double _tol_abs,
const unsigned int _maxIter);
//
void solve(){sol = solver->solve();}
void print() const;
/* The solver is public therefore it is possibile to use
* the methods of the solver. This allows, for example, to
* load plugins of numerical method which need more
* parameters (as Broyden that needs to set the initial guess
* and the approximation of initial derivative) or simply
* plugins with more functions. */
Solver::SolverType solver = nullptr;
private:
FunctionType fun;
Solver::NumericalSolutionType sol;
};
#endif //FUNCTIONRTOR_HPP