Shorted operators and generalized inverses of matrices