Re: [eigen] still the solve() API debate |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] still the solve() API debate
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 11 Sep 2009 10:49:40 -0400
- 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=ARt3pRLXSrJjQkTUOARJ4FKZfGS8YeDjnqUme5pR+Ko=; b=PXrJq0KpCTacS7oEFlj6QsZAIE/mc0AbE44i3h9fIsdCyFqZS/8XNCAWErK7ULIT+S yBDat9VdoG+aDaLoOgdp+NquCOFVoaRZipRuPLapWcBRBI7gCkKqZjNDes802je7IjBR f/xszY8Dw9E0GdOrf5P6MHWF7aU9pFXa/1Wc8=
- 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=aQ6JCmszkwR6rpW82806vsulYEkIm+Htad2hkW7dTrjs7qRMnUXaNSauzH9yoGILb2 jHOPHIUuOYrCkeIPBDLCKHFq41hSkP6ZuxxH/tp5yWNNnMwfz0YR63dbdRiUMSaBlXzH 0Y6vmFwxZ3Lw/l7Jej2P1a+f1XwAgbgJoh9oA=
2009/9/11 Robert Bocquier <robert.bocquier@xxxxxxxxxxx>:
> Well, I don't fully understand this thread, so may be I will say something
> stupid, but I found these "asymmetric" writing of swap pretty unreadable.
Nevermind, we're not going to use them anyway :)
> Why is this impossible ?
> Eigen::swap(matrix.row(i), matrix.row(j));
Same reason as above: one can't pass matrix.row(i) as non-constant
reference (because it is a temporary) so one must pass it as constant
reference, and then constness can't be honored. So this is possible
but has the same drawback as the current implementation, actually it's
a bit worse even because it forgets constness of both sides instead of
just the right-hand side.
Actually my first proposal,
matrix.row(i) = Eigen::swap(matrix.row(j));
doesn't work either.
So my only potential proposal was:
matrix.row(i) = matrix.row(j).swap();
and you're already 2 persons to reject it, so let's forget about it :)
Benoit