def test_prune(self): N = 10 coeffs = np.array([1.] + N * [0]) c0 = Chebfun.from_coeff(coeffs) npt.assert_allclose(c0.coefficients(), [1.]) c1 = Chebfun.from_coeff(coeffs, prune=False) npt.assert_allclose(c1.coefficients(), coeffs)
def test_prune(self): N = 10 coeffs = np.array([1.]+N*[0]) c0 = Chebfun.from_coeff(coeffs) npt.assert_allclose(c0.coefficients(), [1.]) c1 = Chebfun.from_coeff(coeffs, prune=False) npt.assert_allclose(c1.coefficients(), coeffs)
def test_from_chebcoeffs(self): coeffs = np.random.randn(10) cr = chebfun(chebcoeff=coeffs) ce = Chebfun.from_coeff(coeffs) tools.assert_close(cr, ce)
def test_chebcoeff_one(self): c = Chebfun.from_coeff(np.array([ [1.], ])) npt.assert_allclose(c(tools.xs), 1.)
def test_chebcoefflist(self): """ Initialise with a chebcoeff list """ c = Chebfun.from_coeff([1., 2.])
def test_chebcoeff(self): new = Chebfun.from_coeff(self.p.coefficients()) tools.assert_close(self.p, new)
def test_chebcoeff_one(self): c = Chebfun.from_coeff(np.array([[1.],])) npt.assert_allclose(c(tools.xs), 1.)
def test_chebcoefflist(self): """ Initialise with a chebcoeff list """ c = Chebfun.from_coeff([1.,2.])