help-gsl
[Top][All Lists]
Advanced

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

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


From: John D Lamb
Subject: Re: [Help-gsl] Re: gsl c++ wrapper ?
Date: Sun, 06 Sep 2009 21:08:27 +0100

On Sun, 2009-09-06 at 23:29 +0800, Hongzheng Wang wrote:
> If I really need a C++ style vector/matrix library, I would refer to
> boost uBlas + bindings.  But for daily normal numerical work I
> encountered, gsl is easily used and better because vector/matrix
> support is not the whole world; we usually need more numerical
> computation facilities beyond basic vector/matrix support and gsl is
> such a quite complete solution.

This is more or less my view. I like GSL for what it can do. Sometimes I
use other libraries or write my own versions of GSL functions when they
are not enough.

What I’d like is a simple C++ wrapper for GSL that provides C++ features
not readily available in C:

(1) shared pointer or similar so that you don’t have to worry about
freeing pointers
(2) Exception handling instead of int error values from functions.
(3) Better use of const
(4) Templates where appropriate, e.g. gsl::vector<double>,
gsl::vector<float> and the like, even if the only implementations are
only specialisations.
(5) Use of namespaces to simplify #includes.

Occasionally other C++ features might be useful:
Perhaps iterators for gsl::vector so that it’s easier to use the STL.
Perhaps operator overloading for GSL::complex.
Perhaps function objects where this is more natural than using a
function.

However, the main advantage for me is that more errors are caught at
compile-time in C++. I’m only interested in object orientation, operator
overloading and the like if there’s some obvious advantage to using
them.

If anyone wants to work on wrappers like this, I’m happy to help.

-- 
JDL





reply via email to

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