Flexible and multi-shift induced dimension reduction algorithms for solving large sparse linear systems