[Top][All Lists]

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

New branch for native complex support

From: Patrick Alken
Subject: New branch for native complex support
Date: Tue, 12 Jan 2021 22:29:30 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Hi all,

  FYI there is a new branch on the GSL git repository called 'cplx'. In
this branch you will find that you can use gsl_complex as a native C99
complex double type, if you #include <complex.h> prior to including
<gsl/gsl_complex.h>. This is possible because the gsl_complex type is
binary compatible with complex double. So basically you can
add/multiply/etc gsl_complex variables without needing to call the
gsl_complex_math routines now.

Many people have requested something like this over the years, so I am
finally getting around to doing it. Right now, this branch is
experimental, I am still working on writing some unit tests, and also
documentation. But I have been using it myself for a while and things
are working well.

The main issue right now, is you cannot do things like:

gsl_complex z;
GSL_REAL(z) = a;

which you can do with the original implementation. I don't know how to
define a macro which can do this with the C99 standard, although there
are non-portable GNU extensions which can do this. But otherwise,
everything should work as expected.

If interested, please try out the new branch and report back with
successes or failures.



reply via email to

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