本文整理匯總了Python中pychebfun.Chebfun.from_coeff方法的典型用法代碼示例。如果您正苦於以下問題:Python Chebfun.from_coeff方法的具體用法?Python Chebfun.from_coeff怎麽用?Python Chebfun.from_coeff使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pychebfun.Chebfun
的用法示例。
在下文中一共展示了Chebfun.from_coeff方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_prune
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import from_coeff [as 別名]
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)
示例2: test_from_chebcoeffs
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import from_coeff [as 別名]
def test_from_chebcoeffs(self):
coeffs = np.random.randn(10)
cr = chebfun(chebcoeff=coeffs)
ce = Chebfun.from_coeff(coeffs)
tools.assert_close(cr, ce)
示例3: test_chebcoeff_one
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import from_coeff [as 別名]
def test_chebcoeff_one(self):
c = Chebfun.from_coeff(np.array([[1.],]))
npt.assert_allclose(c(tools.xs), 1.)
示例4: test_chebcoefflist
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import from_coeff [as 別名]
def test_chebcoefflist(self):
"""
Initialise with a chebcoeff list
"""
c = Chebfun.from_coeff([1.,2.])
示例5: test_chebcoeff
# 需要導入模塊: from pychebfun import Chebfun [as 別名]
# 或者: from pychebfun.Chebfun import from_coeff [as 別名]
def test_chebcoeff(self):
new = Chebfun.from_coeff(self.p.coefficients())
tools.assert_close(self.p, new)