[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 |
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.
Patrick
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
> https://secure-web.cisco.com/1RG6v1TMIMAP9F4BNHb-l2ekF6CbMsLcORRPqxI-nfy4wYhY-jPm9hb53F50xGHIwAi7jy-FQz1OHyLzoGzzlJoblX_BHz5y8IALUDZW1tIW6jd7jSFMcKZ0RGjursfcehDgambN9crgIlKwo2lv0HC9X_o5WZY9JAnw_DhuuZegvZgv5-tk3R2igAqUyB2ED-rAfiITcxYuszOSRfeoQ0gNli9NjdeCLR83rhEfaEYlCLGphD4WSDwaIMD7pxA1S3z_ax50iPAuFRx7ebxKedimatr2j6FNiLhsJ-AVzAdRRvoqZx3HePGeIYIVhN5XFzLM0rv3XSO2ebKCIO6fBUmLqAfZnZNaQ4_yF_Q31zMnQhP8vQxFmBpP0gG1qvrMzMPodWW5gF1AGwSVTtTOcsO01r0ZxPZMRM1kfUISHCj59oJh06sD1FUk6S1-eTv8JTDyvPRV_HlmgOTI44z4Hgw/https%3A%2F%2Fsolarianprogrammer.com%2F2020%2F01%2F26%2Fgetting-started-gsl-gnu-scientific
> -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?
>
>