[Top][All Lists]

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

Re: POTENTIAL SPAM: Speed of complex<double> vs gsl_complex computations

From: Patrick Alken
Subject: Re: POTENTIAL SPAM: Speed of complex<double> vs gsl_complex computations
Date: Sat, 23 Jan 2021 10:25:53 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


  GSL was originally written to conform to the C89 standard, which did
not support native complex numbers, so GSL wrote its own implementation
of complex numbers and arithmetic. Native support for complex numbers
was introduced in C99 and later extended in C11. In the current master
branch of the git repository, GSL now supports native C complex numbers.

If you #include <complex.h> prior to gsl_complex.h in your C program,
and you are using a C11 compliant compiler, GSL will automatically
define gsl_complex to be the same as complex double. This functionality
is backward compatible, since the original definition is binary
compatible with the native C type.

This means you can do any operation with gsl_complex as you can with
complex double. You are welcome to try it out and see if it does what
you need.


On 1/11/21 2:16 PM, Pavel via Users list for GNU Scientific Library
(GSL) help wrote:
> Hello!
> I've installed GSL for use in Visual Studio Community 2017 following
> instructions of the blog
> -library-windows-macos-linux/.
> I've decided to measure speed of calculations of internal complex numbers
> realization using template complex<double> (including header complex.h) and
> realization of complex numbers in GSL library. For this purpose I've
> calculated large vectors ( length 10000000) of some complex function (that
> is actually frequency dependence of graphene conductivity). I've used speed
> optimization /O2 and /DHAVE_INLINE compiler options. The calculation time of
> the vector using gsl_complex numbers was 7 s, while using internal
> complex<double> numbers took only 1s. Is it true that GSL complex numbers
> work slower than internal realization or maybe I've missed some optimization
> settings of GSL?

reply via email to

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