|Re: [eigen] still the solve() API debate|
[ Thread 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:54:02 -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=dTpDGAeuCWmb/E+hOEOPOOr0Pc5yFcnMTUAgqW5nPjs=; b=uiaTT0FFyIjKyBlwvDjckQKr7aHsQ6x0eOiaS/A81hXcGSa+BhFjKFjsTd+NgUi8jb ANqWV87y19JPXaNLOQfANEQgsX3Y1pb7UHrlNFn5r7pSG0cSM8KCI+MzGx+YkpcYOUX/ O55gxWbZRy8vY0JL0G3yg/kTJt3oLacoK+KgE=
- 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=dbHwxc9UMNvx1KAKCjzxUM4K7B5OL68P55ATx2Lvcrv8A+IDEkEWX5rjsFZR/wdRSl lApF/gkv+IT/5iEgeHiXlQU8yY7eq2QsEjeqSN2BwDl6AoiXp+LJqzWZgZBx2QqZA/gC OYUzHyKuwg85dJ8ZNfKDlS82uEw1GhqT4InHs=
2009/9/11 Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>:
> On Fri, Sep 11, 2009 at 3:36 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>> Ok, I just caught up with re-reading... that's indeed ugly. But as you
>>> guys already observed, in new compiler versions we already have rvalue
>>> references. Benoit, what about your idea of passing Matrices by
>>> reference and MatrixBase by value? You suggested to do that in the
>>> "MatrixBase::swap - why const" thread? This approach would allow an
>>> easy transition towards rvalues references in the future.
>> That would be perfect, if you figure it out.
> Great, now I am confused again - just while thinking about it. :)
> Why not simply define swap as
> template <typename OtherDerived>
> void swap(MatrixBase<OtherDerived> m);
> I mean in any case. It does not really matter whether a matrix is
> passed or not - what we will copy is always only MatrixBase and that's
> tiny, right?
It can't be that simple: indeed MatrixBase is empty, it doesn't have
data members. If things could work like this, then when copying the
MatrixBase object we wouldn't copy any information, hence the matrix
"m" would be completely forgotten.
That said you raise my curiosity, i almost want to try a small program
to see what happens (but in any case that can't work!) too bad i must
prepare a lecture now.