00001
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004 #include <math.h>
00005
00006 #include "benchmarksdeclare.h"
00007 #include "benchmarkshelper.h"
00008 #include "bbobStructures.h"
00009
00010 #define NHIGHPEAKS21 101
00011
00012 static double * tmx;
00013 static double * tmpvect;
00014 static double ** rotation;
00015 static double ** rot2;
00016 static double ** linearTF;
00017 static double * peaks21;
00018 static int * rperm;
00019 static int * rperm21;
00020 static double ** Xlocal;
00021 static double ** Xlocal21;
00022 static double ** arrScales;
00023 static double ** arrScales21;
00024
00025
00026
00027
00028
00029 TwoDoubles f101(double* x) {
00030
00031 int i, rseed;
00032 static unsigned int funcId = 101;
00033 static unsigned int rrseed = 1;
00034 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00035 TwoDoubles res;
00036
00037 if (!isInitDone)
00038 {
00039 rseed = rrseed + 10000 * trialid;
00040 Fopt = computeFopt(funcId, trialid);
00041 computeXopt(rseed, DIM);
00042 isInitDone = 1;
00043 }
00044 Fadd = Fopt;
00045
00046
00047 for (i = 0; i < DIM; i++)
00048 {
00049 tmp = fabs(x[i]) - 5.;
00050 if (tmp > 0.)
00051 {
00052 Fpen += tmp * tmp;
00053 }
00054 }
00055 Fadd += 100. * Fpen;
00056
00057
00058 for (i = 0; i < DIM; i++)
00059 {
00060 tmp = (x[i] - Xopt[i]);
00061 Ftrue += tmp * tmp;
00062 }
00063
00064 Fval = FGauss(Ftrue, 0.01);
00065 Ftrue += Fadd;
00066 Fval += Fadd;
00067
00068 res.Fval = Fval;
00069 res.Ftrue = Ftrue;
00070 return res;
00071 }
00072
00073 TwoDoubles f102(double* x) {
00074
00075 int i, rseed;
00076 static unsigned int funcId = 102;
00077 static unsigned int rrseed = 1;
00078 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00079 TwoDoubles res;
00080
00081 if (!isInitDone)
00082 {
00083 rseed = rrseed + 10000 * trialid;
00084 Fopt = computeFopt(funcId, trialid);
00085 computeXopt(rseed, DIM);
00086 isInitDone = 1;
00087 }
00088 Fadd = Fopt;
00089
00090
00091 for (i = 0; i < DIM; i++)
00092 {
00093 tmp = fabs(x[i]) - 5.;
00094 if (tmp > 0.)
00095 {
00096 Fpen += tmp * tmp;
00097 }
00098 }
00099 Fadd += 100. * Fpen;
00100
00101
00102 for (i = 0; i < DIM; i++)
00103 {
00104 tmp = (x[i] - Xopt[i]);
00105 Ftrue += tmp * tmp;
00106 }
00107 Fval = FUniform(Ftrue, 0.01 * (0.49 + 1./DIM), 0.01);
00108 Ftrue += Fadd;
00109 Fval += Fadd;
00110
00111 res.Fval = Fval;
00112 res.Ftrue = Ftrue;
00113 return res;
00114 }
00115
00116 TwoDoubles f103(double* x) {
00117
00118 int i, rseed;
00119 static unsigned int funcId = 103;
00120 static unsigned int rrseed = 1;
00121 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00122 TwoDoubles res;
00123
00124 if (!isInitDone)
00125 {
00126 rseed = rrseed + 10000 * trialid;
00127 Fopt = computeFopt(funcId, trialid);
00128 computeXopt(rseed, DIM);
00129 isInitDone = 1;
00130 }
00131 Fadd = Fopt;
00132
00133
00134 for (i = 0; i < DIM; i++)
00135 {
00136 tmp = fabs(x[i]) - 5.;
00137 if (tmp > 0.)
00138 {
00139 Fpen += tmp * tmp;
00140 }
00141 }
00142 Fadd += 100. * Fpen;
00143
00144
00145 for (i = 0; i < DIM; i++)
00146 {
00147 tmp = (x[i] - Xopt[i]);
00148 Ftrue += tmp * tmp;
00149 }
00150 Fval = FCauchy(Ftrue, 0.01, 0.05);
00151 Ftrue += Fadd;
00152 Fval += Fadd;
00153
00154 res.Fval = Fval;
00155 res.Ftrue = Ftrue;
00156 return res;
00157 }
00158
00159 TwoDoubles f104(double* x) {
00160
00161 int i, rseed;
00162 static int funcId = 104;
00163 static int rrseed = 8;
00164 static double scales;
00165 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00166 TwoDoubles res;
00167
00168 if (!isInitDone)
00169 {
00170 rseed = rrseed + 10000 * trialid;
00171
00172 Fopt = computeFopt(funcId, trialid);
00173 computeXopt(rseed, DIM);
00174 scales = fmax(1., sqrt((double)DIM) / 8.);
00175 isInitDone = 1;
00176 }
00177 Fadd = Fopt;
00178
00179
00180 for (i = 0; i < DIM; i++)
00181 {
00182 tmp = fabs(x[i]) - 5.;
00183 if (tmp > 0.)
00184 {
00185 Fpen += tmp * tmp;
00186 }
00187 }
00188 Fadd += 100. * Fpen;
00189
00190
00191 for (i = 0; i < DIM; i++) {
00192 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00193 }
00194
00195
00196 Ftrue = 0.;
00197 for (i = 0; i < DIM - 1; i++)
00198 {
00199 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00200 Ftrue += tmp * tmp;
00201 }
00202 Ftrue *= 1e2;
00203 for (i = 0; i < DIM - 1; i ++)
00204 {
00205 tmp = (tmx[i] - 1);
00206 Ftrue += tmp * tmp;
00207 }
00208
00209 Fval = FGauss(Ftrue, 0.01);
00210 Ftrue += Fadd;
00211 Fval += Fadd;
00212
00213 res.Fval = Fval;
00214 res.Ftrue = Ftrue;
00215 return res;
00216 }
00217
00218 TwoDoubles f105(double* x) {
00219
00220 int i, rseed;
00221 static int funcId = 105;
00222 static int rrseed = 8;
00223 static double scales;
00224 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00225 TwoDoubles res;
00226
00227 if (!isInitDone)
00228 {
00229 rseed = rrseed + 10000 * trialid;
00230
00231 Fopt = computeFopt(funcId, trialid);
00232 computeXopt(rseed, DIM);
00233 scales = fmax(1., sqrt((double)DIM) / 8.);
00234 isInitDone = 1;
00235 }
00236 Fadd = Fopt;
00237
00238
00239 for (i = 0; i < DIM; i++)
00240 {
00241 tmp = fabs(x[i]) - 5.;
00242 if (tmp > 0.)
00243 {
00244 Fpen += tmp * tmp;
00245 }
00246 }
00247 Fadd += 100. * Fpen;
00248
00249
00250 for (i = 0; i < DIM; i++) {
00251 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00252 }
00253
00254
00255 for (i = 0; i < DIM - 1; i++)
00256 {
00257 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00258 Ftrue += tmp * tmp;
00259 }
00260 Ftrue *= 1e2;
00261 for (i = 0; i < DIM - 1; i ++)
00262 {
00263 tmp = (tmx[i] - 1);
00264 Ftrue += tmp * tmp;
00265 }
00266
00267 Fval = FUniform(Ftrue, 0.01 * (0.49 + 1./DIM), 0.01);
00268 Ftrue += Fadd;
00269 Fval += Fadd;
00270
00271 res.Fval = Fval;
00272 res.Ftrue = Ftrue;
00273 return res;
00274 }
00275
00276 TwoDoubles f106(double* x) {
00277
00278 int i, rseed;
00279 static int funcId = 106;
00280 static int rrseed = 8;
00281 static double scales;
00282 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00283 TwoDoubles res;
00284
00285 if (!isInitDone)
00286 {
00287 rseed = rrseed + 10000 * trialid;
00288
00289 Fopt = computeFopt(funcId, trialid);
00290 computeXopt(rseed, DIM);
00291 scales = fmax(1., sqrt((double)DIM) / 8.);
00292 isInitDone = 1;
00293 }
00294 Fadd = Fopt;
00295
00296
00297 for (i = 0; i < DIM; i++)
00298 {
00299 tmp = fabs(x[i]) - 5.;
00300 if (tmp > 0.)
00301 {
00302 Fpen += tmp * tmp;
00303 }
00304 }
00305 Fadd += 100. * Fpen;
00306
00307
00308 for (i = 0; i < DIM; i++) {
00309 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00310 }
00311
00312
00313 for (i = 0; i < DIM - 1; i++)
00314 {
00315 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00316 Ftrue += tmp * tmp;
00317 }
00318 Ftrue *= 1e2;
00319 for (i = 0; i < DIM - 1; i ++)
00320 {
00321 tmp = (tmx[i] - 1);
00322 Ftrue += tmp * tmp;
00323 }
00324
00325 Fval = FCauchy(Ftrue, 0.01, 0.05);
00326 Ftrue += Fadd;
00327 Fval += Fadd;
00328
00329 res.Fval = Fval;
00330 res.Ftrue = Ftrue;
00331 return res;
00332 }
00333
00334 TwoDoubles f107(double* x) {
00335
00336 int i, rseed;
00337 static int funcId = 107;
00338 static int rrseed = 1;
00339 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00340 TwoDoubles res;
00341
00342 if (!isInitDone)
00343 {
00344 rseed = rrseed + 10000 * trialid;
00345 Fopt = computeFopt(funcId, trialid);
00346 computeXopt(rseed, DIM);
00347 isInitDone = 1;
00348 }
00349 Fadd = Fopt;
00350
00351
00352 for (i = 0; i < DIM; i++)
00353 {
00354 tmp = fabs(x[i]) - 5.;
00355 if (tmp > 0.)
00356 {
00357 Fpen += tmp * tmp;
00358 }
00359 }
00360 Fadd += 100. * Fpen;
00361
00362
00363 for (i = 0; i < DIM; i++)
00364 {
00365 tmp = (x[i] - Xopt[i]);
00366 Ftrue += tmp * tmp;
00367 }
00368 Fval = FGauss(Ftrue, 1.);
00369 Ftrue += Fadd;
00370 Fval += Fadd;
00371
00372 res.Fval = Fval;
00373 res.Ftrue = Ftrue;
00374 return res;
00375 }
00376
00377 TwoDoubles f108(double* x) {
00378
00379 int i, rseed;
00380 static int funcId = 108;
00381 static int rrseed = 1;
00382 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00383 TwoDoubles res;
00384
00385 if (!isInitDone)
00386 {
00387 rseed = rrseed + 10000 * trialid;
00388 Fopt = computeFopt(funcId, trialid);
00389 computeXopt(rseed, DIM);
00390 isInitDone = 1;
00391 }
00392 Fadd = Fopt;
00393
00394
00395 for (i = 0; i < DIM; i++)
00396 {
00397 tmp = fabs(x[i]) - 5.;
00398 if (tmp > 0.)
00399 {
00400 Fpen += tmp * tmp;
00401 }
00402 }
00403 Fadd += 100. * Fpen;
00404
00405
00406 for (i = 0; i < DIM; i++)
00407 {
00408 tmp = (x[i] - Xopt[i]);
00409 Ftrue += tmp * tmp;
00410 }
00411 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
00412 Ftrue += Fadd;
00413 Fval += Fadd;
00414
00415 res.Fval = Fval;
00416 res.Ftrue = Ftrue;
00417 return res;
00418 }
00419
00420 TwoDoubles f109(double* x) {
00421
00422 int i, rseed;
00423 static int funcId = 109;
00424 static int rrseed = 1;
00425 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00426 TwoDoubles res;
00427
00428 if (!isInitDone)
00429 {
00430 rseed = rrseed + 10000 * trialid;
00431 Fopt = computeFopt(funcId, trialid);
00432 computeXopt(rseed, DIM);
00433 isInitDone = 1;
00434 }
00435 Fadd = Fopt;
00436
00437
00438 for (i = 0; i < DIM; i++)
00439 {
00440 tmp = fabs(x[i]) - 5.;
00441 if (tmp > 0.)
00442 {
00443 Fpen += tmp * tmp;
00444 }
00445 }
00446 Fadd += 100. * Fpen;
00447
00448
00449 for (i = 0; i < DIM; i++)
00450 {
00451 tmp = (x[i] - Xopt[i]);
00452 Ftrue += tmp * tmp;
00453 }
00454 Fval = FCauchy(Ftrue, 1., 0.2);
00455 Ftrue += Fadd;
00456 Fval += Fadd;
00457
00458 res.Fval = Fval;
00459 res.Ftrue = Ftrue;
00460 return res;
00461 }
00462
00463 TwoDoubles f110(double* x) {
00464
00465 int i, rseed;
00466 static int funcId = 110;
00467 static int rrseed = 8;
00468 static double scales;
00469 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00470 TwoDoubles res;
00471
00472 if (!isInitDone)
00473 {
00474 rseed = rrseed + 10000 * trialid;
00475
00476 Fopt = computeFopt(funcId, trialid);
00477 computeXopt(rseed, DIM);
00478 scales = fmax(1., sqrt((double)DIM) / 8.);
00479 isInitDone = 1;
00480 }
00481 Fadd = Fopt;
00482
00483
00484 for (i = 0; i < DIM; i++)
00485 {
00486 tmp = fabs(x[i]) - 5.;
00487 if (tmp > 0.)
00488 {
00489 Fpen += tmp * tmp;
00490 }
00491 }
00492 Fadd += 100. * Fpen;
00493
00494
00495 for (i = 0; i < DIM; i++) {
00496 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00497 }
00498
00499
00500 for (i = 0; i < DIM - 1; i++)
00501 {
00502 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00503 Ftrue += tmp * tmp;
00504 }
00505 Ftrue *= 1e2;
00506 for (i = 0; i < DIM - 1; i ++)
00507 {
00508 tmp = (tmx[i] - 1);
00509 Ftrue += tmp * tmp;
00510 }
00511 Fval = FGauss(Ftrue, 1.);
00512 Ftrue += Fadd;
00513 Fval += Fadd;
00514
00515 res.Fval = Fval;
00516 res.Ftrue = Ftrue;
00517 return res;
00518 }
00519
00520 TwoDoubles f111(double* x) {
00521
00522 int i, rseed;
00523 static int funcId = 111;
00524 static int rrseed = 8;
00525 static double scales;
00526 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00527 TwoDoubles res;
00528
00529 if (!isInitDone)
00530 {
00531 rseed = rrseed + 10000 * trialid;
00532
00533 Fopt = computeFopt(funcId, trialid);
00534 computeXopt(rseed, DIM);
00535 scales = fmax(1., sqrt((double)DIM) / 8.);
00536 isInitDone = 1;
00537 }
00538 Fadd = Fopt;
00539
00540
00541 for (i = 0; i < DIM; i++)
00542 {
00543 tmp = fabs(x[i]) - 5.;
00544 if (tmp > 0.)
00545 {
00546 Fpen += tmp * tmp;
00547 }
00548 }
00549 Fadd += 100. * Fpen;
00550
00551
00552 for (i = 0; i < DIM; i++) {
00553 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00554 }
00555
00556
00557 for (i = 0; i < DIM - 1; i++)
00558 {
00559 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00560 Ftrue += tmp * tmp;
00561 }
00562 Ftrue *= 1e2;
00563 for (i = 0; i < DIM - 1; i ++)
00564 {
00565 tmp = (tmx[i] - 1);
00566 Ftrue += tmp * tmp;
00567 }
00568 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
00569 Ftrue += Fadd;
00570 Fval += Fadd;
00571
00572 res.Fval = Fval;
00573 res.Ftrue = Ftrue;
00574 return res;
00575 }
00576
00577 TwoDoubles f112(double* x) {
00578
00579 int i, rseed;
00580 static int funcId = 112;
00581 static int rrseed = 8;
00582 static double scales;
00583 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00584 TwoDoubles res;
00585
00586 if (!isInitDone)
00587 {
00588 rseed = rrseed + 10000 * trialid;
00589
00590 Fopt = computeFopt(funcId, trialid);
00591 computeXopt(rseed, DIM);
00592 scales = fmax(1., sqrt((double)DIM) / 8.);
00593 isInitDone = 1;
00594 }
00595 Fadd = Fopt;
00596
00597
00598 for (i = 0; i < DIM; i++)
00599 {
00600 tmp = fabs(x[i]) - 5.;
00601 if (tmp > 0.)
00602 {
00603 Fpen += tmp * tmp;
00604 }
00605 }
00606 Fadd += 100. * Fpen;
00607
00608
00609 for (i = 0; i < DIM; i++) {
00610 tmx[i] = scales * (x[i] - 0.75 * Xopt[i]) + 1;
00611 }
00612
00613
00614 for (i = 0; i < DIM - 1; i++)
00615 {
00616 tmp = (tmx[i] * tmx[i] - tmx[i+1]);
00617 Ftrue += tmp * tmp;
00618 }
00619 Ftrue *= 1e2;
00620 for (i = 0; i < DIM - 1; i ++)
00621 {
00622 tmp = (tmx[i] - 1);
00623 Ftrue += tmp * tmp;
00624 }
00625 Fval = FCauchy(Ftrue, 1., 0.2);
00626 Ftrue += Fadd;
00627 Fval += Fadd;
00628
00629 res.Fval = Fval;
00630 res.Ftrue = Ftrue;
00631 return res;
00632 }
00633
00634 TwoDoubles f113(double* x) {
00635
00636 int i, j, rseed;
00637 static int funcId = 113;
00638 static int rrseed = 7;
00639 static double condition = 100.;
00640 static double alpha = 10.;
00641 double x1, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00642 TwoDoubles res;
00643
00644 if (!isInitDone)
00645 {
00646 rseed = rrseed + 10000 * trialid;
00647
00648 Fopt = computeFopt(funcId, trialid);
00649 computeXopt(rseed, DIM);
00650 computeRotation(rotation, rseed + 1000000, DIM);
00651 computeRotation(rot2, rseed, DIM);
00652 isInitDone = 1;
00653 }
00654 Fadd = Fopt;
00655
00656
00657 for (i = 0; i < DIM; i++)
00658 {
00659 tmp = fabs(x[i]) - 5.;
00660 if (tmp > 0.)
00661 {
00662 Fpen += tmp * tmp;
00663 }
00664 }
00665 Fadd += 100. * Fpen;
00666
00667
00668 for (i = 0; i < DIM; i++) {
00669 tmpvect[i] = 0.;
00670 tmp = sqrt(pow(condition/10., ((double)i)/((double)(DIM-1))));
00671 for (j = 0; j < DIM; j++) {
00672 tmpvect[i] += tmp * rot2[i][j] * (x[j] - Xopt[j]);
00673 }
00674 }
00675 x1 = tmpvect[0];
00676 for (i = 0; i < DIM; i++) {
00677 if (fabs(tmpvect[i]) > 0.5)
00678 {
00679 tmpvect[i] = round(tmpvect[i]);
00680 }
00681 else
00682 {
00683 tmpvect[i] = round(alpha * tmpvect[i])/alpha;
00684 }
00685 }
00686
00687 for (i = 0; i < DIM; i++) {
00688 tmx[i] = 0.;
00689 for (j = 0; j < DIM; j++) {
00690 tmx[i] += rotation[i][j] * tmpvect[j];
00691 }
00692 }
00693
00694
00695 for (i = 0; i < DIM; i++)
00696 {
00697 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
00698 }
00699 Ftrue = 0.1 * fmax(1e-4 * fabs(x1), Ftrue);
00700 Fval = FGauss(Ftrue, 1.);
00701
00702 Ftrue += Fadd;
00703 Fval += Fadd;
00704
00705 res.Fval = Fval;
00706 res.Ftrue = Ftrue;
00707 return res;
00708 }
00709
00710 TwoDoubles f114(double* x) {
00711
00712 int i, j, rseed;
00713 static int funcId = 114;
00714 static int rrseed = 7;
00715 static double condition = 100.;
00716 static double alpha = 10.;
00717 double x1, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00718 TwoDoubles res;
00719
00720 if (!isInitDone)
00721 {
00722 rseed = rrseed + 10000 * trialid;
00723
00724 Fopt = computeFopt(funcId, trialid);
00725 computeXopt(rseed, DIM);
00726 computeRotation(rotation, rseed + 1000000, DIM);
00727 computeRotation(rot2, rseed, DIM);
00728 isInitDone = 1;
00729 }
00730 Fadd = Fopt;
00731
00732
00733 for (i = 0; i < DIM; i++)
00734 {
00735 tmp = fabs(x[i]) - 5.;
00736 if (tmp > 0.)
00737 {
00738 Fpen += tmp * tmp;
00739 }
00740 }
00741 Fadd += 100. * Fpen;
00742
00743
00744 for (i = 0; i < DIM; i++) {
00745 tmpvect[i] = 0.;
00746 tmp = sqrt(pow(condition/10., ((double)i)/((double)(DIM-1))));
00747 for (j = 0; j < DIM; j++) {
00748 tmpvect[i] += tmp * rot2[i][j] * (x[j] - Xopt[j]);
00749 }
00750 }
00751 x1 = tmpvect[0];
00752 for (i = 0; i < DIM; i++) {
00753 if (fabs(tmpvect[i]) > 0.5)
00754 {
00755 tmpvect[i] = round(tmpvect[i]);
00756 }
00757 else
00758 {
00759 tmpvect[i] = round(alpha * tmpvect[i])/alpha;
00760 }
00761 }
00762
00763 for (i = 0; i < DIM; i++) {
00764 tmx[i] = 0.;
00765 for (j = 0; j < DIM; j++) {
00766 tmx[i] += rotation[i][j] * tmpvect[j];
00767 }
00768 }
00769
00770
00771 for (i = 0; i < DIM; i++)
00772 {
00773 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
00774 }
00775 Ftrue = 0.1 * fmax(1e-4 * fabs(x1), Ftrue);
00776 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
00777
00778 Ftrue += Fadd;
00779 Fval += Fadd;
00780
00781 res.Fval = Fval;
00782 res.Ftrue = Ftrue;
00783 return res;
00784 }
00785
00786 TwoDoubles f115(double* x) {
00787
00788 int i, j, rseed;
00789 static int funcId = 115;
00790 static int rrseed = 7;
00791 static double condition = 100.;
00792 static double alpha = 10.;
00793 double x1, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00794 TwoDoubles res;
00795
00796 if (!isInitDone)
00797 {
00798 rseed = rrseed + 10000 * trialid;
00799
00800 Fopt = computeFopt(funcId, trialid);
00801 computeXopt(rseed, DIM);
00802 computeRotation(rotation, rseed + 1000000, DIM);
00803 computeRotation(rot2, rseed, DIM);
00804 isInitDone = 1;
00805 }
00806 Fadd = Fopt;
00807
00808
00809 for (i = 0; i < DIM; i++)
00810 {
00811 tmp = fabs(x[i]) - 5.;
00812 if (tmp > 0.)
00813 {
00814 Fpen += tmp * tmp;
00815 }
00816 }
00817 Fadd += 100. * Fpen;
00818
00819
00820 for (i = 0; i < DIM; i++) {
00821 tmpvect[i] = 0.;
00822 tmp = sqrt(pow(condition/10., ((double)i)/((double)(DIM-1))));
00823 for (j = 0; j < DIM; j++) {
00824 tmpvect[i] += tmp * rot2[i][j] * (x[j] - Xopt[j]);
00825 }
00826 }
00827 x1 = tmpvect[0];
00828 for (i = 0; i < DIM; i++) {
00829 if (fabs(tmpvect[i]) > 0.5)
00830 {
00831 tmpvect[i] = round(tmpvect[i]);
00832 }
00833 else
00834 {
00835 tmpvect[i] = round(alpha * tmpvect[i])/alpha;
00836 }
00837 }
00838
00839 for (i = 0; i < DIM; i++) {
00840 tmx[i] = 0.;
00841 for (j = 0; j < DIM; j++) {
00842 tmx[i] += rotation[i][j] * tmpvect[j];
00843 }
00844 }
00845
00846
00847 for (i = 0; i < DIM; i++)
00848 {
00849 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
00850 }
00851 Ftrue = 0.1 * fmax(1e-4 * fabs(x1), Ftrue);
00852 Fval = FCauchy(Ftrue, 1., 0.2);
00853
00854 Ftrue += Fadd;
00855 Fval += Fadd;
00856
00857 res.Fval = Fval;
00858 res.Ftrue = Ftrue;
00859 return res;
00860 }
00861
00862 TwoDoubles f116(double* x) {
00863
00864 int i, j, rseed;
00865 static int funcId = 116;
00866 static int rrseed = 10;
00867 static double condition = 1e4;
00868 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00869 TwoDoubles res;
00870
00871 if (!isInitDone)
00872 {
00873 rseed = rrseed + 10000 * trialid;
00874
00875 Fopt = computeFopt(funcId, trialid);
00876 computeXopt(rseed, DIM);
00877 computeRotation(rotation, rseed + 1000000, DIM);
00878 isInitDone = 1;
00879 }
00880 Fadd = Fopt;
00881
00882
00883 for (i = 0; i < DIM; i++)
00884 {
00885 tmp = fabs(x[i]) - 5.;
00886 if (tmp > 0.)
00887 {
00888 Fpen += tmp * tmp;
00889 }
00890 }
00891 Fadd += 100. * Fpen;
00892
00893
00894 for (i = 0; i < DIM; i++)
00895 {
00896 tmx[i] = 0.;
00897 for (j = 0; j < DIM; j++) {
00898 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
00899 }
00900 }
00901
00902 monotoneTFosc(tmx);
00903
00904 for (i = 0; i < DIM; i++)
00905 {
00906 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
00907 }
00908
00909 Fval = FGauss(Ftrue, 1.);
00910
00911 Ftrue += Fadd;
00912 Fval += Fadd;
00913
00914 res.Fval = Fval;
00915 res.Ftrue = Ftrue;
00916 return res;
00917 }
00918
00919 TwoDoubles f117(double* x) {
00920
00921 int i, j, rseed;
00922 static int funcId = 117;
00923 static int rrseed = 10;
00924 static double condition = 1e4;
00925 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00926 TwoDoubles res;
00927
00928 if (!isInitDone)
00929 {
00930 rseed = rrseed + 10000 * trialid;
00931
00932 Fopt = computeFopt(funcId, trialid);
00933 computeXopt(rseed, DIM);
00934 computeRotation(rotation, rseed + 1000000, DIM);
00935 isInitDone = 1;
00936 }
00937 Fadd = Fopt;
00938
00939
00940 for (i = 0; i < DIM; i++)
00941 {
00942 tmp = fabs(x[i]) - 5.;
00943 if (tmp > 0.)
00944 {
00945 Fpen += tmp * tmp;
00946 }
00947 }
00948 Fadd += 100. * Fpen;
00949
00950
00951 for (i = 0; i < DIM; i++)
00952 {
00953 tmx[i] = 0.;
00954 for (j = 0; j < DIM; j++) {
00955 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
00956 }
00957 }
00958
00959 monotoneTFosc(tmx);
00960
00961 for (i = 0; i < DIM; i++)
00962 {
00963 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
00964 }
00965
00966 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
00967
00968 Ftrue += Fadd;
00969 Fval += Fadd;
00970
00971 res.Fval = Fval;
00972 res.Ftrue = Ftrue;
00973 return res;
00974 }
00975
00976 TwoDoubles f118(double* x) {
00977
00978 int i, j, rseed;
00979 static int funcId = 118;
00980 static int rrseed = 10;
00981 static double condition = 1e4;
00982 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
00983 TwoDoubles res;
00984
00985 if (!isInitDone)
00986 {
00987 rseed = rrseed + 10000 * trialid;
00988
00989 Fopt = computeFopt(funcId, trialid);
00990 computeXopt(rseed, DIM);
00991 computeRotation(rotation, rseed + 1000000, DIM);
00992 isInitDone = 1;
00993 }
00994 Fadd = Fopt;
00995
00996
00997 for (i = 0; i < DIM; i++)
00998 {
00999 tmp = fabs(x[i]) - 5.;
01000 if (tmp > 0.)
01001 {
01002 Fpen += tmp * tmp;
01003 }
01004 }
01005 Fadd += 100. * Fpen;
01006
01007
01008 for (i = 0; i < DIM; i++)
01009 {
01010 tmx[i] = 0.;
01011 for (j = 0; j < DIM; j++) {
01012 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
01013 }
01014 }
01015
01016 monotoneTFosc(tmx);
01017
01018 for (i = 0; i < DIM; i++)
01019 {
01020 Ftrue += pow(condition, ((double)i)/((double)(DIM-1))) * tmx[i] * tmx[i];
01021 }
01022
01023 Fval = FCauchy(Ftrue, 1., 0.2);
01024
01025 Ftrue += Fadd;
01026 Fval += Fadd;
01027
01028 res.Fval = Fval;
01029 res.Ftrue = Ftrue;
01030 return res;
01031 }
01032
01033 TwoDoubles f119(double* x) {
01034
01035 int i, j, rseed;
01036 static int funcId = 119;
01037 static int rrseed = 14;
01038 static double alpha = 4.;
01039 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01040 TwoDoubles res;
01041
01042 if (!isInitDone)
01043 {
01044 rseed = rrseed + 10000 * trialid;
01045
01046 Fopt = computeFopt(funcId, trialid);
01047 computeXopt(rseed, DIM);
01048 computeRotation(rotation, rseed + 1000000, DIM);
01049 isInitDone = 1;
01050 }
01051 Fadd = Fopt;
01052
01053
01054 for (i = 0; i < DIM; i++)
01055 {
01056 tmp = fabs(x[i]) - 5.;
01057 if (tmp > 0.)
01058 {
01059 Fpen += tmp * tmp;
01060 }
01061 }
01062 Fadd += 100. * Fpen;
01063
01064
01065 for (i = 0; i < DIM; i++)
01066 {
01067 tmx[i] = 0.;
01068 for (j = 0; j < DIM; j++) {
01069 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
01070 }
01071 }
01072
01073
01074 for (i = 0; i < DIM; i++)
01075 {
01076 Ftrue += pow(fabs(tmx[i]), 2 + alpha * ((double)i)/((double)(DIM-1)));
01077 }
01078 Ftrue = sqrt(Ftrue);
01079
01080 Fval = FGauss(Ftrue, 1.);
01081
01082 Ftrue += Fadd;
01083 Fval += Fadd;
01084
01085 res.Fval = Fval;
01086 res.Ftrue = Ftrue;
01087 return res;
01088 }
01089
01090 TwoDoubles f120(double* x) {
01091
01092 int i, j, rseed;
01093 static int funcId = 120;
01094 static int rrseed = 14;
01095 static double alpha = 4.;
01096 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01097 TwoDoubles res;
01098
01099 if (!isInitDone)
01100 {
01101 rseed = rrseed + 10000 * trialid;
01102
01103 Fopt = computeFopt(funcId, trialid);
01104 computeXopt(rseed, DIM);
01105 computeRotation(rotation, rseed + 1000000, DIM);
01106 isInitDone = 1;
01107 }
01108 Fadd = Fopt;
01109
01110
01111 for (i = 0; i < DIM; i++)
01112 {
01113 tmp = fabs(x[i]) - 5.;
01114 if (tmp > 0.)
01115 {
01116 Fpen += tmp * tmp;
01117 }
01118 }
01119 Fadd += 100. * Fpen;
01120
01121
01122 for (i = 0; i < DIM; i++)
01123 {
01124 tmx[i] = 0.;
01125 for (j = 0; j < DIM; j++) {
01126 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
01127 }
01128 }
01129
01130
01131 for (i = 0; i < DIM; i++)
01132 {
01133 Ftrue += pow(fabs(tmx[i]), 2 + alpha * ((double)i)/((double)(DIM-1)));
01134 }
01135 Ftrue = sqrt(Ftrue);
01136
01137 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
01138
01139 Ftrue += Fadd;
01140 Fval += Fadd;
01141
01142 res.Fval = Fval;
01143 res.Ftrue = Ftrue;
01144 return res;
01145 }
01146
01147 TwoDoubles f121(double* x) {
01148
01149 int i, j, rseed;
01150 static int funcId = 121;
01151 static int rrseed = 14;
01152 static double alpha = 4.;
01153 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01154 TwoDoubles res;
01155
01156 if (!isInitDone)
01157 {
01158 rseed = rrseed + 10000 * trialid;
01159
01160 Fopt = computeFopt(funcId, trialid);
01161 computeXopt(rseed, DIM);
01162 computeRotation(rotation, rseed + 1000000, DIM);
01163 isInitDone = 1;
01164 }
01165 Fadd = Fopt;
01166
01167
01168 for (i = 0; i < DIM; i++)
01169 {
01170 tmp = fabs(x[i]) - 5.;
01171 if (tmp > 0.)
01172 {
01173 Fpen += tmp * tmp;
01174 }
01175 }
01176 Fadd += 100. * Fpen;
01177
01178
01179 for (i = 0; i < DIM; i++)
01180 {
01181 tmx[i] = 0.;
01182 for (j = 0; j < DIM; j++) {
01183 tmx[i] += rotation[i][j] * (x[j] - Xopt[j]);
01184 }
01185 }
01186
01187
01188 for (i = 0; i < DIM; i++)
01189 {
01190 Ftrue += pow(fabs(tmx[i]), 2 + alpha * ((double)i)/((double)(DIM-1)));
01191 }
01192 Ftrue = sqrt(Ftrue);
01193
01194 Fval = FCauchy(Ftrue, 1., 0.2);
01195
01196 Ftrue += Fadd;
01197 Fval += Fadd;
01198
01199 res.Fval = Fval;
01200 res.Ftrue = Ftrue;
01201 return res;
01202 }
01203
01204 TwoDoubles f122(double* x) {
01205
01206 int i, j, rseed;
01207 static int funcId = 122;
01208 static int rrseed = 17;
01209 static double condition = 10.;
01210 static double beta = 0.5;
01211 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01212 TwoDoubles res;
01213
01214 if (!isInitDone)
01215 {
01216 rseed = rrseed + 10000 * trialid;
01217
01218 Fopt = computeFopt(funcId, trialid);
01219 computeXopt(rseed, DIM);
01220 computeRotation(rotation, rseed + 1000000, DIM);
01221 computeRotation(rot2, rseed, DIM);
01222 isInitDone = 1;
01223 }
01224 Fadd = Fopt;
01225
01226
01227 for (i = 0; i < DIM; i++)
01228 {
01229 tmp = fabs(x[i]) - 5.;
01230 if (tmp > 0.)
01231 {
01232 Fpen += tmp * tmp;
01233 }
01234 }
01235 Fadd += 100. * Fpen;
01236
01237
01238 for (i = 0; i < DIM; i++)
01239 {
01240 tmpvect[i] = 0.;
01241 for (j = 0; j < DIM; j++)
01242 {
01243 tmpvect[i] += rotation[i][j] * (x[j] - Xopt[j]);
01244 }
01245 if (tmpvect[i] > 0)
01246 tmpvect[i] = pow(tmpvect[i], 1 + beta * ((double)i)/((double)(DIM-1)) * sqrt(tmpvect[i]));
01247 }
01248
01249 for (i = 0; i < DIM; i++)
01250 {
01251 tmx[i] = 0.;
01252 tmp = pow(sqrt(condition), ((double)i)/((double)(DIM-1)));
01253 for (j = 0; j < DIM; j++)
01254 {
01255 tmx[i] += tmp * rot2[i][j] * tmpvect[j];
01256 }
01257 }
01258
01259
01260 for (i = 0; i < DIM - 1; i++)
01261 {
01262 tmp = tmx[i] * tmx[i] + tmx[i+1] * tmx[i+1];
01263 Ftrue += pow(tmp, 0.25) * (pow(sin(50. * pow(tmp, 0.1)), 2.) + 1.);
01264 }
01265 Ftrue = pow(Ftrue/(double)(DIM - 1), 2.);
01266
01267 Fval = FGauss(Ftrue, 1.);
01268
01269 Ftrue += Fadd;
01270 Fval += Fadd;
01271
01272 res.Fval = Fval;
01273 res.Ftrue = Ftrue;
01274 return res;
01275 }
01276
01277 TwoDoubles f123(double* x) {
01278
01279 int i, j, rseed;
01280 static int funcId = 123;
01281 static int rrseed = 17;
01282 static double condition = 10.;
01283 static double beta = 0.5;
01284 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01285 TwoDoubles res;
01286
01287 if (!isInitDone)
01288 {
01289 rseed = rrseed + 10000 * trialid;
01290
01291 Fopt = computeFopt(funcId, trialid);
01292 computeXopt(rseed, DIM);
01293 computeRotation(rotation, rseed + 1000000, DIM);
01294 computeRotation(rot2, rseed, DIM);
01295 isInitDone = 1;
01296 }
01297 Fadd = Fopt;
01298
01299
01300 for (i = 0; i < DIM; i++)
01301 {
01302 tmp = fabs(x[i]) - 5.;
01303 if (tmp > 0.)
01304 {
01305 Fpen += tmp * tmp;
01306 }
01307 }
01308 Fadd += 100. * Fpen;
01309
01310
01311 for (i = 0; i < DIM; i++)
01312 {
01313 tmpvect[i] = 0.;
01314 for (j = 0; j < DIM; j++)
01315 {
01316 tmpvect[i] += rotation[i][j] * (x[j] - Xopt[j]);
01317 }
01318 if (tmpvect[i] > 0)
01319 tmpvect[i] = pow(tmpvect[i], 1 + beta * ((double)i)/((double)(DIM-1)) * sqrt(tmpvect[i]));
01320 }
01321
01322 for (i = 0; i < DIM; i++)
01323 {
01324 tmx[i] = 0.;
01325 tmp = pow(sqrt(condition), ((double)i)/((double)(DIM-1)));
01326 for (j = 0; j < DIM; j++)
01327 {
01328 tmx[i] += tmp * rot2[i][j] * tmpvect[j];
01329 }
01330 }
01331
01332
01333 for (i = 0; i < DIM - 1; i++)
01334 {
01335 tmp = tmx[i] * tmx[i] + tmx[i+1] * tmx[i+1];
01336 Ftrue += pow(tmp, 0.25) * (pow(sin(50. * pow(tmp, 0.1)), 2.) + 1.);
01337 }
01338 Ftrue = pow(Ftrue/(double)(DIM - 1), 2.);
01339
01340 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
01341
01342 Ftrue += Fadd;
01343 Fval += Fadd;
01344
01345 res.Fval = Fval;
01346 res.Ftrue = Ftrue;
01347 return res;
01348 }
01349
01350 TwoDoubles f124(double* x) {
01351
01352 int i, j, rseed;
01353 static int funcId = 124;
01354 static int rrseed = 17;
01355 static double condition = 10.;
01356 static double beta = 0.5;
01357 double Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01358 TwoDoubles res;
01359
01360 if (!isInitDone)
01361 {
01362 rseed = rrseed + 10000 * trialid;
01363
01364 Fopt = computeFopt(funcId, trialid);
01365 computeXopt(rseed, DIM);
01366 computeRotation(rotation, rseed + 1000000, DIM);
01367 computeRotation(rot2, rseed, DIM);
01368 isInitDone = 1;
01369 }
01370 Fadd = Fopt;
01371
01372
01373 for (i = 0; i < DIM; i++)
01374 {
01375 tmp = fabs(x[i]) - 5.;
01376 if (tmp > 0.)
01377 {
01378 Fpen += tmp * tmp;
01379 }
01380 }
01381 Fadd += 100. * Fpen;
01382
01383
01384 for (i = 0; i < DIM; i++)
01385 {
01386 tmpvect[i] = 0.;
01387 for (j = 0; j < DIM; j++)
01388 {
01389 tmpvect[i] += rotation[i][j] * (x[j] - Xopt[j]);
01390 }
01391 if (tmpvect[i] > 0)
01392 tmpvect[i] = pow(tmpvect[i], 1 + beta * ((double)i)/((double)(DIM-1)) * sqrt(tmpvect[i]));
01393 }
01394
01395 for (i = 0; i < DIM; i++)
01396 {
01397 tmx[i] = 0.;
01398 tmp = pow(sqrt(condition), ((double)i)/((double)(DIM-1)));
01399 for (j = 0; j < DIM; j++)
01400 {
01401 tmx[i] += tmp * rot2[i][j] * tmpvect[j];
01402 }
01403 }
01404
01405
01406 for (i = 0; i < DIM - 1; i++)
01407 {
01408 tmp = tmx[i] * tmx[i] + tmx[i+1] * tmx[i+1];
01409 Ftrue += pow(tmp, 0.25) * (pow(sin(50. * pow(tmp, 0.1)), 2.) + 1.);
01410 }
01411 Ftrue = pow(Ftrue/(double)(DIM - 1), 2.);
01412
01413 Fval = FCauchy(Ftrue, 1., 0.2);
01414
01415 Ftrue += Fadd;
01416 Fval += Fadd;
01417
01418 res.Fval = Fval;
01419 res.Ftrue = Ftrue;
01420 return res;
01421 }
01422
01423 TwoDoubles f125(double* x) {
01424
01425 int i, j, rseed;
01426 static int funcId = 125;
01427 static int rrseed = 19;
01428 static double scales;
01429 double F2, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01430 TwoDoubles res;
01431
01432 if (!isInitDone)
01433 {
01434 rseed = rrseed + 10000 * trialid;
01435
01436 Fopt = computeFopt(funcId, trialid);
01437
01438 scales = fmax(1., sqrt((double)DIM) / 8.);
01439 computeRotation(rotation, rseed, DIM);
01440
01441
01442
01443
01444
01445
01446
01447
01448
01449 isInitDone = 1;
01450 }
01451 Fadd = Fopt;
01452
01453
01454 for (i = 0; i < DIM; i++)
01455 {
01456 tmp = fabs(x[i]) - 5.;
01457 if (tmp > 0.)
01458 {
01459 Fpen += tmp * tmp;
01460 }
01461 }
01462 Fadd += 100. * Fpen;
01463
01464
01465 for (i = 0; i < DIM; i++) {
01466 tmx[i] = 0.5;
01467 for (j = 0; j < DIM; j++) {
01468 tmx[i] += scales * rotation[i][j] * x[j];
01469 }
01470 }
01471
01472
01473 tmp = 0.;
01474 for (i = 0; i < DIM - 1; i++)
01475 {
01476 F2 = 100. * (tmx[i] * tmx[i] - tmx[i+1]) * (tmx[i] * tmx[i] - tmx[i+1]) + (1 - tmx[i]) * (1 - tmx[i]);
01477 tmp += F2 / 4000. - cos(F2);
01478 }
01479 Ftrue = 1. + 1. * tmp / (double)(DIM - 1);
01480
01481 Fval = FGauss(Ftrue, 1.);
01482
01483 Ftrue += Fadd;
01484 Fval += Fadd;
01485
01486 res.Fval = Fval;
01487 res.Ftrue = Ftrue;
01488 return res;
01489 }
01490
01491 TwoDoubles f126(double* x) {
01492
01493 int i, j, rseed;
01494 static int funcId = 126;
01495 static int rrseed = 19;
01496 static double scales;
01497 double F2, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01498 TwoDoubles res;
01499
01500 if (!isInitDone)
01501 {
01502 rseed = rrseed + 10000 * trialid;
01503
01504 Fopt = computeFopt(funcId, trialid);
01505
01506 scales = fmax(1., sqrt((double)DIM) / 8.);
01507 computeRotation(rotation, rseed, DIM);
01508
01509
01510
01511
01512
01513
01514
01515
01516
01517 isInitDone = 1;
01518 }
01519 Fadd = Fopt;
01520
01521
01522 for (i = 0; i < DIM; i++)
01523 {
01524 tmp = fabs(x[i]) - 5.;
01525 if (tmp > 0.)
01526 {
01527 Fpen += tmp * tmp;
01528 }
01529 }
01530 Fadd += 100. * Fpen;
01531
01532
01533 for (i = 0; i < DIM; i++) {
01534 tmx[i] = 0.5;
01535 for (j = 0; j < DIM; j++) {
01536 tmx[i] += scales * rotation[i][j] * x[j];
01537 }
01538 }
01539
01540
01541 tmp = 0.;
01542 for (i = 0; i < DIM - 1; i++)
01543 {
01544 F2 = 100. * (tmx[i] * tmx[i] - tmx[i+1]) * (tmx[i] * tmx[i] - tmx[i+1]) + (1 - tmx[i]) * (1 - tmx[i]);
01545 tmp += F2 / 4000. - cos(F2);
01546 }
01547 Ftrue = 1. + 1. * tmp / (double)(DIM - 1);
01548
01549 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
01550
01551 Ftrue += Fadd;
01552 Fval += Fadd;
01553
01554 res.Fval = Fval;
01555 res.Ftrue = Ftrue;
01556 return res;
01557 }
01558
01559 TwoDoubles f127(double* x) {
01560
01561 int i, j, rseed;
01562 static int funcId = 127;
01563 static int rrseed = 19;
01564 static double scales;
01565 double F2, Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01566 TwoDoubles res;
01567
01568 if (!isInitDone)
01569 {
01570 rseed = rrseed + 10000 * trialid;
01571
01572 Fopt = computeFopt(funcId, trialid);
01573
01574 scales = fmax(1., sqrt((double)DIM) / 8.);
01575 computeRotation(rotation, rseed, DIM);
01576
01577
01578
01579
01580
01581
01582
01583
01584
01585 isInitDone = 1;
01586 }
01587 Fadd = Fopt;
01588
01589
01590 for (i = 0; i < DIM; i++)
01591 {
01592 tmp = fabs(x[i]) - 5.;
01593 if (tmp > 0.)
01594 {
01595 Fpen += tmp * tmp;
01596 }
01597 }
01598 Fadd += 100. * Fpen;
01599
01600
01601 for (i = 0; i < DIM; i++) {
01602 tmx[i] = 0.5;
01603 for (j = 0; j < DIM; j++) {
01604 tmx[i] += scales * rotation[i][j] * x[j];
01605 }
01606 }
01607
01608
01609 tmp = 0.;
01610 for (i = 0; i < DIM - 1; i++)
01611 {
01612 F2 = 100. * (tmx[i] * tmx[i] - tmx[i+1]) * (tmx[i] * tmx[i] - tmx[i+1]) + (1 - tmx[i]) * (1 - tmx[i]);
01613 tmp += F2 / 4000. - cos(F2);
01614 }
01615 Ftrue = 1. + 1. * tmp / (double)(DIM - 1);
01616
01617 Fval = FCauchy(Ftrue, 1., 0.2);
01618
01619 Ftrue += Fadd;
01620 Fval += Fadd;
01621
01622 res.Fval = Fval;
01623 res.Ftrue = Ftrue;
01624 return res;
01625 }
01626
01627 TwoDoubles f128(double* x) {
01628
01629 int i, j, k, rseed;
01630 static int funcId = 128;
01631 static int rrseed = 21;
01632 static double fitvalues[2] = {1.1, 9.1};
01633 static double maxcondition = 1000.;
01634 static double arrCondition[NHIGHPEAKS21];
01635 static double peakvalues[NHIGHPEAKS21];
01636 static double a = 0.1;
01637 double tmp2, f = 0., Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01638 double fac = -0.5 / (double)DIM;
01639 TwoDoubles res;
01640
01641 if (!isInitDone)
01642 {
01643 rseed = rrseed + 10000 * trialid;
01644
01645 Fopt = computeFopt(funcId, trialid);
01646 computeRotation(rotation, rseed, DIM);
01647 peaks = peaks21;
01648 unif(peaks, NHIGHPEAKS21 - 1, rseed);
01649 rperm = rperm21;
01650 for (i = 0; i < NHIGHPEAKS21 - 1; i++)
01651 rperm[i] = i;
01652 qsort(rperm, NHIGHPEAKS21 - 1, sizeof(int), compare_doubles);
01653
01654
01655
01656 arrCondition[0] = sqrt(maxcondition);
01657 peakvalues[0] = 10;
01658 for (i = 1; i < NHIGHPEAKS21; i++)
01659 {
01660 arrCondition[i] = pow(maxcondition, (double)(rperm[i-1])/((double)(NHIGHPEAKS21-2)));
01661 peakvalues[i] = (double)(i-1)/(double)(NHIGHPEAKS21-2) * (fitvalues[1] - fitvalues[0]) + fitvalues[0];
01662 }
01663 arrScales = arrScales21;
01664 for (i = 0; i < NHIGHPEAKS21; i++)
01665 {
01666 unif(peaks, DIM, rseed + 1000 * i);
01667 for (j = 0; j < DIM; j++)
01668 rperm[j] = j;
01669 qsort(rperm, DIM, sizeof(int), compare_doubles);
01670 for (j = 0; j < DIM; j++)
01671 {
01672 arrScales[i][j] = pow(arrCondition[i], ((double)rperm[j])/((double)(DIM-1)) - 0.5);
01673 }
01674 }
01675
01676 unif(peaks, DIM * NHIGHPEAKS21, rseed);
01677 Xlocal = Xlocal21;
01678 for (i = 0; i < DIM; i++)
01679 {
01680 Xopt[i] = 0.8 * (10. * peaks[i] -5.);
01681 for (j = 0; j < NHIGHPEAKS21; j++)
01682 {
01683 Xlocal[i][j] = 0.;
01684 for (k = 0; k < DIM; k++)
01685 {
01686 Xlocal[i][j] += rotation[i][k] * (10. * peaks[j * DIM + k] -5.);
01687 }
01688 if (j == 0)
01689 Xlocal[i][j] *= 0.8;
01690 }
01691 }
01692 isInitDone = 1;
01693 }
01694 Fadd = Fopt;
01695
01696
01697 for (i = 0; i < DIM; i++)
01698 {
01699 tmp = fabs(x[i]) - 5.;
01700 if (tmp > 0.)
01701 {
01702 Fpen += tmp * tmp;
01703 }
01704 }
01705 Fadd += 100. * Fpen;
01706
01707
01708 for (i = 0; i < DIM; i++)
01709 {
01710 tmx[i] = 0.;
01711 for (j = 0; j < DIM; j++)
01712 {
01713 tmx[i] += rotation[i][j] * x[j];
01714 }
01715 }
01716
01717
01718 for (i = 0; i < NHIGHPEAKS21; i++)
01719 {
01720 tmp2 = 0.;
01721 for (j = 0; j < DIM; j++)
01722 {
01723 tmp2 += arrScales[i][j] * (tmx[j] - Xlocal[j][i]) * (tmx[j] - Xlocal[j][i]);
01724 }
01725 tmp2 = peakvalues[i] * exp(fac * tmp2);
01726 f = fmax(f, tmp2);
01727 }
01728
01729 f = 10 - f;
01730
01731 if (f > 0)
01732 {
01733 Ftrue = log(f)/a;
01734 Ftrue = pow(exp(Ftrue + 0.49*(sin(Ftrue) + sin(0.79*Ftrue))), a);
01735 }
01736 else if (f < 0)
01737 {
01738 Ftrue = log(-f)/a;
01739 Ftrue = -pow(exp(Ftrue + 0.49*(sin(0.55 * Ftrue) + sin(0.31*Ftrue))), a);
01740 }
01741 else
01742 Ftrue = f;
01743
01744 Ftrue *= Ftrue;
01745
01746 Fval = FGauss(Ftrue, 1.);
01747
01748 Ftrue += Fadd;
01749 Fval += Fadd;
01750
01751
01752 res.Fval = Fval;
01753 res.Ftrue = Ftrue;
01754 return res;
01755 }
01756
01757 TwoDoubles f129(double* x) {
01758
01759 int i, j, k, rseed;
01760 static int funcId = 129;
01761 static int rrseed = 21;
01762 static double fitvalues[2] = {1.1, 9.1};
01763 static double maxcondition = 1000.;
01764 static double arrCondition[NHIGHPEAKS21];
01765 static double peakvalues[NHIGHPEAKS21];
01766 static double a = 0.1;
01767 double tmp2, f = 0., Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01768 double fac = -0.5 / (double)DIM;
01769 TwoDoubles res;
01770
01771 if (!isInitDone)
01772 {
01773 rseed = rrseed + 10000 * trialid;
01774
01775 Fopt = computeFopt(funcId, trialid);
01776 computeRotation(rotation, rseed, DIM);
01777 peaks = peaks21;
01778 unif(peaks, NHIGHPEAKS21 - 1, rseed);
01779 rperm = rperm21;
01780 for (i = 0; i < NHIGHPEAKS21 - 1; i++)
01781 rperm[i] = i;
01782 qsort(rperm, NHIGHPEAKS21 - 1, sizeof(int), compare_doubles);
01783
01784
01785
01786 arrCondition[0] = sqrt(maxcondition);
01787 peakvalues[0] = 10;
01788 for (i = 1; i < NHIGHPEAKS21; i++)
01789 {
01790 arrCondition[i] = pow(maxcondition, (double)(rperm[i-1])/((double)(NHIGHPEAKS21-2)));
01791 peakvalues[i] = (double)(i-1)/(double)(NHIGHPEAKS21-2) * (fitvalues[1] - fitvalues[0]) + fitvalues[0];
01792 }
01793 arrScales = arrScales21;
01794 for (i = 0; i < NHIGHPEAKS21; i++)
01795 {
01796 unif(peaks, DIM, rseed + 1000 * i);
01797 for (j = 0; j < DIM; j++)
01798 rperm[j] = j;
01799 qsort(rperm, DIM, sizeof(int), compare_doubles);
01800 for (j = 0; j < DIM; j++)
01801 {
01802 arrScales[i][j] = pow(arrCondition[i], ((double)rperm[j])/((double)(DIM-1)) - 0.5);
01803 }
01804 }
01805
01806 unif(peaks, DIM * NHIGHPEAKS21, rseed);
01807 Xlocal = Xlocal21;
01808 for (i = 0; i < DIM; i++)
01809 {
01810 Xopt[i] = 0.8 * (10. * peaks[i] -5.);
01811 for (j = 0; j < NHIGHPEAKS21; j++)
01812 {
01813 Xlocal[i][j] = 0.;
01814 for (k = 0; k < DIM; k++)
01815 {
01816 Xlocal[i][j] += rotation[i][k] * (10. * peaks[j * DIM + k] -5.);
01817 }
01818 if (j == 0)
01819 Xlocal[i][j] *= 0.8;
01820 }
01821 }
01822 isInitDone = 1;
01823 }
01824 Fadd = Fopt;
01825
01826
01827 for (i = 0; i < DIM; i++)
01828 {
01829 tmp = fabs(x[i]) - 5.;
01830 if (tmp > 0.)
01831 {
01832 Fpen += tmp * tmp;
01833 }
01834 }
01835 Fadd += 100. * Fpen;
01836
01837
01838 for (i = 0; i < DIM; i++)
01839 {
01840 tmx[i] = 0.;
01841 for (j = 0; j < DIM; j++)
01842 {
01843 tmx[i] += rotation[i][j] * x[j];
01844 }
01845 }
01846
01847
01848 for (i = 0; i < NHIGHPEAKS21; i++)
01849 {
01850 tmp2 = 0.;
01851 for (j = 0; j < DIM; j++)
01852 {
01853 tmp2 += arrScales[i][j] * (tmx[j] - Xlocal[j][i]) * (tmx[j] - Xlocal[j][i]);
01854 }
01855 tmp2 = peakvalues[i] * exp(fac * tmp2);
01856 f = fmax(f, tmp2);
01857 }
01858
01859 f = 10 - f;
01860
01861 if (f > 0)
01862 {
01863 Ftrue = log(f)/a;
01864 Ftrue = pow(exp(Ftrue + 0.49*(sin(Ftrue) + sin(0.79*Ftrue))), a);
01865 }
01866 else if (f < 0)
01867 {
01868 Ftrue = log(-f)/a;
01869 Ftrue = -pow(exp(Ftrue + 0.49*(sin(0.55 * Ftrue) + sin(0.31*Ftrue))), a);
01870 }
01871 else
01872 Ftrue = f;
01873
01874 Ftrue *= Ftrue;
01875
01876 Fval = FUniform(Ftrue, 0.49 + 1./DIM, 1.);
01877
01878 Ftrue += Fadd;
01879 Fval += Fadd;
01880
01881
01882 res.Fval = Fval;
01883 res.Ftrue = Ftrue;
01884 return res;
01885 }
01886
01887 TwoDoubles f130(double* x) {
01888
01889 int i, j, k, rseed;
01890 static int funcId = 130;
01891 static int rrseed = 21;
01892 static double fitvalues[2] = {1.1, 9.1};
01893 static double maxcondition = 1000.;
01894 static double arrCondition[NHIGHPEAKS21];
01895 static double peakvalues[NHIGHPEAKS21];
01896 static double a = 0.1;
01897 double tmp2, f = 0., Fadd, Fval, tmp, Fpen = 0., Ftrue = 0.;
01898 double fac = -0.5 / (double)DIM;
01899 TwoDoubles res;
01900
01901 if (!isInitDone)
01902 {
01903 rseed = rrseed + 10000 * trialid;
01904
01905 Fopt = computeFopt(funcId, trialid);
01906 computeRotation(rotation, rseed, DIM);
01907 peaks = peaks21;
01908 unif(peaks, NHIGHPEAKS21 - 1, rseed);
01909 rperm = rperm21;
01910 for (i = 0; i < NHIGHPEAKS21 - 1; i++)
01911 rperm[i] = i;
01912 qsort(rperm, NHIGHPEAKS21 - 1, sizeof(int), compare_doubles);
01913
01914
01915
01916 arrCondition[0] = sqrt(maxcondition);
01917 peakvalues[0] = 10;
01918 for (i = 1; i < NHIGHPEAKS21; i++)
01919 {
01920 arrCondition[i] = pow(maxcondition, (double)(rperm[i-1])/((double)(NHIGHPEAKS21-2)));
01921 peakvalues[i] = (double)(i-1)/(double)(NHIGHPEAKS21-2) * (fitvalues[1] - fitvalues[0]) + fitvalues[0];
01922 }
01923 arrScales = arrScales21;
01924 for (i = 0; i < NHIGHPEAKS21; i++)
01925 {
01926 unif(peaks, DIM, rseed + 1000 * i);
01927 for (j = 0; j < DIM; j++)
01928 rperm[j] = j;
01929 qsort(rperm, DIM, sizeof(int), compare_doubles);
01930 for (j = 0; j < DIM; j++)
01931 {
01932 arrScales[i][j] = pow(arrCondition[i], ((double)rperm[j])/((double)(DIM-1)) - 0.5);
01933 }
01934 }
01935
01936 unif(peaks, DIM * NHIGHPEAKS21, rseed);
01937 Xlocal = Xlocal21;
01938 for (i = 0; i < DIM; i++)
01939 {
01940 Xopt[i] = 0.8 * (10. * peaks[i] -5.);
01941 for (j = 0; j < NHIGHPEAKS21; j++)
01942 {
01943 Xlocal[i][j] = 0.;
01944 for (k = 0; k < DIM; k++)
01945 {
01946 Xlocal[i][j] += rotation[i][k] * (10. * peaks[j * DIM + k] -5.);
01947 }
01948 if (j == 0)
01949 Xlocal[i][j] *= 0.8;
01950 }
01951 }
01952 isInitDone = 1;
01953 }
01954 Fadd = Fopt;
01955
01956
01957 for (i = 0; i < DIM; i++)
01958 {
01959 tmp = fabs(x[i]) - 5.;
01960 if (tmp > 0.)
01961 {
01962 Fpen += tmp * tmp;
01963 }
01964 }
01965 Fadd += 100. * Fpen;
01966
01967
01968 for (i = 0; i < DIM; i++)
01969 {
01970 tmx[i] = 0.;
01971 for (j = 0; j < DIM; j++)
01972 {
01973 tmx[i] += rotation[i][j] * x[j];
01974 }
01975 }
01976
01977
01978 for (i = 0; i < NHIGHPEAKS21; i++)
01979 {
01980 tmp2 = 0.;
01981 for (j = 0; j < DIM; j++)
01982 {
01983 tmp2 += arrScales[i][j] * (tmx[j] - Xlocal[j][i]) * (tmx[j] - Xlocal[j][i]);
01984 }
01985 tmp2 = peakvalues[i] * exp(fac * tmp2);
01986 f = fmax(f, tmp2);
01987 }
01988
01989 f = 10 - f;
01990
01991 if (f > 0)
01992 {
01993 Ftrue = log(f)/a;
01994 Ftrue = pow(exp(Ftrue + 0.49*(sin(Ftrue) + sin(0.79*Ftrue))), a);
01995 }
01996 else if (f < 0)
01997 {
01998 Ftrue = log(-f)/a;
01999 Ftrue = -pow(exp(Ftrue + 0.49*(sin(0.55 * Ftrue) + sin(0.31*Ftrue))), a);
02000 }
02001 else
02002 Ftrue = f;
02003
02004 Ftrue *= Ftrue;
02005
02006 Fval = FCauchy(Ftrue, 1., 0.2);
02007
02008 Ftrue += Fadd;
02009 Fval += Fadd;
02010
02011
02012 res.Fval = Fval;
02013 res.Ftrue = Ftrue;
02014 return res;
02015 }
02016
02017 void initbenchmarksnoisy(void)
02018 {
02019 int i;
02020
02021 tmpvect = (double*)malloc(sizeof(double) * DIM);
02022 tmx = (double*)malloc(sizeof(double) * DIM);
02023 rotation = (double**)malloc(sizeof(double*) * DIM);
02024 rot2 = (double**)malloc(sizeof(double*) * DIM);
02025 linearTF = (double**)malloc(sizeof(double*) * DIM);
02026 peaks21 = (double*)malloc(sizeof(double) * DIM * NHIGHPEAKS21);
02027 rperm21 = (int*)malloc(sizeof(int) * fmax(DIM, NHIGHPEAKS21 - 1));
02028 arrScales21 = (double**)malloc(sizeof(double*) * NHIGHPEAKS21);
02029 Xlocal21 = (double**)malloc(sizeof(double*) * DIM);
02030
02031 for (i = 0; i < DIM; i++)
02032 {
02033 rotation[i] = (double*)malloc(sizeof(double) * DIM);
02034 rot2[i] = (double*)malloc(sizeof(double) * DIM);
02035 linearTF[i] = (double*)malloc(sizeof(double) * DIM);
02036 Xlocal21[i] = (double*)malloc(sizeof(double) * NHIGHPEAKS21);
02037 }
02038 for (i = 0; i < NHIGHPEAKS21; i++)
02039 arrScales21[i] = (double*)malloc(sizeof(double) * DIM);
02040
02041 return;
02042 }
02043
02044 void finibenchmarksnoisy(void)
02045 {
02046 free(tmpvect);
02047 free(tmx);
02048 freeStarStar(rotation, DIM);
02049 freeStarStar(rot2, DIM);
02050 freeStarStar(linearTF, DIM);
02051 free(peaks21);
02052 free(rperm21);
02053 freeStarStar(arrScales21, NHIGHPEAKS21);
02054 freeStarStar(Xlocal21, DIM);
02055 return;
02056 }
02057
02058 bbobFunction handlesNoisy[30] = { &f101, &f102, &f103, &f104, &f105, &f106, &f107, &f108, &f109, &f110, &f111, &f112, &f113, &f114, &f115, &f116, &f117, &f118, &f119, &f120, &f121, &f122, &f123, &f124, &f125, &f126, &f127, &f128, &f129, &f130};
02059 unsigned int handlesNoisyLength = 30;
02060