Riemannian optimization method with subspace tracking