Re: [eigen] Proposal: add M.fill(y) as a synonym for M.setConstant(y)

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


And looking a bit more, there is also setOnes and setRandom which should be consistent as well.  I don't know about setIdentity though, fillIdentity seems weird to me.  Just some thoughts.

On Sat, Jan 24, 2009 at 8:05 AM, Ricard Marxer Piñón <email@xxxxxxxxxxxxxxxx> wrote:
Oh, sorry I didn't see that you were proposing it as a synonym. My new question is should there also be then the synonym fillZero() or fillZeros()?


On Sat, Jan 24, 2009 at 8:03 AM, Ricard Marxer Piñón <email@xxxxxxxxxxxxxxxx> wrote:
Would then .setZero() change to fillZero() (of filZeros()) or stay the same ?

I just think these two methods do the same and should be called similary.

ricard


On Fri, Jan 23, 2009 at 11:44 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
+1 from me, waiting for Gael approval...

Btw Gael if you're ever looking for a job in Toronto, since today you
gave good chances. I made you sound like some sort of guru of cache
friendliness...

Benoit

2009/1/23 Keir Mierle <mierle@xxxxxxxxx>:
> I find the notation M.setConstant() odd, because in for example
> double y = ... something not constant.
> MatrixXd M = ...
> M.setConstant(y)  // <--- y is not a constant!
> I propose adding an alternate method:
> M.fill(y)
> It doesn't overload the meaning of constant, is shorter, and has obvious
> intent.
> Thoughts?
> Keir





--
ricard
http://www.ricardmarxer.com
http://www.caligraft.com



--
ricard
http://www.ricardmarxer..com
http://www.caligraft.com



--
ricard
http://www.ricardmarxer.com
http://www.caligraft.com


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