# Are there any packaged routines (in lapack or elsewhere) for inverting a banded matrix?

I have a matrix of the form

And I would like to invert it. Currently I am using the lapack routines zgetrf and zgetri. I.e. I am performing LU factorisation.

My question: Are there any packaged routines (lapack or otherwise) that invert banded matrices? I have found routines for tridiagonal and block diagonal matrices but little else.

• i think the answer to that is no. that is because the inverse operation does not preserve bandedness (i.e., the inverse of a banded matrix is, in general, not banded). – GoHokies Dec 4 '17 at 19:03
• Note that you could compute the inverses of your L and U factors and multiply them to get $A^{-1}$. However, the inverses of $L$ and $U$ would be triangular, not banded, and $A^{-1}$ would not be banded. – Brian Borchers Dec 4 '17 at 19:19
• If you're already using LU, rather than calculating an inverse, are zgbtrf and friends candidates? netlib.org/lapack/explore-3.1.1-html/zgbtrf.f.html – origimbo Dec 4 '17 at 19:28

Well, other than the usual "don't invert your matrices unless you need the inverse itself" you can still use the banded routines ?gbtrf and then use ?gbtrs with the right hand side being an identity matrix.