Re: [eigen] Array as the Scalar type |

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

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] Array as the Scalar type*From*: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>*Date*: Sat, 8 May 2010 10:18:57 +0200*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=tCvIzh90DdMU0qd+pJ3ss7EFvf1h02QJg5JqbU9AeKc=; b=Q6UfyxaipN8sBWr+9czJT7zWiWOgWGA8uoogJanbZtWhZcz8LElG1r4B/EFI4LlBSl P+/bDpkEJwzPXaM7oL4W60YYgvV8y8YDE69EbKkC7riD/my16mOO1kMSbMcm434eHs1J nDWH4t1+lOqNXmTgpMoKtY6H7N1r44SDH4snI=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=Tb7S2KjhbeYa9nflr9A2yStJdkiXPNXWlBzjE6xBtDuXGQSIydl3Sff605vJ5fnozx 3IqiQL8gh8TeZUNc7NI+ocmIRg1Mu2sgK8TN1fUOTZhEw9MQX4jAH2Kwj9pPq/zWws4/ mOFqrshxum7jJS73W/E2SDuBJ6++531kMoHDw=

well if you think this can be supported without adding too much complexity, then let's go for it. Note that ideally we should also be able to do the same for any scalar types supporting expr. templates (e.g., autodiff types, multi-precision types, etc.).

It seems to me that this would require to adjust the functors to export a proper scalar type, and a new mechanism to get the "eval scalar type".

Btw, now I remember that a very very long time ago, I managed to get matrix<matrix<> > working with expr template, but it was on a alpha version of eigen 2, and I lost that piece of code (HD death) :(

gael

On Fri, May 7, 2010 at 10:18 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:

Hi,

Mostly a question to Gael:

We wanted to enable support for Array as the scalar type, i.e.

Matrix<ArrayType, ...>.

But all our design is based on the assumption that it's OK to return

Scalars by value. E.g. the coeff() const methods in rvalue expressions

all return a Scalar by value.

So? Are we saying that using Array as Scalar type only is efficient

when the Array is small enough to fit entirely in registers? Should we

then discourage using large Array types as Scalar ? Note that would be

a bit disappointing as it would be the end of our "horizontal

vectorization" dreams.

Or do you want us to refactor Eigen so that we support _expression_

templates for the Scalar type?

In my rework of MathFunctions.h i have made sure to allow supporting

_expression_ templates for the Scalar type, and have implemented that

for Array expressions, but if it's the only part of Eigen that does

that, it makes no sense! Should I drop xpr template Scalar support,

which would simplify MathFunctions.h quite a bit (e.g. no need for

SFINAE anymore).

Benoit

**Follow-Ups**:**Re: [eigen] Array as the Scalar type***From:*Benoit Jacob

**References**:**[eigen] Array as the Scalar type***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**[eigen] Array as the Scalar type** - Next by Date:
**Re: [eigen] Array as the Scalar type** - Previous by thread:
**[eigen] Array as the Scalar type** - Next by thread:
**Re: [eigen] Array as the Scalar type**

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