How to get an iterator in boost :: numeric :: ublas :: matrix <T> line?

I am working on matrix multiplication and I would like an iterator one row at a time to increment the matrix? It can be done?

Currently I have to get the iterator and advance it. Seems like too much CPU work / not optimized ...

boost::numeric::ublas::matrix<T> aMatrix(2048, 4096);
typename boost::numeric::ublas::unbounded_array<T>::iterator it;
it =;
offset = row * aMatrix.size2();
advance(it, offset);



source to share

1 answer

Eureka! Matrix proxies ...

boost::numeric::ublas::matrix_row<boost::numeric::ublas::matrix<T> > aRow(aMatrix, row);




All Articles