Peteysoft / libmsci

All my scientific software thrown into one bucket.
Other
40 stars 4 forks source link

default argument references parameter 'solver' #2

Closed pemsley closed 9 years ago

pemsley commented 9 years ago

The function argument name should not overlap with the default argument:

In file included from constrained.cc:9: ./constrained.h:73:25: error: default argument references parameter 'solver' gsl_vector *)=&solver); ~^~

Instead of:

  int constrained(gsl_matrix *a,    //matrix to solve
        gsl_vector *b,      //solution vector
        gsl_matrix *v,      //constraint normals
        gsl_vector *c,      //constraint thresholds
        gsl_vector *x,      //result
        int (* solver) (gsl_matrix *,
                     gsl_vector *,
                     gsl_vector *)=&solver);

use

  int constrained(gsl_matrix *a,    //matrix to solve
        gsl_vector *b,      //solution vector
        gsl_matrix *v,      //constraint normals
        gsl_vector *c,      //constraint thresholds
        gsl_vector *x,      //result
        int (* solver_func) (gsl_matrix *,
                     gsl_vector *,
                     gsl_vector *)=&solver);

For find_interior() also.

Peteysoft commented 9 years ago

Dear Paul:Thanks for the heads up on the errors. I have fixed them and the changes have been committed.Regards,Peter

-------- Original Message -------- Subject: [libmsci] default argument references parameter 'solver' (#2) From: Paul Emsley notifications@github.com Date: Fri, September 25, 2015 3:39 am To: Peteysoft/libmsci libmsci@noreply.github.com

The function argument name should not overlap with the default argument: In file included from constrained.cc:9: ./constrained.h:73:25: error: default argument references parameter 'solver' gslvector )=&solver); ~^~ Instead of: int constrained(gsl_matrix a, //matrix to solve gsl_vector b, //solution vector gsl_matrix v, //constraint normals gsl_vector c, //constraint thresholds gslvector *x, //result int ( solver) (gslmatrix , gsl_vector , gsl_vector )=&solver); use int constrained(gsl_matrix a, //matrix to solve gsl_vector b, //solution vector gsl_matrix v, //constraint normals gsl_vector c, //constraint thresholds gslvector *x, //result int ( solver_func) (gsl_matrix , gsl_vector , gsl_vector *)=&solver); For find_interior() also. —Reply to this email directly or view it on GitHub.