[Top][All Lists]

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

Re: [Help-gsl] gsl and C++

From: eknecronzontas
Subject: Re: [Help-gsl] gsl and C++
Date: Tue, 19 Jul 2005 19:46:43 -0700 (PDT)


     I posted about this once...mentioning a template
solution for sending a member function pointer. This
is my favorite solution and I have implemented a
version of this in an object-oriented library based on
GSL. I was actually planning on releasing it soon.
     I should note that SEAL's mathlibs:

has an alternative solution. Functions are specified
as classes which overload operator(). I have two
problems with this: 1) you can't easily have two
functions to be solved in the same class (how does it
know which operator() to call?), 2) you can't specify
parameters which are not class variables. (I could be
wrong about this...please let me know if I am...I
haven't had time to look at it too much.) 
     Anyway, I have been delayed releasing my library
(in addition to the problem of the US government
paperwork) because I discovered another thorny issue
(thread-safety) which I'd like to fix first. If a
"solver" class is a static member of a separate
user-created class, then the memory for the solver
must be separate from the solver class (as in GSL) so
that multiple instances of the user-defined class do
not clash. I'd love to hear ideas about this, and I'll
probably post a schematic solution soon.

Andrew Steiner

--- Brian Gough <address@hidden> wrote:

> Paul Schneider writes:
>  > Not that GSL has performance problems, but
> writing a C++ templated
>  > static version of the GSL probably would be a lot
> faster than the
>  > dynamic. E.g. routines that require pointers to
> functions could be run
>  > with function templates, which in turn could be
> inlined.
> A problem that was raised on the gsl-discuss list
> was that there was
> no easy way to pass a function pointer to a member
> function from C++
> to C.  The archives are at
> if
> you want to look at it.
> -- 
> Brian Gough
> Network Theory Ltd,
> Publishing Free Software Manuals ---
> _______________________________________________
> Help-gsl mailing list
> address@hidden

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

reply via email to

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