-
Notifications
You must be signed in to change notification settings - Fork 0
/
ThermalMinimizer.h
executable file
·61 lines (45 loc) · 1.33 KB
/
ThermalMinimizer.h
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef THERMAL_MINIMIZER_H
#define THERMAL_MINIMIZER_H
#include "ThermalFunctions.h"
class ThermalMinimizer
{
private:
int funcCount {0};
double *funcVal {nullptr};
double *funcVal_err {nullptr};
double T_init {0.16};
double mub_init {0.01};
double muq_init {-0.001};
double mus_init {0.001};
double T_final {0};
double mub_final {0};
double muq_final {0};
double mus_final {0};
double T_err {0};
double mub_err {0};
double muq_err {0};
double mus_err {0};
double T_err_low {0};
double mub_err_low {0};
double muq_err_low {0};
double mus_err_low {0};
double T_err_up {0};
double mub_err_up {0};
double muq_err_up {0};
double mus_err_up {0};
ThermalFunction **tFunc {nullptr};
bool isMinimized {false};
public:
ThermalMinimizer(int fc);
~ThermalMinimizer();
void setInitialParameters(double T, double mub, double muq, double mus);
void SetFunctionValueEach(int id, double val, double val_err = 1);
void SetThermalFunctionEach(int id, ThermalFunction *f);
double minFunction(const double *x);
void minimize(int maxFC = 1000, double tol = 0.01, bool showLog = true);
double *getMinimizedParameters();
double* getMinimizedParameterErrors();
};
double ThermalMinFunction_wrapped(const double *var);
extern ThermalMinimizer *minFuncObjGlobal;
#endif