Matrix multiplication performance

palik imre <[email protected]>
Newsgroups gmane.comp.lib.boost.ublas
Message-ID <[email protected]>
Hi all,

It seems that the matrix multiplication in ublas ends up with the trivial algorithm.  On my machine, even the following function outperforms it for square matrices bigger than 173*173 (by a huge margin for matrices bigger than 190*190), while not performing considerably worse for smaller matrices:

matrix<double>
matmul_byrow(const matrix<double> &lhs, const matrix<double> &rhs)
{
  assert(lhs.size2() == rhs.size1());
  matrix<double> rv(lhs.size1(), rhs.size2());
  matrix<double> r = trans(rhs);
  for (unsigned c = 0; c < rhs.size2(); c++)
    {
      matrix_column<matrix<double> > out(rv, c);
      matrix_row<matrix<double> > in(r, c);
      out = prod(lhs, in);
    }
  return rv;
}


Is there anybody working on improving the matrix multiplication performance?

If not, then I can try to find some spare cycles ...

Cheers,

Imre Palik
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.