[eigen] efficient SoA with Eigen
• To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
• Subject: [eigen] efficient SoA with Eigen
• From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
• Date: Wed, 9 Jun 2010 08:00:49 -0400
• Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=UImYuI0S/N+ukr6ZXzcFdEXiG4McF7r20tqm1RYSEhvJuKaaZcTgJnezuC4pS8UtRc LY6io2ChALQQ6z4L1SqOYUx1gvq/1nj88mAHwN34c0GleGBcR/qv3yj7wlv8EPFA4Pup i7bBUaFEY3kHYu6/d/0jb+L+uTDvfWhDxfRHo=

```Hi,

the new Array class is usable as Scalar type, which is great, but we
have to make sure that doing so is efficient.
For example: Matrix<ArrayXf, 2, 2> m;  m = m + m;

For now I have taken care of the math functions, so doing m = m.log()
is efficient, as m.log() returns a Matrix of log array expressions.

But as far as I understand (correct me Gael if I'm wrong) we still
have to do work for the above m = m+m example.

In the result xpr for m+m, we need to make the Scalar type be the
result type of ArrayXf+ArrayXf.

I amn't sure where is the best place to do so:
- in the CwiseBinaryOp xpr itself?
- in the operator+ ?

Didn't think too much about it, just wanted to make sure that we don't
overlook that.

Benoit

```

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