To compute the inverse of a square, non-symmetric, pentadiagonal matrix [A] of the following form
- Code: Select all
[A] =
[ 1 a12 a13 0 0
a21 1 a23 a24 0
a31 a32 1 a34 a35
0 a42 a43 1 a45
0 0 a53 a54 1]
I compactly store [A] as [AB]:
- Code: Select all
[AB] =
[ 0 0 0 0 0
0 0 0 0 0
0 0 a13 a24 a35
0 a12 a23 a34 a45
1 1 1 1 1
a21 a32 a43 a54 0
a31 a42 a53 0 0]
and pass it to DGBTRF to find the LU decomposition (for the exemplary matrix above):
- Code: Select all
M = 5
N = 5
KL = 2
KU = 2
LDAB = 2*KL+ KU+ 1
call DGBTRF(M, N, KL, KU, AB, LDAB, IPIV, INFO)
This works as expected. If however the dimensions of [A] exceed 9x9, DGBTRF returns a value of 1 for INFO,
i.e. a singular factor U in the LU decomposition.
Using MATLAB's lu(A) gives sensible results for matrices of any size.
I would greatly appreciate your thoughts on where I am going wrong with LAPACK.
Thank you!
Luc

