[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:35:09 -0700

Unfortunately gslwrap seems a bit old and doesn't do anything with the ODE
parts of GSL as far as I can tell.

There is also PyGSL, which seems more up to date, but still doesn't do
anything with the ODE part of GSL.


Are most people content with the current interface for the ODE part of GSL?
I think it makes things nice an modular, in that you can easily change the
error control, stepping technique, ode solver all independently.  But it
would be nice if it could be easily used with objects which represent a
dynamic system, and include (among other things) the odes which govern their
behavior.  But maybe the trade-offs in going with this approach aren't worth
the convenience and organizational benefits that it may offer?


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

> On 10-04-20 02:18 PM, Luke wrote:
>> On Tue, Apr 20, 2010 at 12:21 PM, Daniel Neilson <address@hidden
>> <mailto: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.
>  Yeah, GSL is definitely written for C. I haven't looked at it at all, but
> there is a C++ wrapper for GSL.
>  You might have some luck with that.
> -Daniel

reply via email to

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