Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressing Remaining Failed Continuous Integration Tests #1054

Merged
merged 1 commit into from
Jun 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion code-experiments/src/f_griewank_rosenbrock.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ static coco_problem_t *f_griewank_rosenbrock_bbob_problem_allocate(const size_t
double *b = coco_allocate_vector(dimension);
double *shift = coco_allocate_vector(dimension);
double scales, **rot1;
double tmp; /* Wassim: will serve to set the optimal solution "manually"*/

fopt = bbob2009_compute_fopt(function, instance);
for (i = 0; i < dimension; ++i) {
Expand All @@ -103,8 +104,18 @@ static coco_problem_t *f_griewank_rosenbrock_bbob_problem_allocate(const size_t
problem = transform_obj_shift(problem, fopt);
problem = transform_vars_shift(problem, shift, 0);
bbob2009_copy_rotation_matrix(rot1, M, b, dimension);
problem = transform_vars_affine(problem, M, b, dimension);

for (i = 0; i < dimension; i++) {
problem->best_parameter[i] = 0; /* Wassim: TODO: not a proper way of avoiding to trigger coco_warning("transform_vars_affine(): 'best_parameter' not updated, set to NAN")*/
}
problem = transform_vars_affine(problem, M, b, dimension);
for (j = 0; j < dimension; ++j) { /* Wassim: manually set xopt = rot1^T ones(dimension)/(2*factor) */
tmp = 0;
for (i = 0; i < dimension; ++i) {
tmp += rot1[i][j];
}
problem->best_parameter[j] = tmp / (2. * scales);
}
bbob2009_free_matrix(rot1, dimension);

coco_problem_set_id(problem, problem_id_template, function, instance, dimension);
Expand Down
14 changes: 13 additions & 1 deletion code-experiments/src/f_rosenbrock.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ static coco_problem_t *f_rosenbrock_rotated_bbob_problem_allocate(const size_t f
double *M = coco_allocate_vector(dimension * dimension);
double *b = coco_allocate_vector(dimension);
double *current_row, **rot1, factor;
double tmp; /* Wassim: will serve to set the optimal solution "manually"*/

fopt = bbob2009_compute_fopt(function, instance);
rot1 = bbob2009_allocate_matrix(dimension, dimension);
Expand All @@ -141,12 +142,23 @@ static coco_problem_t *f_rosenbrock_rotated_bbob_problem_allocate(const size_t f
}
b[row] = 0.5;
}
bbob2009_free_matrix(rot1, dimension);
/*bbob2009_free_matrix(rot1, dimension);*/

problem = f_rosenbrock_allocate(dimension);
for (row = 0; row < dimension; row++) {
problem->best_parameter[row] = 0; /* Wassim: TODO: not a proper way of avoiding to trigger coco_warning("transform_vars_affine(): 'best_parameter' not updated, set to NAN")*/
}
problem = transform_vars_affine(problem, M, b, dimension);
problem = transform_obj_shift(problem, fopt);
for (column = 0; column < dimension; ++column) { /* Wassim: manually set xopt = rot1^T ones(dimension)/(2*factor) */
tmp = 0;
for (row = 0; row < dimension; ++row) {
tmp += rot1[row][column];
}
problem->best_parameter[column] = tmp / (2. * factor);
}

bbob2009_free_matrix(rot1, dimension);
coco_problem_set_id(problem, problem_id_template, function, instance, dimension);
coco_problem_set_name(problem, problem_name_template, function, instance, dimension);
coco_problem_set_type(problem, "2-moderate");
Expand Down