Re: [eigen] FFT for Eigen |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] FFT for Eigen
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Tue, 19 May 2009 22:51:17 +0200
- 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=z7bWxMy/hkoaHHjG+walL4DwiI7dsmqh/f157wGwS7Y=; b=uxBP6MLicgtkU1Xb9Y4cfC8B5iboAZDf6YqxZTjNIInqbZxdevl7jzZaO0Z2X3o3nE RQXfCAXqrmP24TOzLJiMI3pzQ1m2a8HCbXIueseVcTp+/aIOxGqK4rnDo9S3RT7y2MPw 93hWsxzDVUItxDHXQVAxbcu88x4C1/2Snw5CQ=
- 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=OgSVpE9BxnW9RzYXG2xLgSQf3jKiO94pPUprRBgev25gb3SSXGy/RMXZDIeAEjHTJ8 BgrRiSQWGz+XQ7tYbGfIldpbwOp8JGZZL99KFat4p1KQhedUl6fblo1IC6GTmd9ILlb7 hcnd7ADR7i4TsaZMXIY0HG4+t6VG6hKtHFQ/k=
So unless this turns out to be safe, I'd rather add that to our list
of excuses for adding our own complex class (in addition to continued
support for std::complex).
Benoit
2009/5/19 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>:
> I'm OK if this doesn't crash.
>
> If the STL clearly specifies that the two coords in a complex<> are
> stored as an array, then it's OK.
> If on the other hand, some implementation stores the 2 coordinates as
> just 2 separate members, and someone compiles this with a strict 64
> bit alignment, then with complex<float> that will crash.
>
> Benoit
>
> 2009/5/19 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
>>>> Really? The only real() that I can see is const, and anyway, how would
>>>> we implement that? std::real() and std::imag() only return references
>>>> with certain GCC implementations while e.g. on GCC 4.0 / Mac they
>>>> return by value.
>>>>
>>>> It seemed to me that allowing that was one of the things that would
>>>> require us to have our own complex numbers class.
>>>
>>> arf, you are right., one more stupid annoying std limitation....
>>>
>>
>> ok, so, is anyone against adding that:
>>
>> inline float& ei_real(std::complex<float>& x) { return
>> reinterpret_cast<float*>(&x)[0]; }
>> inline float& ei_imag(std::complex<float>& x) { return
>> reinterpret_cast<float*>(&x)[1]; }
>>
>> so that we can have real() returning a lvalue ?
>>
>> Gael.
>>
>>
>>
>