-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathF1.cpp
More file actions
53 lines (42 loc) · 1 KB
/
F1.cpp
File metadata and controls
53 lines (42 loc) · 1 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
#include "F1.h"
F1::F1():Benchmarks(){
Ovector = NULL;
minX = -100;
maxX = 100;
ID = 1;
anotherz = new double[dimension];
}
F1::~F1(){
delete[] Ovector;
delete[] anotherz;
// (Ovector);
}
double F1::compute(double* x) {
double result;
int i;
if(Ovector == NULL) {
// Ovector = createShiftVector(dimension,minX,maxX);
Ovector = readOvector();
}
for(i = dimension - 1; i >= 0; i--) {
anotherz[i] = x[i] - Ovector[i];
}
// T_{OSZ}
// transform_osz(anotherz,dimension);
// result = elliptic(anotherz,dimension);
result = elliptic(anotherz,dimension);
update(result);
return(result);
}
// double F1::compute(vector<double> x){
// double result;
// int i;
// if(Ovector == NULL) {
// Ovector = createShiftVector(dimension,minX,maxX);
// }
// for(i = dimension - 1; i >= 0; i--) {
// anotherz[i] = x[i] - Ovector[i];
// }
// result = elliptic(anotherz,dimension);
// return(result);
// }