help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] gsl ode solver - const a problem?


From: Sumesh P.T.
Subject: [Help-gsl] gsl ode solver - const a problem?
Date: Fri, 18 Sep 2009 12:19:23 +0530

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.
In my calculations, I pass a structure through params; but it so happens
that y is also a member of the same structure 'params'
In order to be using the correct modified values of y for all calculations I
specify,
params->... = &y[i]
Now this gives me a warning during compilation as  "warning: assignment
discards qualifiers from pointer target type" though it does the correction
calculation. Obviously it is due to the 'const' in the definition of
variable in the function func. Can some kind of typecasting help? will that
be safe?
In the manual () the const option does not seem to be necssearby; but if i
remove it in my program, the machine cries during compliation.
Can someone help?
Thanks
sumesh


reply via email to

[Prev in Thread] Current Thread [Next in Thread]