Borrar filtros
Borrar filtros

Sparse vector transpose is slow

2 visualizaciones (últimos 30 días)
Superfish
Superfish el 8 de Feb. de 2012
I'm performing the operation
X = [X; x']
in my MATLAB code. x is a very large and very sparse vector which is created as a column vector
x = sparse(nonZeroRows, 1, vals, vectorLength, 1);
The problem is that taking the transpose x' is VERY slow. Also, creating x' directly through
xT = sparse(1, nonZeroRows, vals, 1, vectorLength);
is also very slow.
How can I perform this operation efficiently?
  1 comentario
Walter Roberson
Walter Roberson el 8 de Feb. de 2012
I am not surprised at it being slow; sparse vectors are organized by columns (I think it was), one header per column used, so when you transpose to a row it has to create headers for each of those rows.
I do not know what (if anything) can be done to improve the situation.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Sparse Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by