Stability analysis of magnetohydrostatic equilibrium by the finite element method and Arnoldi and Lanczos eigensolvers