lni

26th March 2009, 00:23

Hi,

I have a float array representing an M x N matrix,

array[0, 1, 2, ..., N x M]

I need to do an in-place (or in-situ) transpose so the new float (or double) array become an N x M matrix, as described here: http://en.wikipedia.org/wiki/In-place_matrix_transposition

I am wondering if QTransform::rotate( 90 ) can be used here, and if so, how fast will it be?

I am thinking of this:

float (or double) array[ MxN ]

QImage image ( (const uchar *)array, N, M, QImage::Format_RGB32 )

QTransform xf;

xf.rotate( 90 );

image = image.transformed( xf );

After that, the array will be an NxM matrix?

However, does image.transformed( xf ) perform in-place transpose? My MxN array can be as big as 30 GB in size, if making a new copy of the data, I won't be thinking of QTransform.

There are some C/Fortran codes available, but I really prefer Qt if it can do it...

Thanks.

I have a float array representing an M x N matrix,

array[0, 1, 2, ..., N x M]

I need to do an in-place (or in-situ) transpose so the new float (or double) array become an N x M matrix, as described here: http://en.wikipedia.org/wiki/In-place_matrix_transposition

I am wondering if QTransform::rotate( 90 ) can be used here, and if so, how fast will it be?

I am thinking of this:

float (or double) array[ MxN ]

QImage image ( (const uchar *)array, N, M, QImage::Format_RGB32 )

QTransform xf;

xf.rotate( 90 );

image = image.transformed( xf );

After that, the array will be an NxM matrix?

However, does image.transformed( xf ) perform in-place transpose? My MxN array can be as big as 30 GB in size, if making a new copy of the data, I won't be thinking of QTransform.

There are some C/Fortran codes available, but I really prefer Qt if it can do it...

Thanks.