Code Monkey home page Code Monkey logo

Comments (9)

aimukhin avatar aimukhin commented on May 25, 2024

Thank you for reporting the issue.

It's a pity MSVC behaves like that. About support - well, I would rather prefer for my library to adhere to standards, not to specific compilers...

In the meantime, please try to change a definition in minfft.h from
typedef double complex minfft_cmpl;
to
typedef _Dcomplex minfft_cmpl;
and see if it helps.

from minfft.

aimukhin avatar aimukhin commented on May 25, 2024

@beecksche did this solve the issue?

from minfft.

beecksche avatar beecksche commented on May 25, 2024

I've started to implement it, but hadn't time to test it yet.

Unfortunately it's not done with only replace typedef double complex minfft_cmpl with typedef _Dcomplex minfft_cmpl. I had to change some parts of the code aswell. I hope I can send a pull request end of the week with some pre-processor directives for MSVC compiler.

from minfft.

beecksche avatar beecksche commented on May 25, 2024

@aimukhin, Now, the code can be complied additonally in C++ with MSVC (2017 & 2019, 32bit & 64bit).

But I haven't tested it! You wrote, that you used the benchFFT. Do you have a code snippet, or a readme how to use benchFFT with minfft?

from minfft.

aimukhin avatar aimukhin commented on May 25, 2024

@beecksche minfft is included in the current master benchFFT

from minfft.

aimukhin avatar aimukhin commented on May 25, 2024

@beecksche I just pushed two commits that fix the library code for MSVC. Hopefully, changing double complex to _Dcomplex should be the only thing you have to do. Please try it and let me know.

from minfft.

beecksche avatar beecksche commented on May 25, 2024

That's awesome! Works perfectly, and a much more elegant way than mine.

In the header I also had to add

#ifdef __cplusplus
extern "C" {
#endif
...
#ifdef __cplusplus
}
#endif

for C++ compiling.

from minfft.

aimukhin avatar aimukhin commented on May 25, 2024

@beecksche I just pushed commits to further improve compatibility. If C99 complex is not available (as with MSVC), then minfft_cmpl is an array of two reals, which is binary compatible with _Dcomplex and complex<double>. You only have to cast pointers:

_Dcomplex z[N],w[N];
or
complex<double> z[N],w[N];
...
minfft_dft((minfft_cmpl*)z,(minfft_cmpl*)w,a);

Also I added extern "C" wrapper to the header file.
Hope you can now use the library without any modifications.

from minfft.

beecksche avatar beecksche commented on May 25, 2024

@aimukhin Awesome, worked perfectly.

from minfft.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.