[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] const gsl_odeiv_step_type
From: |
Frank Hrebabetzky |
Subject: |
[Help-gsl] const gsl_odeiv_step_type |
Date: |
Sat, 02 Jun 2007 15:52:48 -0300 |
User-agent: |
Thunderbird 1.5.0.10 (X11/20060911) |
Hi everybody,
The ODE example program contains the line
const gsl_odeiv_step_type * T = gsl_odeiv_step_rk8pd;
This way, the algorithm is determined at compile time, but I want to let
the user choose. so I tried
const gsl_odeiv_step_type * T;
T = &gsl_odeiv_step_rk8pd;
and got a compiler warning about incompatible pointer types. (This way,
the algorithm would be determined at compile time too, but the second
line could be replaced by a switch statement.) Next trial was
const gsl_odeiv_step_type * T;
T = (gsl_odeiv_step_type *)&gsl_odeiv_step_rk8pd;
This one compiled without any problem, but execution resulted in a
segmentation fault (whereas the original version from the ODE example
worked).
I am aware that this is more a C than a gsl question, but I don't know
where else to post it.
Thanks in advance,
--
Frank Hrebabetzky +55 / 48 / 3235 1106
Florianopolis, Brazil
- [Help-gsl] const gsl_odeiv_step_type,
Frank Hrebabetzky <=