表达模板和FFT [英] expression template and FFT

查看:61
本文介绍了表达模板和FFT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




表达式模板可用于实现简单的

运算符而无需使用临时值(例如C ++中的那些
模板)。


我想知道表达式模板是否对

卷积操作有用。

例如,我有两个数组a1和a2。为了计算它们之间的卷积

,我需要计算它们的FFT,它应该是存储在两个临时数组中的
。然后这些数组将乘以
和FFT返回,这也需要一个临时数组。完全有

三个临时数组。


似乎表达式模板不会减少

临时数组的数量。有没有更好的方法来减少临时工作?


谢谢,


Hi,

Expression template can be used for the implementation of simple
operators without using temporaries (e.g. the ones in the book C++
Template).

I''m wondering whether expression template is useful for the
convolution operation.

For example, I have two arrays a1 and a2. To compute the convolution
between them I need to compute the FFT of both of them, which shall be
stored in two temporary arrays. These arrays then shall be multiplied
and FFT back, which also need a temporary arrays. There are totally
three temporary arrays.

It seems that expression template would not reduce the number of
temporary arrays. Are there any better way to reduce the temporaries?

Thanks,
Peng

推荐答案

10月19日,7:49 * pm,Peng Yu< PengYu ... @ gmail.comwrote:
On Oct 19, 7:49*pm, Peng Yu <PengYu...@gmail.comwrote:




表达式模板可用于实现简单的

运算符而不使用临时值(例如书中的那些C ++

模板)。 />

我想知道表达式模板是否对

卷积操作有用。


例如,我有两个数组a1和a2。为了计算它们之间的卷积

,我需要计算它们的FFT,它应该是存储在两个临时数组中的
。然后这些数组将乘以
和FFT返回,这也需要一个临时数组。完全有

三个临时数组。


似乎表达式模板不会减少

临时数组的数量。有没有更好的方法来减少临时工资?


谢谢,


Hi,

Expression template can be used for the implementation of simple
operators without using temporaries (e.g. the ones in the book C++
Template).

I''m wondering whether expression template is useful for the
convolution operation.

For example, I have two arrays a1 and a2. To compute the convolution
between them I need to compute the FFT of both of them, which shall be
stored in two temporary arrays. These arrays then shall be multiplied
and FFT back, which also need a temporary arrays. There are totally
three temporary arrays.

It seems that expression template would not reduce the number of
temporary arrays. Are there any better way to reduce the temporaries?

Thanks,
Peng



如果你想减少临时工,尝试阅读Alexandrescu'的mojo

代码。表达式模板太高级,无法满足您的需求,

因此可能无需花时间编码。希望它有所帮助,


aa

If you want to reduce temporaries, try to read Alexandrescu''s mojo
code. Expression templates are too advanced for what you need to do,
so it may not pay the time in coding it. Hope it helps,

aa


On 20 Okt。,05:53,aaragon< alejandro.ara ... @ gmail.comwrote:
On 20 Okt., 05:53, aaragon <alejandro.ara...@gmail.comwrote:

>

如果你想减少临时工作,请尝试阅读Alexandrescu'的魔力

代码。表达式模板太高级,无法满足您的需求,

因此可能无需花时间编码。希望它有所帮助,


aa
>
If you want to reduce temporaries, try to read Alexandrescu''s mojo
code. Expression templates are too advanced for what you need to do,
so it may not pay the time in coding it. Hope it helps,

aa



嗯,我不知道术语mojo。只需对它进行搜索加工,然后找到


- http://www.ddj.com/database/184403855

我会看看这个。感谢您的提示。


- Maik

Hm, I didn''t know the term "mojo". Just search-machined for it and
found:
- http://www.ddj.com/database/184403855
I''ll have a look into this. Thanks for hint.

-- Maik


10月20日,5:01 * am,Maik< Beckmann.M ... @ googlemail.comwrote:
On Oct 20, 5:01*am, Maik <Beckmann.M...@googlemail.comwrote:

On 20 Okt。,05:53,aaragon< alejandro.ara ... @ gmail.comwrote:
On 20 Okt., 05:53, aaragon <alejandro.ara...@gmail.comwrote:

如果你想减少临时值,请尝试阅读Alexandrescu'的mojo

代码。表达式模板太高级,无法满足您的需求,

因此可能无需花时间编码。希望它有所帮助,
If you want to reduce temporaries, try to read Alexandrescu''s mojo
code. Expression templates are too advanced for what you need to do,
so it may not pay the time in coding it. Hope it helps,


aa
aa



嗯,我不知道术语mojo。 *只需对其进行搜索加工,然后找到


* -http://www.ddj.com/database/184403855

I我会看看这个。感谢提示。


- Maik


Hm, I didn''t know the term "mojo". *Just search-machined for it and
found:
*-http://www.ddj.com/database/184403855
I''ll have a look into this. Thanks for hint.

-- Maik



在了解它的工作原理后,这很容易实现。好的

运气,


aa

That is very easy to implement after you understand how it works. Good
luck,

aa


这篇关于表达模板和FFT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆