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:46:45 +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=1OoCvkD8g/m3Wqj95OpNqbflVx9Sj2XDMEVB6tCpUBc=; b=nXJUxpEafX/SMJ/Gt2rQKuwoTE+bMo6zbZZPGZ/PKb20VJn0T+EB9wnCotiMBoItVK Z/HBspUNJRkUDBQkjADsMxir3deK+1kgY770GhNX7PZqeZrXcxs2Neu4uDo+XV7XIpy6 +iUzlUc/hqjOuOFMghnIVhLeJv1d7dDgxpFr8=*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=mvTpzTSrvneUkrA/MEVCVnxgWZcNkRNon8cxuK+AXkFmSttLfVHD6A0b+azSc0OYkm yCF+yXFvN5oAOyGB3/QzT/4b8p/7szAk192ibR8qYmTdCWGYizktWDdw5aWjwq/U5Wj9 DZN9NXv0157bWqyRiFapFq04ne8krk6lsAb0I=

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. > > >

**Follow-Ups**:**Re: [eigen] FFT for Eigen***From:*Benoit Jacob

**std::complex standard packing requirements was Re: [eigen] FFT for Eigen***From:*Mark Borgerding

**References**:**[eigen] FFT for Eigen***From:*Mark Borgerding

**Re: [eigen] FFT for Eigen***From:*Benoit Jacob

**Re: [eigen] FFT for Eigen***From:*Rohit Garg

**Re: [eigen] FFT for Eigen***From:*Benoit Jacob

**Re: [eigen] FFT for Eigen***From:*Gael Guennebaud

**Re: [eigen] FFT for Eigen***From:*Ricard Marxer Piñón

**Re: [eigen] FFT for Eigen***From:*Gael Guennebaud

**Re: [eigen] FFT for Eigen***From:*Benoit Jacob

**Re: [eigen] FFT for Eigen***From:*Gael Guennebaud

**Re: [eigen] FFT for Eigen***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] FFT for Eigen** - Next by Date:
**Re: [eigen] FFT for Eigen** - Previous by thread:
**Re: [eigen] FFT for Eigen** - Next by thread:
**Re: [eigen] FFT for Eigen**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |