Electronic structure of ferromagnetic rare-earth-transition-metal compounds