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


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


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.



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

<your hand-made complex type>
<the standard C99 types>

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

Page: [1]