The star denotes an unused location. Notice that , indicating

that the last row is a zero row, once the diagonal element has been removed.

Diagonally structured matrices are matrices whose nonzero elements are located

along a small number of diagonals. These diagonals can be stored in a rectangular ar-

ray , where is the number of diagonals. The offsets of each of the

!¦¤¨¦¤¢

© © § ¥ £ ¡ ¦

diagonals with respect to the main diagonal must be known. These will be stored in an ar-

… 210 ) " ‚

(4

ray . Thus, the element of the original matrix is located in position

!¦'&%##¡

©§ $ $ "

a`rB

of the array , i.e.,

¦¤¢

¥£¡

C

… 310 () " ‚ ¡ C rCwB ¦¤£¢

4

¥¡

The order in which the diagonals are stored in the columns of is generally unimpor- ¦'¢

¥£¡

tant, though if several more operations are performed with the main diagonal, storing it in

the ¬rst column may be slightly advantageous. Note also that all the diagonals except the

˜

main diagonal have fewer than elements, so there are positions in that will not be ¦¤¢

¥£¡

used.

ud

¤§ ¥ §¢

¡

¡© © ¢ ¡ ¥ ¥ © ¡ ¥

§

¥ T © © §¦

¥

For example, the following matrix which has three diagonals

Y 3444 p

z¢ z p

z z z @8 7

99

7 7

p

9

7 7

¢

z

z£ z zz p¥

p 5 7 7

¤

z A z

7 7 7 7

p

ue‘‘p

7 7 7

will be represented by the two arrays

* 1. 2.

3. 4. 5.

6. 7. 8.

= = -1 0 2 .

¦¤¢

¥£¡ $ ##¡

$"

9. 10. *

11 12. *

A more general scheme which is popular on vector machines is the so-called Ellpack-

9

Itpack format. The assumption in this scheme is that there are at most nonzero elements

!

per row, where is small. Then two rectangular arrays of dimension each are

%

¦

¡

required (one real and one integer). The ¬rst, , is similar to and contains the %£"

$¢ %¤¢

¥£¡

"

nonzero elements of . The nonzero elements of each row of the matrix can be stored in

¡

a row of the array , completing the row by zeros as necessary. Together

!¦©©¤§ $%

£

¢

¡ ¡

with , an integer array must be stored which contains the column

$%¢¤" !¦ ''&$%£" ¥ ¡

© © § ¢

positions of each entry in . $ £"

¢

¥ ¡T ©

§¦

¥ ©

Thus, for the matrix of the previous example, the Ellpack-Itpack storage

scheme is

1. 2. 0. 1 3 1

3. 4. 5. 1 2 4

¡ ¡

6. 7. 8. 2 3 5.

= =

%£"

$¢ $%£" ¥

¢

9. 10. 0. 3 4 4

11 12. 0. 4 5 5

A certain column number must be chosen for each of the zero elements that must be

added to pad the shorter rows of , i.e., rows 1, 4, and 5. In this example, those integers are

¡

selected to be equal to the row numbers, as can be seen in the array. This is some- $%£" ¥

¢

˜

what arbitrary, and in fact, any integer between and would be acceptable. However,

there may be good reasons for not inserting the same integers too often, e.g. a constant

number, for performance considerations.

p

u d

u ”

u

¡ ¥ ¡

¤ ¥ ¢ ¥ ¥ ¦© ¡ ¨¥ £ ¥ ¤© £