2.4.2 Band-diagonal systems


hml
05-06-2009, 06:41 AM
In Bandec::Bandec ctor,
where we rearrange the storage a bit, taking the example (2.4.8), we set a to au, so au looks like (2.4.8)
then we set
au[0][0] from au [0][1]
which is junk (that is 'x' )
At the end of that loop for "rearrange storage", au[0][0]
is still junk.

Later, for row k=0
we use, dum = au[0][0], which is junk

is this normal?

rds,

davekw7x
05-06-2009, 12:04 PM
In Bandec::Bandec ctor,
where we rearrange the storage a bit, taking the example (2.4.8), we set a to au, so au looks like (2.4.8)
then we set
au[0][0] from au [0][1]
which is junk (that is 'x' )

That is not correct. If you follow the calculations carefully, you can see for this example (7x7 system with m1 = 2 and m2 = 1) the input banded matrix elements [0][0] and [0][1] and [1][0] and [6][3] are not used anywhere in the calculations. Therefore, as far as the program is concerned, their values are irrelevant.

In particular here is how the loops at the beginning of the constructor operate to shift the first "m1" rows of the banded matrix copied from the input:

In the constructor with m1 = 2, m2 = 1, mm = 4
i = 0
First "j" loop:
Set au[0][0] equal to the original value of au[0][2]
Set au[0][1] equal to the original value of au[0][3]
Second "j" loop:
Set au[0][2] to zero.
Set au[0][3] to zero.

i = 1
First "j" loop:
Set au[1][0] equal to the original value of au[1][1]
Set au[1][1] equal to the original value of au[1][2]
Set au[1][2] equal to the original value of au[1][3]
Second "j" loop:
Set au[1][3] to zero.


Regards,

Dave

hml
05-07-2009, 02:35 AM
the l index looked like a number 1
so I rearranged wrongle the au[] data
au[i][j-l] = au[i][j-1]
annoying fonts

now it works
thanks

hml
05-08-2009, 06:04 AM
how does the algorithm simplify if the matrix, in addition to being band diagonal, is also symmetric ?

rds,