Boost logo

Boost :

From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-06-29 07:23:54


----- Original Message -----
From: "Peter Schmitteckert (boost)" <boost_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, June 28, 2002 10:06 AM
Subject: Re: [boost] uBLAS formal review

> Salut,
>
> On Thursday 27 June 2002 22:54, Joerg Walter wrote:
> > These member functions have been added recently and should be documented
at
> > least in the 'Interface' section. We'll document them fully later.
>
> Nice, thank you.
>
> > > 2) I still think that swapping of matrices of different sizes should
be
> > > allowed. In my opinion it would be fine if matrix_ranges or slices
> > > of a swapped matrix are just undefined.
> >
> > I'm unsure, whether it's worth it to relax the size conformance checks
> > right in this case. I'd like to hear other opinions.
>
> I've remoced the checks in my ublas version without problems.
> I just want don't want to pay for the extra copy after calculating
> a matrix product, e.g. with P rectangular
>
> A = P * QM;C = ... Q; Q= A; can be discarded now; return;
>
> so I calculate
>
> A = P * QM;C = ... Q; Q.swap(A); A can be discarded now; return;
>
> Is there a better way to do this within ublas without using swap ?

I don't know one ;-(, there is another way (Q.reset (A)), but it seems a
worse way in this case. I'm convinced, if no one objects, we'll relax the
precondition for swap.

> Of course, I can use pointers of matrices, e.g. smart pointers, but that's
> unnecessary complicated. ( BTW, that the way I currently handle my
> matrix_range problem mentioned before. I have to switch to .reset(..)
now.)

Regards

Joerg


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk