From adababf92b5531f420b77867c5e1565f9e957bb3 Mon Sep 17 00:00:00 2001 From: Abdullah Date: Fri, 3 Jun 2016 09:29:20 +0800 Subject: [PATCH] fixed problems.c --- matlab/benchmark/problems.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/matlab/benchmark/problems.c b/matlab/benchmark/problems.c index 84df2a5..e2143df 100644 --- a/matlab/benchmark/problems.c +++ b/matlab/benchmark/problems.c @@ -2548,7 +2548,7 @@ void L2ZDT1(double *f, double *x) { */ void L2ZDT2(double *f, double *x) { - double m; + double m = 30; double *y; double sum; int b; @@ -2557,7 +2557,6 @@ void L2ZDT2(double *f, double *x) { double gx; double h; - m = 30; double M[30][30]={{0.218418,-0.620254,0.843784,0.914311,-0.788548,0.428212,0.103064,-0.473730,-0.300792,-0.185507,0.330423,0.151614,0.884043,-0.272951,-0.993822,0.511197,-0.0997948,-0.659756,0.575496,0.675617,0.180332,-0.593814,-0.492722,0.0646786,-0.666503,-0.945716,-0.334582,0.611894,0.281032,0.508749}, {-0.0265389,-0.920133,0.308861,-0.0437502,-0.374203,0.207359,-0.219433,0.914104,0.184408,0.520599,-0.885650,-0.375906,-0.708948,-0.379020,0.576578,0.0194674,-0.470262,0.572576,0.351245,-0.480477,0.238261,-0.159600,-0.827302,0.669248,0.494475,0.691715,-0.198585,0.0492812,0.959669,0.884086}, {-0.218632,-0.865161,-0.715997,0.220772,0.692356,0.646453,-0.401724,0.615443,-0.0601957,-0.748176,-0.207987,-0.865931,0.613732,-0.525712,-0.995728,0.389633,-0.0641730,0.662131,-0.707048,-0.340423,0.606240,0.0951648,-0.160446,-0.394585,-0.167581,0.0679849,0.449799,0.733505,-0.00918638,0.00446808}, @@ -2666,7 +2665,7 @@ void L2ZDT2(double *f, double *x) { */ void L2ZDT4(double *f, double *x) { - double m; + double m = 30; double *y; double sum; double temp; @@ -2676,8 +2675,6 @@ void L2ZDT4(double *f, double *x) { double gx; double h; double pi; - - m = 30; double M[30][30]={{0.218418,-0.620254,0.843784,0.914311,-0.788548,0.428212,0.103064,-0.473730,-0.300792,-0.185507,0.330423,0.151614,0.884043,-0.272951,-0.993822,0.511197,-0.0997948,-0.659756,0.575496,0.675617,0.180332,-0.593814,-0.492722,0.0646786,-0.666503,-0.945716,-0.334582,0.611894,0.281032,0.508749}, {-0.0265389,-0.920133,0.308861,-0.0437502,-0.374203,0.207359,-0.219433,0.914104,0.184408,0.520599,-0.885650,-0.375906,-0.708948,-0.379020,0.576578,0.0194674,-0.470262,0.572576,0.351245,-0.480477,0.238261,-0.159600,-0.827302,0.669248,0.494475,0.691715,-0.198585,0.0492812,0.959669,0.884086}, {-0.218632,-0.865161,-0.715997,0.220772,0.692356,0.646453,-0.401724,0.615443,-0.0601957,-0.748176,-0.207987,-0.865931,0.613732,-0.525712,-0.995728,0.389633,-0.0641730,0.662131,-0.707048,-0.340423,0.606240,0.0951648,-0.160446,-0.394585,-0.167581,0.0679849,0.449799,0.733505,-0.00918638,0.00446808},