Application of conjugate gradient methods to transonic finite difference and finite element calculations