Boost logo

Boost :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2002-07-15 09:00:03

On Monday 15 July 2002 15:16, David Abrahams wrote:
> From: "Toon Knapen" <toon.knapen_at_[hidden]>
> Shorter notation (as being discussed currently):
> Temp(range(0, last-start), range::all() ) .assign (
> prod( herm(WW(range::all(), range(start, last))),
> V(range(WW.size1(),VV.size1()), range::all()))
> + prod( herm(Hessenberg(range(start, next), range(start, last))),
> prod( herm(WW(range::all(), range(start, next))), V(range(0, WW.size1()),
> range::all()))
> ) );
> [dwa] You might consider including a constant called "_" which stands in
> for range::all().
Probably this is too short. In that case, two underscores would be better.

> Personally, it's still all Greeek to me ;-)
well, this is a real-life example not some textbook example. That's also the
reason that I'm bringing it up, it's important too look how ublas is used in
real-life LA codes.
Feel free to suggest some other/more syntax simplifications ?

> Why is an .assign() member function being used instead of operator= ?
> I thought uBlas had expression templates!?

AFAIK, the assign assumes that there's no aliasing between lhs and rhs.
Otherwise the rhs will first be stored in a temporary.

Boost list run by bdawes at, gregod at, cpdaniel at, john at