Re: [eigen] Proposal: add M.fill(y) as a synonym for M.setConstant(y) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Proposal: add M.fill(y) as a synonym for M.setConstant(y)
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Sat, 24 Jan 2009 09:26:02 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wARpwytHjobhp+QJAPTuwLnisyijz4/93IV4IvHhRZ8=; b=prmoGtH5crLqkAyqJ1G1zfQnS4foVMjM3yekYGnZI1cBozJXS1GgZ7f6dYAwaae1U5 Ha6ATZpZkvuYKNxlin8i7ESqw8UDsFEMOC/ebaVl5fvV+njuqAKBpvw4QrHntvkWnEzD NzQSzJgPuBnDyOS/C9ZkNlFkBFRuelLaTCRbs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=k8lTJGYJL+BYhBjMN3i5rgtl+4lZcbGMM4froX/SGnwKAqpllWsqIdbfj1xWzBk+/0 r0vK6s9piEDzwdSgzFep0Ti8stMfcIWUSzHqK06qbGdyN/FeJ1sDB0cbYmJiJDSER04d hgIU0rS6P+FzBLaChithwbb0B9VERZG0Timgo=
just let me recall for everybody that actually m.setConstant(y) is an
alias for: m = MatrixType::Constant(y); whence the name setConstant
which is also consistent with all other set*() functions.
Said that I'm ok to add .fill(y) as an alias, it is indeed probably
easier to find. But no fillZero() or whatever else, having fill(y) is
enough since this already makes fill(0) a "fill" based alias for
setZero()...
On Sat, Jan 24, 2009 at 8:12 AM, Ricard Marxer Piñón
<email@xxxxxxxxxxxxxxxx> wrote:
> 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
>