What you need to know to use these subprograms

val( ), a single array pntr( ) of length k+1 can be used instead of pntrb( ) and pntre( ) by having pntrb(i) = pntr(i) and pntr(i) = pntr(i+1).

The matrix in Table 4-4 could be represented in CSC format as:

Table 4-5 CSC Format Matrix

val=

11

21

31

41

22

13

33

44

15

35

45

indx=

1

2

3

4

2

1

3

4

1

3

4

pntrb=

1

5

6

8

9

 

 

 

 

 

 

pntre=

5

6

8

9

12

 

 

 

 

 

 

Optionally, a single array pntrb( ) (instead of pntrb( ) and pntre( )) could be used:

pntr=

1

5

6

8

9

12

MSC - Modified sparse column. The MSC format is a variation of the CSC format obtained by storing the main diagonal of the matrix in a specific array. Given a sparse m-by-kmatrix A with nnz nonzero entries, the MSC representation requires five arrays:

diag(*) - Scalar array of length d containing the main diagonal of A, where d=min( m, k) is the number of elements in the main diagonal.

val(*) - Scalar array of length max(nnz-d,pntre(k)-1)containing the nonzero matrix entries that do not belong to the main diagonal.

indx(*) - Integer array of length max(nnz, pntre(k)-1)containing row indices such that indx(i) corresponds to the row index of val(i).

pntrb(*) - Integer array of length k such that pntrb(j) points to location in val( ) of the first nonzero element in column j.

pntre(*) - Integer array of length k such that pntre(j)-1points to location in val( ) of the last nonzero element in column j.

The matrix in Table 4-4 could be represented in MSC format as:

Table 4-6 MSC Format Matrix

diag=

11

22

33

44

 

 

 

val=

21

31

41

13

15

35

45

indx=

2

3

4

1

1

3

4

pntrb=

1

4

4

5

5

 

 

pntre=

4

4

5

5

8

 

 

426HP MLIB User’s Guide