Re: [eigen] Eigen::FFT and Eigen::Complex in repo |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Eigen::FFT and Eigen::Complex in repo
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 21 Oct 2009 10:15:28 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=aBZogVCMjua2Ct1hgvTOArOytxknq13HTYyLeltbXk0=; b=mw0+mUbnEQSOWlz1eIu8jY+zyUJETT/32bdNAPT3a0WXD0Wnbd6fXD3Ys2MHQl1+ax YI4CVzLBYskcvypDvSrB/9NzpvBLvP4XkIGh6dInudeK3Xw1YLcR4l9YSzLK5COqevnl D2c0cS/FNMbIC8RKZZ+nCSJVqiR828ohgQBS0=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=rHQErsonDz9eP2yKghGXqvb656ht2oxWtoKyMAr+XOmuLQcoSmlZ1SLjUjo2MmN4XD tnQsPSBoqkIBl5mu4c57MDVFE7MwBHKlZGY4o52eQYUMLyKEp9W9d1VhqRRuAjmWHdtc 39P+TEE6uSj5LeJECyhPNCGL39MKtS6pntSN0=
2009/10/21 Mark Borgerding <mark@xxxxxxxxxxxxxx>:
> Benoit Jacob wrote:
>>
>> FFT line 48:
>>
>> template <typename _Scalar,
>> typename _Traits=DEFAULT_FFT_IMPL<_Scalar>
>> >
>>
>> First, why call it Traits when Impl seems to be what it really is?
>
> Done.
>
>
>> Also, here you're passing _Scalar twice, and are using a macro. You
>> can improve on both fronts in 2 ways:
>> * either you let _Scalar be deduced from _Impl
>>
>
> My thinking behind the dual argument was to allow quick and easy declaration
> from the user standpoint.
> e.g.
> FFT<float>
> where the implementation that gets used is the best available at compile
> time. Rather than
> FFT< ei_kissfft_impl<float> >
> which seems verbose and inflexible
> (also notice the error prone "> >" )
ah, good point, so nevermind this idea.
>
> I agree that the use of preprocessor macros to define the default is less
> than ideal. Perhaps it should not default to the best available, but rather
> to whichever library is requested via preprocessor definitions.
>
>
>> * or you can keep the _Scalar parameter and let _Impl be a template
>> template parameter:
>>
>> template <typename _Scalar, template<typename t> class _Impl>
>> class FFT
>> {
>> ...
>> };
>>
>
> I have not done this before. I will give it a try.
Yes it now seems like the way to go!
>
>>
>> ei_fftw_impl.h line 25:
>>
>> the using namespace Eigen is best centralized in FFT.
>>
>
> Can you elaborate? Do you mean the ei_* classess should be at the global
> scope?
No no, everything is in namespace Eigen, all I mean is that instead of
doing namespace Eigen {...} in every source file, we use to just do it
once in the big public header, here FFT, and do the #include "src/..."
inside of that.
For example we're soon going to replace namespace Eigen to "ei" and
now it pays off to have centralized that.
>
>
> (to be continued)
Can't wait for the next episode!
And, another TODO point: what about fixed size? Currently, even if we
pass a MatrixBase, the size at compile time isn't used. I don't know
anything about FFT but seem to remember that people did have a use for
a fixed-size FFT.
Benoit