|Re: [eigen] vector-cwise operator +=/-=|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] vector-cwise operator +=/-=
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Wed, 16 Dec 2009 12:42:46 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4jTmLaXh8dO6LnwwjcCpeH5LVodc/EKzUlSztTG0RiM=; b=yDGjLFuWicb80zYy5IZy3dZ2YEaPnQtdYK4RXoxqg7LuqpYIUoM7v5RPtjxkJn+qVP 6MdrpO4slJJqKXKyp6lkAAowbZl4bWWdG6SyWKSsr/3MB8JxhZ7rdsH4s1UXkc7VlBWH 5a5pAvUZre6GOfxkkLM1bfsgDwK1zO4hhrWFI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=YauLYfOoLdCAJGdS9bvl+fnfVCjrv3aExlnZfsnfgp9ctO7PvzYzPMFN5U63eD/++q gFSuUwfAUylShHwXdwLmSA2YA5IKIsKwORufzbh6ELsBt7EtITrLC+htBb8hi9193kn1 wAP7gdAeOji4t4/Qx4GOTL+tDwXc2CzChipv8=
On Wed, Dec 16, 2009 at 10:44 AM, Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
Regarding the convenience I would say 'yes, it's more convenient'. In particular in presence of my previous question - it is (*cough* at least for me) not intuitively clear to the user that the multiplication as proposed by you is equally efficient.
let's see what others think. Maybe a compromise would be to allow automatic transpose for operators += and -= (to be consistent with operator=) but not for non assigning operators (+, -, cwise*, cwiseMin, cwiseMax, etc.).
Ok, I see now in which way my change is affecting all cwise operators even the non-assigning ones and I agree that this is probably not really desired. So, in order to allow the vector-wise assignment one probably needs to specialize operator+=/-= for vector types.