Electronic structure and magnetic interactions in LiV2O4