10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

A containing less than nz nonzero elements, the corresponding<br />

row in array KA is padded with any values from 1 to n. Because<br />

this array is used by the ESSL subroutines to access other target<br />

vectors in the computation, you must adhere to these required<br />

values to avoid errors.<br />

Consider the following as an example of a 6 by 6 sparse matrix A with a<br />

maximum of four nonzero elements in each row. It shows how matrix<br />

A can be stored in arrays AC and KA.<br />

Given the following matrix A:<br />

┌ ┐<br />

| 11 0 13 0 0 0 |<br />

| 21 22 0 24 0 0 |<br />

| 0 32 33 0 35 0 |<br />

| 0 0 43 44 0 46 |<br />

| 51 0 0 54 55 0 |<br />

| 61 62 0 0 65 66 |<br />

└ ┘<br />

the arrays are:<br />

┌ ┐<br />

| 11 13 0 0 |<br />

| 22 21 24 0 |<br />

AC = | 33 32 35 0 |<br />

| 44 43 46 0 |<br />

| 55 51 54 0 |<br />

| 66 61 62 65 |<br />

└ ┘<br />

┌ ┐<br />

| 1 3 * * |<br />

| 2 1 4 * |<br />

KA = | 3 2 5 * |<br />

| 4 3 6 * |<br />

| 5 1 4 * |<br />

| 6 1 2 5 |<br />

└ ┘<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 127 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!