Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2006-08-22 04:42:59


On Aug 21, 2006, at 8:38 AM, Andy Little wrote:

>
> "Matthias Troyer" <troyer_at_[hidden]> wrote
>
> <...>
>
>>> The above creates a lot of temporaries of course.
>>
>> Why? Using expression templates there will be absolutely no
>> temporaries.
>
> In my experiments with E.T, I found that it only became
> advantageous when use
> with (say) a vector of more than 4 elements. Before that it seemed
> to create
> more temporaries than eager evaluation. I seem to remember someone
> else backing
> this up somewhere too.

That's strange since there should be no temporaries at all. The only
thing to keep in mind is that in short loops over only 3 or 4
elements the time often gets dominated by the control structure of
the loop and the inability to fill pipelines efficiently. Using small
fixed-size data structures, such as the TinyVector in Blitz++
completely remedies that problem, and Dave's matrix library will take
care of this as well. You still have not shown any reason why a
special purpose matrix and vector library in Quan would be needed or
useful.

Matthias


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