def test_call_all_zero(self): for eg in self.examples: p = SparsePowers(eg) zero = (0.0,)*len(eg) if p.degree()==0: self.assertEquals(p(zero), 1.0) else: self.assertEquals(p(zero), 0.0)
def test_degree(self): for eg in self.examples: p = SparsePowers(eg) self.assertEquals(p.degree(), sum(eg))
def test_degree(self): m = SparsePowers() self.assertEquals(m.degree(), 0)