4.1 v1 Sparse Vector and Matrix Algebra

Abx a is sparse b is sparse x is sparse if x is stored

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: A is sparse. – b is sparse. – x is sparse? • If x is stored as a sparse vector: – Perform symbolic manipulation. • If x is stored as a dense vector: – No need to perform symbolic manipulation. • Assume: – A and b are store in RR(C)U and CR(C)U, respectively. © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra If b is sparse, perform symbolic program segment to get CRO/U. If b is dense, assume b is stored in ordered compact form. Initialize: Switch=0, IR=0 Clear x(k) IR=IR+1 Set pointer to begin/end or row: IBEG=ERPA(IR-1)+1, IEND=ERPA(IR). Accumulate Inner Product and store in sparse x using Inner Product Alg. N IR=N? Y End The End © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra – Teams: Use the expanded accumulator technique to add the follow sparse vectors stored in unordered compact form. Pos: R1Indx(k): A1(k): R2Indx(k): A2(k): 0 1 1 1.0 2 3 2.0 3 4 3.0 4 8 4.0 5 6 5.0 2 6.0 3 7.0 4 8.0 7 6 9.0 10.0 6 0 7 0 8 0 9 0 10 0 11 0 12 0 © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra – Teams: Use the expanded pointer technique to add the follow sparse vectors stored in unordered compact form. • Step 1: Merge Row Indices – {1,3,4,8,6,2,7} Pos: R1Indx(k): A1(k): R2Indx(k): A2(k): 0 1 1 1.0 2 3 2.0 3 4 3.0 4 8 4.0 5 6 5.0 2 6.0 3 7.0 4 8.0 7 6 9.0 10.0 6 0 7 0 8 0 9 0 10 0 11 0 12 0...
View Full Document

This note was uploaded on 12/05/2012 for the course EEE 571 taught by Professor Tylavsky during the Spring '12 term at ASU.

Ask a homework question - tutors are online