[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: Pavel Z
Subject: RE: POTENTIAL SPAM: Speed of complex<double> vs gsl_complex computations
Date: Sun, 24 Jan 2021 16:51:05 +0300


OK, thank you, but it wasn't spam.

 23.01.2021, 20:25, Patrick Alken <patrick.alken@Colorado.EDU>Pavel,

 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
 > 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
 > settings of GSL?

reply via email to

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