-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearch.h
More file actions
118 lines (85 loc) · 2.7 KB
/
Search.h
File metadata and controls
118 lines (85 loc) · 2.7 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef SEARCH_H
#define SEARCH_H
/**
02/06/2011
- Commented out headers inherited from Utils.h
**/
// #include <cstdlib>
// #include <iostream>
#include "CVariables.h"
// #include "Structures.h"
#include "CreateRotations.h"
// #include "Utils.h"
// #include "GlobalOptimisationUtils.h"
#include "GlobalOptimisation.h"
#include "LocalMinimisationDetails.h"
class Search{
public:
Search() {output_content = NULL;}
Search(int *s, std::vector<std::string> *o)
{ init(s,o); }
~Search()
{ clearUp(); }
void init(int *s, std::vector<std::string> *o);
void clearUp();
void getVariables(SearchV seV, const Variables &v);
bool getOptimisation()
{ return bOptimisation; }
bool getGlobal()
{ return bGlobal; }
bool getGlobalConverged()
{ return optimisation.getConverged(); }
std::string getOptimisationRef()
{ return optimisation.getReference(); }
// Set value for optimisation point
// Inputs (x) - X coordinate
// (y) - Y coordinate
// (z) - Z coordinate
// (value) - Value
void setOptimisationValue(const float &x, const float &y, const float &z, const float &value)
{ RotationPoint temp; temp.theta = x; temp.phi = y; temp.psi = z; temp.value = value; current_results.push_back(temp); }
bool getComplete();
Variables getNext(const unsigned int current);
int getRotationsArraySize()
{ return rotations.size(); }
void setComplete()
{ bComplete = true; }
void setIncomplete()
{ bComplete = false; }
void setVariables(const Variables v)
{ var = v; }
// RotationPoint getCurrentMin()
// { return optimisation.getCurrentMin(); }
int getHistoryCopyCounter()
{ return historyCopyCounter; }
RotationPoint getMinimumPoint()
{return optimisation.getMinimumPoint();}
private:
bool bLinear;
bool bGlobal;
bool bOptimisation;
bool bScreen;
bool bPeriodic;
bool bOptimised;
bool bConverged;
bool bComplete;
bool bOptimising;
bool bInTheLoop; // Using this to identify if we are looping
std::vector<RotationPoint> rotations;
std::vector<RotationPoint> possible_points;
std::vector<RotationPoint> current_results;
std::vector< std::vector< std::vector<float> > > historyNew; // 3D Matrix of results
std::vector<std::string> *output_content;
GlobalOptimisation optimisation;
Variables var;
LocalMinimisationDetails miniDetails;
int historyCopyCounter;
int powellStepCounter;
void setStartingPoints(const LinearStruct linearStruct);
void setOptimisationStartingPoints();
void addCurrentToHistory();
void copyFromHistory();
void locallyMinimised(const int &i);
void printHistoryArrayError(RotationPoint rp);
};
#endif