This thread is locked.Only browsing is available.
Top Page > Browsing
complex number in OpenMX code
Date: 2007/12/18 20:48
Name: H. Jeong

Hi.

OpenMX is written by C language in which C99 standard library provide many standard functions treating complex numbers.

In OpenMX code (in band calculation) complex numbers are treated by user-defined structure and functions. Also commented codes using standard library are remained in the source.

My question is "What is the reason of choosing user-defined structure than standard library"

Surely performance?

メンテ
Page: [1]

Re: complex number in OpenMX code ( No.1 )
Date: 2007/12/19 04:51
Name: T.Ozaki

Hi,

Though most of compilers provide the standard library treating the complex
number, some of comilers (for example PGI compiler) did not when I was coding.
So, for portability of the code, I chose the old style.

If you know that the situation has been improved largely, please let me know.
Of course I prefer the C99 style to the old fashion.

Regards,

TO

メンテ
Re: complex number in OpenMX code ( No.2 )
Date: 2007/12/24 02:17
Name: Vasilii Artyukhov

Been a while since my last experience with C... Couldn't it be possible to use something like

...
#ifdef NO_COMPLEX
<your hand-made complex type>
#else
<the standard C99 types>
...

and use "cpp -DNO_COMPLEX" when the compiler doesn't support the complex type?
メンテ

Page: [1]