當前位置: 首頁>>代碼示例>>Python>>正文


Python Chebfun.from_coeff方法代碼示例

本文整理匯總了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)
開發者ID:olivierverdier,項目名稱:pychebfun,代碼行數:9,代碼來源:test_chebfun.py

示例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)
開發者ID:olivierverdier,項目名稱:pychebfun,代碼行數:7,代碼來源:test_chebfun.py

示例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.)
開發者ID:olivierverdier,項目名稱:pychebfun,代碼行數:5,代碼來源:test_chebfun.py

示例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.])
開發者ID:olivierverdier,項目名稱:pychebfun,代碼行數:7,代碼來源:test_chebfun.py

示例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)
開發者ID:olivierverdier,項目名稱:pychebfun,代碼行數:5,代碼來源:test_chebfun.py


注:本文中的pychebfun.Chebfun.from_coeff方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。