Linear scaling calculation of band edge states and doped semiconductors.