Re: [eigen] Sparse API

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


2009/2/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>:
> mat.insert(i,j, value);
>
> the drawback is that makes difficult to remember the order of the
> arguments, i.e., do I have to write mat.insert(value, i, j) or
> mat.insert(i,j,value) ?? I have myself the same "problem" with
> setConstant(). Any idea, suggestion regarding this part of the sparse
> API ? Other possible changes include:

Have you thought of having a fill() returning a proxy having an
operator= so you can do:

mat.fill(i,j) = value;

? (maybe under a different name then... typically you'd call that
coefficient(), always prefer calling a function by the
name-of-what-it-returns rather than the verb-describing-what-it-does.)

One might even consider having operator() do that but then if you want
read access too with operator() it's tricky, i guess you need a
conversion operator from this proxy type to Scalar, not sure if that's
doable.

Cheers,
Benoit



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