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: Thu, 22 Oct 2009 11:45:51 -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=lbWzNtnG6Mwslh1LGtfnobFmSgdOvJkpZ/sD/Ny0Jy4=; b=mSAvm65QMnjuEu7c8qIr+pKaNvT+XwnE43hh0kXjDA4HNqmJvVjUrwIrD2azIjCyk6 zOTBTiMD3+o51TqTcDZxHBGiXpiM6rW3vdOMV1B6Ud2E+Nv06wGurOZ9wugR1Su0lGuP G0+NeXQr+yDpF5P4Dp9fxLBEc1uq0EhFAouZE=
- 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=c3QZwxK5JWFY4isSLNaCmROFCOaK4I5U9WE2Kx96OwRCtWA5P1cneLy9GNMfcp92B2 W+61ZltYW7W6aVQUgmdLi7f5oAfHJck/G5C1LHKMRdUroZve+BxO/nPw/cqjD+sC1L6D k9rhPk2iA3T0U6gLb5ixwAFmEQkRRn/g+J+70=
2009/10/22 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>
>
> On Wed, Oct 21, 2009 at 4:15 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
> wrote:
>>
>> 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!
>
> I'm not sure about that, because with that solution you wont be able to
> declare backends with more that one template parameter. Think, e.g., about a
> fixed size backend or any other backend which could take advantage of
> compile time options...
Indeed!
Anyway, have you seen Mark's latest commit? It does
template <typename _Scalar,
typename _Impl=default_fft_impl<_Scalar> >
in other words he just kept his original approach and got rid of the
macro. I can understand now, how, given the mechanism for default
backends, this is better than what I proposed, as the user only
specifies explicitly the scalar type in most cases. So Mark, i'm ok
with this, no need to worry anymore about what i said.
Cheers,
Benoit