Kresimir Fresl wrote:
Thomas Willhalm wrote:
I'm new to ublas, so it's easily possible that I overlooked something obvious. The first thing I tried to calculate was the following line:
numerics::matrix<double> M(dimension,n); numerics::matrix<double> Covariance = numerics::prod(M,numerics::trans(M))/n;
where dimension is 50 and n is 8000.
Unfortunately. it turned out that the following "stupid" code actually performs better:
numerics::matrix<double> Covariance(dimension,dimension); for (int i=0; i
What am I doing wrong?
I'm using gcc 2.95.3 under Linux 2.4.18 on a mobile Pentium III, if it matters.
First of all, it seems that you have fairly old version of ublas. New version is in namespace `boost::numeric::ublas'. But I don't think that this influences the performance ;o)
Seems like the reason is that I have an old version of gcc: 2.95.3 doesn't check the namespaces...
You must define NDEBUG. Otherwise expression templates are not enabled.
That's it, thank you very much! Without -DNDEBUG I had: ublas 5.28 loop 1.33 Now, it's: ublas 0.58 loop 0.94 (Upgrading ublas didn't change much, but the version I had was only some weeks old.) Thanks again Thomas