The Levine--Weinberger and Friedlander--Filonov inequalities for some classes of elliptic operators