Re: [eigen] Optimization for special complex operations |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Optimization for special complex operations*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Wed, 18 Aug 2010 08:40:52 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=IwgdsD56pshK+6GY7xanjPHMiPpvjVsbGre/v15k2/I=; b=uQTs0vSKqFIoPT4dWN5xHrzGnrbf8jXiMLiySH9k2ELNya6Mk3+px7nfyi4XWgAmev nFIyPQ4m0pTEZK8tjQNNyaidK7xzjTpeHSapBeWO6Lr6CIlJ8cex/cIY7RM0DL+QAl4p DbWmUtMfea0lpp3RTVvIPML+0AS2xB996rCJs=*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; b=LoTBOjaGZ0l9DzXczRf1U3k8kDZKareEqDSW/R7cuHA0n3hFAzJ5oxCHO4V53YtUzM /mq8vPJj8M/ne4ZL7miuRIL4ftXvhNkQeCphyo1EQlxRSwZiNHdzOAyOrLa++7eSOBkb jWZz/69kkbbqA6eXlPn9FsBr4y9YvC7e0EXDg=

2010/8/18 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>

Hm, you mean it's not efficient because the ArrayXf's are traversed multiple times. True, I hadn't thought of that...

ok, true!

Benoit

On Tue, Aug 17, 2010 at 2:01 PM, Carlos Becker <carlosbecker@xxxxxxxxx> wrote:yes, indeed.

> Gael: Yes you are right, I forgot about those. So I believe that something

> like matrix.colwise().normalized() should not be too hard to achieve.

Such a layout (Matrix<ArrayXf, 3, 1>) is not very convenient because

> I was also thinking about what Benoit said regarding Matrix<ArrayXf, 3, 1>.

> I am wondering which are the true advantages of doing over defining a normal

> MatrixXf, or better, a fixed size Matrix<rows,cols,float>.

it does not allow you to access to a given vector. It is also quite

limited with respect to the set of operations you can perform. For

instance you cannot do batch cross products, apply transformations,

etc.

Hm, you mean it's not efficient because the ArrayXf's are traversed multiple times. True, I hadn't thought of that...

So I think a Matrix<float,3,Dynamic,RowMajor> is more

appropriate.

ok, true!

Benoit

Not at all.

> Is there an

> especialization for a Matrix containing a single-dimensional Array?

Gael.

>

> Thanks

>

> On Tue, Aug 17, 2010 at 9:22 AM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx>

> wrote:

>>

>> On Mon, Aug 16, 2010 at 5:43 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>

>> wrote:

>> > 2010/8/16 Carlos Becker <carlosbecker@xxxxxxxxx>:

>> >>

>> >> On Mon, Aug 16, 2010 at 2:34 PM, Benoit Jacob

>> >> <jacob.benoit.1@xxxxxxxxx>

>> >> wrote:

>> >>>

>> >>> 2010/8/16 Carlos Becker <carlosbecker@xxxxxxxxx>:

>> >>> > Hi everyone again. Lately I've been using Eigen with complex numbers

>> >>> > to

>> >>> > calculate things such as calculating the maximum of the real part or

>> >>> > imaginary part of a certain vector. I suppose that trying to take

>> >>> > the

>> >>> > real

>> >>> > part and then use maxCoeff() or minCoeff() would create a possible

>> >>> > unnecessary temporary.

>> >>>

>> >>> No, it wouldn't :-)

>> >>

>> >> Ok good, maybe 'temporary' is not exactly what I wanted to say. I mean

>> >> that

>> >> maybe there are vectorized ways to do certain stuff and special

>> >> implementations could be provided for such operations.

>> >>

>> >>>

>> >>> > Another thing is to be able to do something like:

>> >>> >

>> >>> > MatrixXf nn,xx;

>> >>> > xx = nn.colwise().normalized();

>> >>>

>> >>> Hm. If we start going that route, won't we end up offering every

>> >>> possible vector operation as colwise() operation?

>> >>>

>> >> .....

>> >>>

>> >>> The biggest reason not to do it now is that it really isn't necessary

>> >>> to release Eigen 3.0 .... ;-)

>> >>

>> >>

>> >> Yes I understand. I think vector-wise operations could be very

>> >> important,

>> >> but they would probably require a bit of discussion before implementing

>> >> them

>> >> (ie: should we keep .colwise(), should we use .vectorwise(), in the

>> >> case

>> >> some names for the reductions and vector-wise operations are the same).

>> >> I

>> >> believe these kind of operations would be very useful since many times

>> >> a set

>> >> of vectors is stored in a matrix, so this way the user could benefit

>> >> from

>> >> extra performance.

>> >

>> > But the thing is, for this kind of use case, the much better approach

>> > is to use a matrix-of-arrays:

>> >

>> > Matrix<ArrayXf, 3, 1>

>> >

>> > then all operations are automatically supported and vectorized.

>> >

>> > The problem is that right now there is an inefficiency problem as we

>> > create useless temporaries with Scalar=Array. This is the problem that

>> > is the most worth fixing.

>>

>> agree.

>>

>>

>> To Carlos: note that colwise() and rowwise() returns a VectorwiseOp

>> proxy and are not limited to reduction only... For instance there are

>> functions which are not about reduction at all: +, -, cross,

>> hnormalized (homogeneous normalization), etc.

>>

>> gael

>>

>> >

>> > Benoit

>> >

>> >> I could try some prototypes to see if I can make it work. I designing

>> >> something like .vectorwise() could be fine.

>> >> Carlos

>> >

>> >

>> >

>>

>>

>

>

**References**:**[eigen] Optimization for special complex operations***From:*Carlos Becker

**Re: [eigen] Optimization for special complex operations***From:*Benoit Jacob

**Re: [eigen] Optimization for special complex operations***From:*Carlos Becker

**Re: [eigen] Optimization for special complex operations***From:*Benoit Jacob

**Re: [eigen] Optimization for special complex operations***From:*Gael Guennebaud

**Re: [eigen] Optimization for special complex operations***From:*Carlos Becker

**Re: [eigen] Optimization for special complex operations***From:*Gael Guennebaud

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Callback function for progress reporting** - Next by Date:
**[eigen] about changeset 6eb14e380** - Previous by thread:
**Re: [eigen] Optimization for special complex operations** - Next by thread:
**[eigen] Why no LU::solveInPlace()?**

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