[Top][All Lists]

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

Re: [Help-gsl] Re: gsl c++ wrapper ?

From: Leo Razoumov
Subject: Re: [Help-gsl] Re: gsl c++ wrapper ?
Date: Mon, 31 Aug 2009 15:04:19 -0400

On 8/31/09, Rodney Sparapani <address@hidden> wrote:
>  Hi Jordi:
>  I'd love to see this code posted somewhere, perhaps as a GSL add-on. But,
> I'm surprised that you say it is not difficult.  Having worked on
> matrices/linear algebra/etc. in C++ for many of the last 20 years, I would
> say that it is difficult.  Part of the difficulty comes from the mathematics
> itself which GSL handles well so we can set it aside.  But, the other
> difficult part comes from designing/creating a practical OO interface which
> is time-consuming.  This latter part is challenging due to C++
> syntax/semantics which can create hard-to-find bugs.  I don't doubt that you
> know all of this, but in my experience, creating a test-bed is the most
> important part of the endeavor.  Sadly, none of the C++ implementations that
> I have worked on (or got to work) have done this well.
>  Rodney

I second Rodney's opinion. Designing a good C++ wrapper to any matrix
library is difficult provided one tries to keep C++ semantics. Just as
an example, I would mention algebraic notations for matrix operations
in C++ (+-*). Using them in expressions like M=A*B+C*D will
create/destroy unnecessary temporaries. Optimizing them out in C++ is
a royal pain (expression templates onyone?). In my code I ended up
preserving GSL semantics when GSL math functions do *not*
allocate/free resources and all memory management is performed
manually by a user.   Creating good C++ bindings might look simple  at
first glance but the devil lurks in details.


reply via email to

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