Generalized band matrices and their inverses