|
From: | Francesco Faccio |
Subject: | Re: Avoid global pointers in dae |
Date: | Mon, 15 Aug 2016 20:50:15 +0000 |
Carlo de Falco wrote: > On 15 Aug 2016, at 12:42, Francesco Faccio <address@hidden> wrote:
> > > What I wanted to do to avoid global pointers was to overload the constructor of DAEFunc in order to call > > > > ColumnVector res = (*pointres) (y0, yp0, t, ires, ida_fcn); > > > > where ida_fcn is a octave_function *, but octave_function is an incomplete type inside liboctave. > > The same problem affects the Jacobian evaluation. > > Is there any special reason why you insist setting user_data to a function pointer to user function > instead of using the 'this' pointer of your IDA object? > > That would look much more simple and natural to me because then you can implement anything you need > as a method in your class and you can also directly access all data stored in instances of that class ... > > c. Carlo, in that mail I was providing some code in order to explain better the differences between the design I implemented and the one you suggested, as you asked. Of course the example you showed is easier to implement and make the code less rigid. I have already removed lambdas and the pointers passed through user_data. Thank you, Francesco |
[Prev in Thread] | Current Thread | [Next in Thread] |