1 : |
agomez |
1 |
#ifndef optimizer_h
|
2 : |
|
|
#define optimizer_h
|
3 : |
|
|
|
4 : |
|
|
// #include "paraminsearch.h"
|
5 : |
|
|
#include "paraminhooke.h" |
6 : |
|
|
#include "paraminsimann.h" |
7 : |
|
|
#include "paraminbfgs.h" |
8 : |
|
|
#include "optinfoptrvector.h"
|
9 : |
|
|
|
10 : |
|
|
class Optimizer {
|
11 : |
|
|
public:
|
12 : |
|
|
Optimizer(CommandLineInfo* info, NetInterface* net);
|
13 : |
|
|
/**
|
14 : |
|
|
* \brief Default destructor
|
15 : |
|
|
*/
|
16 : |
|
|
~Optimizer();
|
17 : |
|
|
/**
|
18 : |
|
|
* \brief Starts the optimisation
|
19 : |
|
|
*/
|
20 : |
|
|
void OptimizeFunc();
|
21 : |
|
|
// void printResult(NetInterface* net);
|
22 : |
|
|
// const DoubleVector& getBestX(NetInterface* net);
|
23 : |
|
|
void printResult();
|
24 : |
|
|
// void DoubleVector& getBestX();
|
25 : |
|
|
// double getBestF();
|
26 : |
|
|
void printX(const DoubleVector& vec);
|
27 : |
|
|
/**
|
28 : |
|
|
* \brief This is the file reader
|
29 : |
|
|
*/
|
30 : |
|
|
// void readOptInfo(char* optfilename, NetInterface* net);
|
31 : |
|
|
void readOptInfo(char* optfilename);
|
32 : |
|
|
void getScore(DoubleVector& x, double fx);
|
33 : |
|
|
double getBestF();
|
34 : |
|
|
private:
|
35 : |
|
|
NetInterface* netInt;
|
36 : |
|
|
/**
|
37 : |
|
|
* \brief Pointer to a Simulated Annealing object/search method
|
38 : |
|
|
*/
|
39 : |
|
|
OptInfoPtrVector optvec;
|
40 : |
|
|
// ParaminSearch* parSA;
|
41 : |
|
|
/**
|
42 : |
|
|
* \brief Pointer to a Hooke & Jeeves object/search method
|
43 : |
|
|
*/
|
44 : |
|
|
// ParaminSearch* parHJ;
|
45 : |
|
|
/**
|
46 : |
|
|
* \brief Pointer to a BFGS object/search method
|
47 : |
|
|
*/
|
48 : |
|
|
// ParaminSearch* parBFGS;
|
49 : |
|
|
/**
|
50 : |
|
|
* \brief seed for the randomgenerator
|
51 : |
|
|
*/
|
52 : |
|
|
int seed;
|
53 : |
|
|
/**
|
54 : |
|
|
*\brief The starting point of the optimisation
|
55 : |
|
|
*/
|
56 : |
|
|
// DoubleVector startx;
|
57 : |
|
|
/**
|
58 : |
|
|
* \brief The f-value at startx
|
59 : |
|
|
*/
|
60 : |
|
|
// double startf;
|
61 : |
|
|
/**
|
62 : |
|
|
* \brief Switch for Simulated Annealing, if 0 don't use else use
|
63 : |
|
|
*/
|
64 : |
|
|
// int useSA;
|
65 : |
|
|
/**
|
66 : |
|
|
* \brief Switch for Hooke & Jeeves, if 0 don't use else use
|
67 : |
|
|
*/
|
68 : |
|
|
// int useHJ;
|
69 : |
|
|
/**
|
70 : |
|
|
* \brief Switch for BFGS, if 0 don't use else use
|
71 : |
|
|
*/
|
72 : |
|
|
// int useBFGS;
|
73 : |
|
|
/**
|
74 : |
|
|
* \brief Name the outputfile
|
75 : |
|
|
*/
|
76 : |
|
|
char* outputfile;
|
77 : |
|
|
};
|
78 : |
|
|
|
79 : |
|
|
#endif
|