help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] Question: gsl in C++ ??


From: Jordi Gutierrez Hermoso
Subject: Re: [Help-gsl] Question: gsl in C++ ??
Date: Wed, 14 Mar 2007 00:09:14 -0600

On 13/03/07, eknecronzontas <address@hidden> wrote:
I use operator[] because it allows me to use C-style arrays, which are faster,

I have not looked at your code, so perhaps I should do that before I
comment on it, but I can tell you one thing: there are few valid
reasons to use C-like arrays in C++ and speed is certainly not one of
them, especially not for numerical computations. The C++ standard
requires valarrays to be as optimised as possible, and I trust that
the GNU implementation of valarrays satisfies these requirements (but
if I'm wrong, please correct me). It might even be possible to
implement gaxpy and saxpy operations with valarrays without using the
BLAS interface; indeed, code with valarrays is intended precisely for
vectorisation on specialised hardware where the compiler is allowed as
many optimisations as possible.

Down with "C++ classes and constructs are slow" beliefs! :D

The situation for 2-d or higher-d arrays is more complicated...

Another case for valarrays and slices! Slicing valarrays seems to me
like a rather straightforward method for creating 2-d or N-d arrays.

If you're not constrained to the GSL structure, then there are C++ ish
alternatives that have already been created (e.g. the template numerical toolkit
aka TNT).

Another library I haven't looked into. Hm, if I'm going to be putting
together a proposal for Google's summer of code, I'd better be aware
of these alternatives. Thank you for pointing it out.

Also, I was looking at the license for the FunctionParser class, which
isn't GPLed and seems to insinuate that GPLed code cannot be
commercial. The license is certainly not DFSG-free, since it restricts
commercial use, which is usually my own lowest criterion for
determining the freeness of code. The license certainly isn't written
in proper legal terms, and saying "it's free, period" doesn't clarfiy
much of anything, especially since "free" doesn't have a legal meaning
I'm aware of.

I think I would prefer to avoid using this class unless the author
agrees to change licensing terms. I may contact the author about this
if I intend to use this class and your (?) code as a basis for
creating the rest of a C++ numerical library based on the GSL.

Cheers,
- Jordi G. H.




reply via email to

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