I have a matrix of the form

enter image description here

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.

  • 3
    $\begingroup$ 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). $\endgroup$
    – GoHokies
    Dec 4, 2017 at 19:03
  • 1
    $\begingroup$ 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. $\endgroup$ Dec 4, 2017 at 19:19
  • $\begingroup$ 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 $\endgroup$
    – origimbo
    Dec 4, 2017 at 19:28

1 Answer 1


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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.