[Top][All Lists]

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

Re: [Help-gsl] setting function of gsl_odeiv_system structure to a C++

From: Luke
Subject: Re: [Help-gsl] setting function of gsl_odeiv_system structure to a C++ class member function
Date: Tue, 20 Apr 2010 13:18:34 -0700

On Tue, Apr 20, 2010 at 12:21 PM, Daniel Neilson <address@hidden>wrote:

>  That's the point of the "params" parameter to your eoms function. You can
> pass in a pointer to your Torus class, then just typecast the void* to a
> Torus* as the first statement in eoms().
>  Unfortunately, there's not going to be a way for you to treat eoms as a
> member function of Torus -- and gain easy access to the member variables.
> -Daniel

So it seems the moral of the story is that GSL was written with C in mind,
not C++.  Passing pointers to the time, state, ode right hand sides, and
parameters at each time step wouldn't be needed if each of these things were
member attributes that the ode function had access to.  So trying to fit the
existing framework into a C++ object may not make the most sense, it seems
to me.  I'll probably just go with a functional approach for now.

Thanks for all the help.


reply via email to

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