필터 지우기
필터 지우기

Sparse vector transpose is slow

조회 수: 2 (최근 30일)
Superfish
Superfish 2012년 2월 8일
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
Walter Roberson
Walter Roberson 2012년 2월 8일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by