Comparative study of Lyman continuum, soft x-ray or hard x-ray heating of an optically thin gas