简体   繁体   English

在Visual Studio中使用具有FFTW的单精度浮点

[英]Using single precision floating-point with FFTW in Visual Studio

I am trying to use the FFTW library in a Visual Studio project, and I am having trouble with getting the floating point precision to work. 我试图在Visual Studio项目中使用FFTW库,我在使浮点精度工作时遇到问题。 I have created the library files and linked them as in this post and I have only included the libfftw3f-3.lib library as it says in their documentation , and everything else is fine except for the fftw_plan_dft_r2c_2d() function. 我已经创建了库文件并将它们链接起来,就像在这篇文章中所说的那样,我只包含了libfftw3f-3.lib库,正如它在文档中所说的那样,除了fftw_plan_dft_r2c_2d()函数之外其他一切都很好。 It will not accept my array of type float* for parameter 3 because it is incompatible with its argument of type double*. 它不接受我的参数类型为float *的数组,因为它与double *类型的参数不兼容。 I understand it is just precision but, I would prefer to use floating point because fftw does support it, and b/c of the way I am memcpy() 'ing data from a float array. 我理解它只是精度但是,我更喜欢使用浮点,因为fftw确实支持它,而b / c的方式是memcpy()来自float数组的数据。 I am just having issues with fftw library using floating point. 我只是使用浮点来解决fftw库的问题。 I havent seen anything specific on this in their Windows section like in their Unix section besides linking to the libfftw3f-3.lib library. 除了链接到libfftw3f-3.lib库之外,我在他们的Windows部分中没有看到任何具体内容,就像他们的Unix部分一样。 Can anyone give me clues on how to make this happen? 谁能给我提供如何实现这一目标的线索?

对于FFTW中的单精度例程,您需要使用带有fftwf_前缀而不是fftw_ ,因此您对fftw_plan_dft_r2c_2d()调用实际上应该是fftwf_plan_dft_r2c_2d()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM