Generalized Rank-Constrained Matrix Approximations