0% found this document useful (0 votes)
4 views1 page

Sparse Matrix Transpose Algorithm

The document outlines a procedure for transposing a sparse matrix. It initializes a new matrix 'b' based on the dimensions of the original matrix 'a' and iterates through the columns to populate 'b' with transposed values. The algorithm effectively swaps rows and columns while maintaining the non-zero values of the sparse matrix.

Uploaded by

gopikajitesh.lbs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Sparse Matrix Transpose Algorithm

The document outlines a procedure for transposing a sparse matrix. It initializes a new matrix 'b' based on the dimensions of the original matrix 'a' and iterates through the columns to populate 'b' with transposed values. The algorithm effectively swaps rows and columns while maintaining the non-zero values of the sparse matrix.

Uploaded by

gopikajitesh.lbs
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SPARSE TRANSPOSE

[Link] i, j, x, n, a[][], b[][]


2.n=a[0].value
3.b[0].row=a[0].col
4.b[0].col=a[0].row
5.b[0].value=n
7.x=1
[Link]( i=0 ; i<a[0].col ; i++ )
9. for( j=0 ; j<=n ; j++ )
10. if(a[j].col==i)
11. b[x].row= a[j].col
12. b[x].col= a[j].row
13 b[x].value=a[j].value
14. x++

You might also like