Generalized Krylov Subspace Methods With Applications