Origin of ferromagnetism in Ni-doped SnO2: First-principles calculation