Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-04-20 04:53:56

On Thursday 20 April 2006 10:00, Andreas Dolfen wrote:
> Hi,
> I just ported my code from boost 1.30.2 to boost 1.33.1. As far as ublas
> is concerned I only changed the calls to the matrix operator[], which I
> used for getting access to elements M[x][y], to the operator(x,y).
> Now my compiled program is about a factor of 1.35 slower than with boost
> 1.30.2 in a part where I make extensive use of operator(x,y).

What type of matrices do you use? Did you try the current CVS-Head of ublas,
too? Do you use the const version of operator(i,j) wherever possible?

The operator[i] of a matrix returns an instance of the matrix_row proxy. The
operator(i,j) directly addresses single elements. You can have the old
behavior if you define


> I don't know if this is due to the operator(x,y) or to a general
> performance decrease in ublas.

We are not aware of a general performance decrease. Could you provide a simple
test case that shows this effect?