help-gsl
[Top][All Lists]
Advanced

[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)

Hello!

     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: 

http://seal.web.cern.ch/seal/MathLibs/MathCore-1_0_0/html/index.html


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.

HTH,
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
> http://sources.redhat.com/gsl/ if
> you want to look at it.
> 
> -- 
> Brian Gough
> 
> Network Theory Ltd,
> Publishing Free Software Manuals ---
> http://www.network-theory.co.uk/
> 
> 
> _______________________________________________
> Help-gsl mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-gsl
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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