Computation of selected eigenvalues of generalized eigenvalue problems