Generalized inverses of band matrices