Evolutionary Algorithm for Adaptive Phase Estimation  1.0.2
problem.h
1 #ifndef PROBLEM_H
2 #define PROBLEM_H
3 
4 using namespace std;
5 
9 class Problem {
10  public:
11  Problem() {};
12  virtual ~Problem() {
13  delete[] upper_bound;
14  delete[] lower_bound;
15  }
16 
17  virtual void fitness(double *soln, double *fitarray) {
19  }
20  virtual void avg_fitness(double *soln, int K, double *fitarray) {
23  }
24  virtual bool T_condition(double *fitarray, int *numvar, int N_cut, bool *mem_ptype, double *memory_forT) {
26  return 0;
27  }
28  virtual bool error_condition(double *current_fitarray, double *memory_fitarray, int data_size, double goal) {
30  return 0;
31  }
32  virtual void boundary(double *can1) {
34  }
35 
36  double *lower_bound;
37  double *upper_bound;
39  int num;
40  int num_repeat;
41  int num_fit; /*<number of fitnesses*/
42  };
43 
44 #endif // PROBLEM_H
virtual bool T_condition(double *fitarray, int *numvar, int N_cut, bool *mem_ptype, double *memory_forT)
Definition: problem.h:24
int num
Definition: problem.h:39
Problem class contains the prototype of the functions in the optimization problem that OptAlg class n...
Definition: problem.h:9
virtual bool error_condition(double *current_fitarray, double *memory_fitarray, int data_size, double goal)
Definition: problem.h:28
int num_repeat
Definition: problem.h:40
double * upper_bound
Definition: problem.h:37
virtual void fitness(double *soln, double *fitarray)
Definition: problem.h:17
double * lower_bound
Definition: problem.h:36
virtual void boundary(double *can1)
Definition: problem.h:32
virtual void avg_fitness(double *soln, int K, double *fitarray)
Definition: problem.h:20