Aydin_CSC11_Indexing

R sparse1lengthii1lengthisizea1 q

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6 PAPT 6 Area B •  Per ­area analysis on power grids •  Subrou4ne for recursive algorithms on graphs 7 5 Sequen4al algorithms function B = spref(A,I,J) ! R = sparse(1:length(I),I,1,length(I),size(A,1)); ! Q = sparse(J,1:length(J),1,size(A,2),length(J)); ! B = R*A*Q;! Tspref = flops( R ! A) + flops( RA ! Q ) = nnz( R ! A) + nnz( RA ! Q ) = O(nnz( A)) function C = spasgn(A,I,J,B) ! [ma,na] = size(A);! [mb,nb] = size(B);! R = sparse(I,1:mb,1,ma,mb);! Q = sparse(1:nb,J,1,nb,na);! S = sparse(I,I,1,ma,ma);! T = spars...
View Full Document

Ask a homework question - tutors are online