Thanks Heiko. But according to the manual, the 'const' does not seem to be necessary. I was wondering whether there is another possiblity without const_cast. Thanks. sumesh On Fri, Sep 18, 2009 at 2:12 PM, Heiko Bauke <[email protected]> wrote:
> Hi, > > On Fri, 18 Sep 2009 12:19:23 +0530 > "Sumesh P.T." <[email protected]> wrote: > > > I use gsl ode solver in my program for integration as given in : > > > http://www.gnu.org/software/gsl/manual/html_node/ODE-Example-programs.html > > Look at the definition of func > > > > func (double t, const double y[], double f[], void *params) > > > > y is a const. I am facing an issue because of this. > > I also think, this interface has an unfortunate design. In fact, I would > prefer > > func (double t, const double y[], double f[], const void *params) > > There is no (obvious) reason why func should change the parameters. The > current design forces me regularly to apply a const_cast (in C++) when > solving ODEs with GSL routines. > > > Heiko > > -- > -- Willst du den Wert des Geldes kennenlernen, geh und versuche > -- dir welches zu borgen. (Benjamin Franklin, 1706-1790) > -- Cluster Computing @ http://www.clustercomputing.de > -- Heiko Bauke @ http://www.mpi-hd.mpg.de/personalhomes/bauke > > > > _______________________________________________ > Help-gsl mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-gsl > _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
