Page 100, Exercise 5 : Triadiagonal Matrix
| Sample Matrix | B |
[0] [1] [2] [3]
[0] 1 1 0 0
[1] 1 1 1 0
[2] 0 1 1 1
[3] 0 0 1 1
|
[0] = a[0][0] [1] = a[0][1] [2] = a[1][0] [3] = a[1][1] [4] = a[1][2] [5] = a[2][1] [6] = a[2][2] [7] = a[2][3] [8] = a[3][2] [9] = a[3][3] |
if (row == 0)
b[i] = column
else {
i = 2;
for (j = 1; j < row; j++)
i+= j;
if (column == row) i++;
if (column == row+1) i+= 2; |