Re: [eigen] cwise / array

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


On Thursday 03 July 2008 11:04:55 Gael Guennebaud wrote:
> hm... I don't really like the "from" which could likely be interpreted
> as a "set from". What about apply*()  or maybe just unary(), binary()
> ? or even unaryExpr(), binaryExpr() ??
> (I like the latter ones with "Expr")

good idea.

>
> > * rename create(functor) to fromNullary(functor)
>
> this one a static member. BTW, what about naming static members with a
> upper case for the first letter: MyMatrix::Random(), MyMatrix::Zero(),
> etc. My point is that currently you can write:
> Matrix3f a, b;
> b = a.zero();
> this would work but it not clear what you're really doing especially with:
> b = a.fromNullary(functor);
> With an upper case:
> b = a.Zero();
> it is immedialtely clear that you're doing something insane.

good idea.

> I know 
> this is a quite common coding rule though Qt does not use it (don't
> known about KDE). Moreover it works pretty well here because then you
> would write Matrix3f::Zero() which might give you the feeling that
> Matrix3f::Zero is a nested struct, that is wrong, but pretty close to
> what actually does Zero(), i.e., creating a "zero" expression.

ok, I agree.

>
> about fromNullary(functor), again it could be simply ::nullary(),
>
> ::Nullary(), ::nullaryExpr() or ::NullaryExpr()  ....

ok

> excellent, I have to say that writing .abs2() sounded a bit strange to
> me while what I wanted is really a cwise square !

ok, seems like we're on the same wavelength.

Cheers,
Benoit

Attachment: signature.asc
Description: This is a digitally signed message part.



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