On sparse and compact preconditioned conjugate gradient methods for partial differential equations