On the solution of the variational optimisation in the rational inattention framework