Re: [eigen] "plain": a new keyword for auto with implicit evaluation

[ Thread Index | Date Index | More Archives ]

On Mon, Feb 18, 2019 at 10:28 AM Wood, Tobias <tobias.wood@xxxxxxxxx> wrote:

> I was thinking about:


> Matrix M = ...;

> SparseMatrix S = ...;

> Array A = ...;


> with "..." any compatible expressions.. Those would also be welcome alternatives to "auto" when you know that you are dealing with dense matrices only or sparse matrices only, whereas "plain" is more general and could even wrap scalars for generic array/scalar functions.


I think I like this idea over “plain” - but I think they are mutually compatible, i.e. you could have both?

yes of course.

Generally I know whether I am working with Matrix or Array (see the other discussion thread about dot/star), and this would be a very neat way to indicate when I want an _expression_ (use auto) or store the result (use Matrix/Array etc.). So a +1 from me.

For Matrix vs Array, yes. But in very generic code you might want to handle both scalar and Array, or in some other functions get a Matrix or SparseMatrix or a DiagonalMatrix ... Those are rare cases though.

I am not sure “plain” is the right word to use though. “result”, “stored”, or even “eval” would be clearer, in my opinion. Why the result of an Eigen _expression_ would be “plain” is not clear to me. Note I’m not criticising the concept here, only the specific English word to use.

sure, I just need a name to expose the idea. maybe something with "auto" in the name would help to convey the intention.





Mail converted by MHonArc 2.6.19+