Generalized Inverses of Triangular Matrices