lythari
08-03-2005, 08:08 PM
tred2 has been giving me no joy for the past day. Since I think it's safe to assume that the code itself is not at error, i'm probably doing something wrong with the inputs i'm giving tred2.
In the comments for the C version of tred2, the function takes in a matrix a[1..n][1..n] and two arrays d[1..n] and e[1..n]. Am I correct in interpreting that to mean that the 0th row and column of the matrix a are ignored? For example, if I wanted to tridiagonalise the matrix
1 2 3
1 2 3
1 2 3
a[][] would be
0 0 0 0
0 1 2 3
0 1 2 3
0 1 2 3
Likewise, i'm assuming that d[] and e[] also ignore the 0th element and so are really d[0,1..n] and e[0,1..n]. For this example, i'm taking n to be 3.
PS: On second thought, that's a horrible example since the matrix is not real symmetric. Let's just ignore that for the moment. ;)
In the comments for the C version of tred2, the function takes in a matrix a[1..n][1..n] and two arrays d[1..n] and e[1..n]. Am I correct in interpreting that to mean that the 0th row and column of the matrix a are ignored? For example, if I wanted to tridiagonalise the matrix
1 2 3
1 2 3
1 2 3
a[][] would be
0 0 0 0
0 1 2 3
0 1 2 3
0 1 2 3
Likewise, i'm assuming that d[] and e[] also ignore the 0th element and so are really d[0,1..n] and e[0,1..n]. For this example, i'm taking n to be 3.
PS: On second thought, that's a horrible example since the matrix is not real symmetric. Let's just ignore that for the moment. ;)