本文整理匯總了Python中numpy.polynomial.chebyshev.chebmul方法的典型用法代碼示例。如果您正苦於以下問題:Python chebyshev.chebmul方法的具體用法?Python chebyshev.chebmul怎麽用?Python chebyshev.chebmul使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numpy.polynomial.chebyshev
的用法示例。
在下文中一共展示了chebyshev.chebmul方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_chebmul
# 需要導入模塊: from numpy.polynomial import chebyshev [as 別名]
# 或者: from numpy.polynomial.chebyshev import chebmul [as 別名]
def test_chebmul(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += .5
tgt[abs(i - j)] += .5
res = cheb.chebmul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg)
示例2: test_chebdiv
# 需要導入模塊: from numpy.polynomial import chebyshev [as 別名]
# 或者: from numpy.polynomial.chebyshev import chebmul [as 別名]
def test_chebdiv(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1]
cj = [0]*j + [1]
tgt = cheb.chebadd(ci, cj)
quo, rem = cheb.chebdiv(tgt, ci)
res = cheb.chebadd(cheb.chebmul(quo, ci), rem)
assert_equal(trim(res), trim(tgt), err_msg=msg)
示例3: test_chebpow
# 需要導入模塊: from numpy.polynomial import chebyshev [as 別名]
# 或者: from numpy.polynomial.chebyshev import chebmul [as 別名]
def test_chebpow(self):
for i in range(5):
for j in range(5):
msg = "At i=%d, j=%d" % (i, j)
c = np.arange(i + 1)
tgt = reduce(cheb.chebmul, [c]*j, np.array([1]))
res = cheb.chebpow(c, j)
assert_equal(trim(res), trim(tgt), err_msg=msg)
示例4: test_chebmul
# 需要導入模塊: from numpy.polynomial import chebyshev [as 別名]
# 或者: from numpy.polynomial.chebyshev import chebmul [as 別名]
def test_chebmul(self) :
for i in range(5) :
for j in range(5) :
msg = "At i=%d, j=%d" % (i, j)
tgt = np.zeros(i + j + 1)
tgt[i + j] += .5
tgt[abs(i - j)] += .5
res = cheb.chebmul([0]*i + [1], [0]*j + [1])
assert_equal(trim(res), trim(tgt), err_msg=msg)
示例5: test_chebdiv
# 需要導入模塊: from numpy.polynomial import chebyshev [as 別名]
# 或者: from numpy.polynomial.chebyshev import chebmul [as 別名]
def test_chebdiv(self) :
for i in range(5) :
for j in range(5) :
msg = "At i=%d, j=%d" % (i, j)
ci = [0]*i + [1]
cj = [0]*j + [1]
tgt = cheb.chebadd(ci, cj)
quo, rem = cheb.chebdiv(tgt, ci)
res = cheb.chebadd(cheb.chebmul(quo, ci), rem)
assert_equal(trim(res), trim(tgt), err_msg=msg)