4.1 v1 Sparse Vector and Matrix Algebra

0 2 3 2 1 1 3 3 4 5 7 9 0 4 2 1 0 3 60 4 7 4 20 2 10

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: 4 2.0 2 10 5 8.0 1 6 3.0 3 7 7.0 4 8 9 10 9.0 10.0 4.0 1 3 4 10 6 1 0 5 2 0 11 12 4 0 3 0 1 2 4 3 2 1 3 4 4 6 9 12 3.0 5.0 1.0 0.0 6.0 0.0 0.0 0.0 0.0 7.0 0.0 12.0 0.0 11.0 25.0 22.0 19.0 0.0 2.0 8.0 1 5.0 0.0 1 11 12 3 4 9.0 0.0 0.0 0.0 17.0 92.0 © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra – Multiplying a Sparse Matrix by a Dense Vector. • A•b=x – A is sparse. – b is dense. – x is dense. • No need to perform symbolic manipulation. • Assume: – A is store in RR(C)U, – The column vector b is store in ordered compact form.. © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra Initialize: IR=0 Clear x(k) from 1 to N IR=IR+1 Set pointer to begin/end of row: IBEG=ERPA(IR-1)+1, IEND=ERPA(IR). Accumulate Inner Product and store in dense x using Inner Product Alg.* * You will want to modify the inner product algorithm to take advantage of b being dense. There is no need to use a switch array since A indices can be used as pointers to locations in b. N IR=N? Y End © Copyright 1999 Daniel Tylavsky Sparse Vector & Matrix Algebra – Multiplying a Sparse Matrix by a Sparse Vector. • A•b=x –...
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