本文整理汇总了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)