Approximate inverse preconditioning for shifted linear systems