Re: [eigen] Matrix - Scalar CwiseUnaryOps |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Matrix - Scalar CwiseUnaryOps
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Wed, 4 May 2011 09:08:48 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=+jMxbdPJYG84d/OTKq9R5wVtpE3jC9a9UAXvi00Crgs=; b=m34KiUzUtHX7/f3o15LLa0L5YiYq1Hjq5Oiwg+RDdgef7kAEcym3a/lIj9J/5f1wsK 1szeRmx1Pk4CbsalXFqT4daZpPpbw95znNz/Kk3mPrCtDyK9WLNvX8t250RylMo7HqhF 7vnvfIjS3Z5DZ/nOIibf6dfsNQ0WHRScXFWxs=
- 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=PYlVXYnwTgBdPlP+kVmbB0DZt5/cc7MUQG/R2nSWx1YgJXEDbDcvv87Em9avLNvIBI D3romOfpbJt1M4NDwFEybSqpF2PRggkyFHHoQ4mawtNXwr2gWxy36IAYXevmUocPjZKL 3UI1Tkotar8MW1erVmc/7R8tqh/elqt4JSMCg=
What we could have is a method for doing that.
Like, matrix.cwiseSum(scalar)
if we don't have such a thing already.
Benoit
2011/5/4 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> Ok. fine enough. I just thought we could be a bit less strict here but
> I understand your reasoning.
>
> On Wed, May 4, 2011 at 2:55 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>> Yes, the ambiguity is between interpreting a+M as
>> 1) aE+M where E is the matrix all of whose coefficients are 1; this
>> is what we do for arrays; or
>> 2) aI + M where I is the identity matrix; this is definitely what
>> mathematicians mean by a+M whenever they use that notation. This is
>> required if you want basic matrix arithmetic rules to be self
>> consistent, e.g. distributivity: (a+M)*N = aN + M*N
>>
>> This ambiguity is the primary reason why we leave this undefined in Eigen.
>>
>> Benoit
>>
>> 2011/5/4 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>:
>>>
>>> Hi,
>>>
>>> From a mathematical point of view a.M is defined but a+M is not...
>>> (a=scalar, M=Matrix).
>>>
>>> my 2 cents..
>>>
>>> Thomas
>>>
>>> --
>>>
>>> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
>>>
>>> http://www.freehackers.org/thomas
>>>
>>> On Wednesday 04 May 2011 11:39:13 Hauke Heibel wrote:
>>>
>>>> Hi,
>>>
>>>>
>>>
>>>> I know that we have the array functionality for those operations but I
>>>
>>>> wonder whether we should enable +/- operations between matrices and
>>>
>>>> scalars.
>>>
>>>>
>>>
>>>> We already have * and / and thus I think it might make sense. It's
>>>
>>>> just for convenience and I have met quite a few occasions where this
>>>
>>>> feature would lead to shorter code. What do you think?
>>>
>>>>
>>>
>>>> - Hauke
>>>
>>>>
>>>
>>>>
>>>
>>>>
>>>
>>
>>
>>
>
>
>