Boost logo

Boost :

From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-07-01 23:12:30


----- Original Message -----
From: "David Abrahams" <david.abrahams_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, July 01, 2002 3:28 PM
Subject: Re: [boost] Re: uBLAS and expression templates

>
> ----- Original Message -----
> From: "Joerg Walter" <jhr.walter_at_[hidden]>
>
> > A couple of questions remain open:
> > - Should we rename the original ET' based prod() functions to something
> like
> > defer_prod()? - Is it possible to determine a sensible default for the
> type
> > of the temporary (for example via some traits classes)?
>
> I'm not familiar enough with the implementation of uBlas to understand
> what's happening here. However, I think I proved in my recent posting that
> no temporaries are neccessary, and that you might want to *consider* using
> them for A*(B*v) to reduce the number of writes. It wasn't clear to me
> how/whether you were responding to that post, though...

I think, I've understood, that you propose to evaluate A * (B * v) via

       r.clear ();
        for (unsigned j = 0; j < r.size (); ++ j)
            r.plus_assign (column (A, j) * prod (B, v) (j));

May be we even could defer the loop evaluation via some lambda construct.
I've two problems with this approach: I'm not sure if the results of the
different evaluation path couldn't surprise a client of ublas. And I
currently don't know, how this optimization generalizes to matrix chain
multiplication and other expressions.

Regards

Joerg


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