Skip to content

Commit

Permalink
Merge pull request #7 from shaleenx/master
Browse files Browse the repository at this point in the history
Optimize matlab/benchmark/problems.c with arrays instead of file i/o for data
  • Loading branch information
ash-aldujaili committed Jun 2, 2016
2 parents 79e3dc7 + 9045f7b commit 91a3cbb
Show file tree
Hide file tree
Showing 2 changed files with 439 additions and 389 deletions.
20 changes: 8 additions & 12 deletions c/benchmark/bmobenchProblems.c
Original file line number Diff line number Diff line change
Expand Up @@ -2473,18 +2473,15 @@ void p39(double *f, double *x) {
void p40(double *f, double *x) {

double m =30;
//double **M ;
double *y;
double sum;
int b;
int i, j;
double ff1;
double gx;
double h;
//FILE * fp;

double *y;
double sum;
int b;
int i, j;
double ff1;
double gx;
double h;

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},
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},
{0.404396,0.449996,0.162711,0.294454,-0.563345,-0.114993,0.549589,-0.775141,0.677726,0.610715,0.0850755,0.0419388,-0.323614,-0.973719,-0.680238,-0.270873,-0.209617,0.968436,0.908798,0.975851,-0.994918,-0.0621977,0.628171,0.761228,0.343720,-0.792042,-0.144765,-0.965748,0.0133606,-0.0260565},
Expand Down Expand Up @@ -2842,7 +2839,6 @@ void p42(double *f, double *x) {
void p43(double *f, double *x) {

double m =10;
//double **M ;
double *y;
double sum;
int b;
Expand Down
Loading

0 comments on commit 91a3cbb

Please sign in to comment.