An algebraic multigrid method for eigenvalue problems