Boost logo

Ublas :

Subject: Re: [ublas] pointer to matrix structure
From: Philipp Kraus (philipp.kraus_at_[hidden])
Date: 2011-08-07 16:38:26


On 2011-08-07 13:30:33 +0200, Kraus Philipp said:

> Hello,
>
> can I read / get a pointer to the matrix data structure? I need a array
> with the dimensions array[matrix.size2()][matrix.size1()] for calling
> an onther library function. At this time I copy the data to an array,
> but can I use a method of the matrix class to get the data directly?

I have found a solution with this:

        ublas::matrix<T> x = ublas::trans(p_dataset);
        write( &(x.data()[0]), p_datatype, l_dataspace );

but can I change it without the transpose, because p_dataset is a very
large matrix? The write method is a library function that writes my
matrix data, but the write method need a "column oriantated array
structure", but my p_dataset input matrix is a row oriantated matrix.

Thanks

Phil