Boost logo

Ublas :

From: christopher diggins (cdiggins_at_[hidden])
Date: 2005-06-01 11:20:04

----- Original Message -----
From: "Karl Meerbergen" <Karl.Meerbergen_at_[hidden]>
To: "ublas mailing list" <ublas_at_[hidden]>
Sent: Wednesday, June 01, 2005 10:29 AM
Subject: Re: [ublas] Performance concerns

> Stefan,
> I have the impression that the ublas::vector has size 0 since you use the
> default constructor.
> I also think that vector::operator+=() creates a temporary to store the
> data from the right-hand side. The right-hand side can be any
> vector_expression. In order to avoid temporaries you could use
> tmp.plus_assign( v ) and tmp.minus_assign( v ).
> If this is the case, this might explain some loss of performance in
> Christopher's tests.
> Best,
> Karl

That would definitely explain it and would be consistent the differences are
so great between my old Celeron and Stefan's Pentium 4 which have wildly
different sized caches. However, the question then become why would the
operators be implemented so naively?

On a related subject, is the fastest way to multiply two matricies as

X = prod(A,B);


Thanks for your help.

Christopher Diggins