Re: [eigen] resizing in ReturnByValue assignment |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] resizing in ReturnByValue assignment*From*: Mark Borgerding <mark@xxxxxxxxxxxxxx>*Date*: Mon, 08 Mar 2010 11:19:50 -0500

On 03/08/2010 09:56 AM, Benoit Jacob wrote:

2010/3/8 Mark Borgerding<mark@xxxxxxxxxxxxxx>:My concern is that there is no value added by the initial resize. At best it is a NOOP. At worst, it is a silent performance killer when resizes don't match exactly. In the case of Inverse FFTs, the size of the output depend on the TYPE of output requested. This is NOT available during the construction of the proxy object. It is not available until the evalTo is called.Strange. We didn't design ReturnByValue for this use case. So your problem is deeper: you can't, then, implement rows()/cols() in the ReturnByValue-derived class. This means that, calling foo() your function returning a ReturnByValue object, you can't support general arithmetic expressions like some_matrix + foo() as that would require foo() to evaluate into a temporary matrix, but it can't know its size (or that would be far too complex logic to determine in general from the expression it is being nested into).

some_matrix = foo(); but some_matrix = foo()*42; is nested and requires more knowledge.

// pre-example code VectorXf real1,real2; VectorXcf cpx1; real1.setRandom(len); FFT<float> fft; fft.SetFlag( fft.HalfSpectrum ); fft.fwd(cpx1,real1); // EXAMPLE CODE

Option 1.

Option 2.

-- Mark

**Follow-Ups**:**Re: [eigen] resizing in ReturnByValue assignment***From:*Benoit Jacob

**References**:**[eigen] resizing in ReturnByValue assignment***From:*Mark Borgerding

**Re: [eigen] resizing in ReturnByValue assignment***From:*Hauke Heibel

**Re: [eigen] resizing in ReturnByValue assignment***From:*Benoit Jacob

**Re: [eigen] resizing in ReturnByValue assignment***From:*Mark Borgerding

**Re: [eigen] resizing in ReturnByValue assignment***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Eigen/src/Core/arch/Default/Settings.h not included in install target** - Next by Date:
**Re: [eigen] resizing in ReturnByValue assignment** - Previous by thread:
**Re: [eigen] resizing in ReturnByValue assignment** - Next by thread:
**Re: [eigen] resizing in ReturnByValue assignment**

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