On direct methods for shakedown and limit analysis