|Re: [eigen] inconsistent cwise() support|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] inconsistent cwise() support
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Wed, 18 Nov 2009 15:55:44 +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; bh=a+zFGj9thWrBmaglsgoPAUlfX4Ynqb3VDcFDJhUS25o=; b=VTW6k2NRFFgL4glJOC1lDYUTGEdm2Qvhl+oSJkvkqvB7ECuyPUxdghVSXUefrj+HDy 9opvqYCszOK8971LNQRgWxL6hEthqD/l4uhcTlMxhQ683EM71Jn2LSd2sSfMOC4KkWbr nRcdOjumAOuAkVX4xI/BKgfMxW6MpJ/ms6Ifs=
- 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; b=F7acLUgZoP/vvJ7rwE8G22pyvLfznvV7vkd4pBVcbROfbCHV3nJwhM8+Vzh9ebbnJ4 DZ4amV8esTKPLQf0AzksE2nDDQbgFbSJKNFZyyZcTH8Rlramjb+pq9L2TQRMqzb89PEz 5+cKj0fDBBxBvU8P+fKdQZfByEBzhfNjqtgPQ=
On Wed, Nov 18, 2009 at 3:50 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
>> > Yes that's what I was going to reply: I like Jitse's proposal too butOh, I hadn't understood that was the question.
>> > we really don't have to provide .cwiseEverything(), only the most
>> > common functions,
>> > matrix.cwiseProduct(matrix2)
>> > matrix.cwiseSum(scalar)
>> > matrix.cwiseAbs()
>> > matrix.cwiseAbs2()
>> Also I wonder. If matrix.cwiseAbs() is a synonym for
>> matrix.array().abs(), perhaps we should call that matrix.arrayAbs()?
>> In other words, s/cwise/array/g ? To have only 1 terminology everywhere.
> Well, the first question is whether we still want a .array() method or not?
Do you really think that we can do without? First it would require us
to add a ton of cwise...() functions that will not often be used
(what's the use for cwiseCos() when we have a true Array class?), and
even then, we still wouldn't have all the power that .array()
provides, e.g. think of user-defined functions taking an Array...
ok, so at the end we would have my proposal + a couple of shortcuts covering the basic needs of linear algebra. Remark that m.cwiseAbs() / m.arrayAbs() returns a matrix _expression_ while m.arrayAbs() returns an array. So perhaps it is better to keep cwise for the shortcuts.