Boost logo

Ublas :

Subject: Re: [ublas] efficient way to convert a matrix to col major order
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-08-08 11:56:11

Am 08.08.2011 um 13:26 schrieb Umut Tabak:

>> Hi Umut,
>> I'm using the copy-constructor to change the order of the matrix, but I run into a memory problem, because I use very large matrices with around 10^6 - 10^9 (in some cases 10^12) non-zero elements, so with the copy constructor I duplicate the matrix data. I need only an iterator or something else for a column-major access without duplicating
>> Phil
>> _______________________________________________
>> ublas mailing list
>> ublas_at_[hidden]
>> Sent to: u.tabak_at_[hidden]
> So you initialize the matrix A_csc which is column-major with a row-major matrix B_csr, is that the case? So the copy ctor is called, if this is the case, I tested this and this takes too much time on a matrix on the order of 100K. I am confused a bit... Can you confirm this?

I do this:

ublas::matrix<T, ublas::column_major> l_matrix(p_matrix);

with p_matrix is ublas::row_major and working with the l_matrix object. In my code I need most times the ublas::row_major structure but some calls must be a ublas::column_major