本文整理汇总了Python中sympy.polys.densebasic.dup_inflate函数的典型用法代码示例。如果您正苦于以下问题:Python dup_inflate函数的具体用法?Python dup_inflate怎么用?Python dup_inflate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dup_inflate函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dup_zz_cyclotomic_poly
def dup_zz_cyclotomic_poly(n, K):
"""Efficiently generate n-th cyclotomic polnomial. """
h = [K.one,-K.one]
for p, k in factorint(n).iteritems():
h = dup_quo(dup_inflate(h, p, K), h, K)
h = dup_inflate(h, p**(k-1), K)
return h
示例2: test_dup_inflate
def test_dup_inflate():
assert dup_inflate([], 17, ZZ) == []
assert dup_inflate([1,2,3], 1, ZZ) == [1,2,3]
assert dup_inflate([1,2,3], 2, ZZ) == [1,0,2,0,3]
assert dup_inflate([1,2,3], 3, ZZ) == [1,0,0,2,0,0,3]
assert dup_inflate([1,2,3], 4, ZZ) == [1,0,0,0,2,0,0,0,3]
raises(IndexError, 'dup_inflate([1,2,3], 0, ZZ)')
示例3: _dup_cyclotomic_decompose
def _dup_cyclotomic_decompose(n, K):
H = [[K.one,-K.one]]
for p, k in factorint(n).iteritems():
Q = [ dup_quo(dup_inflate(h, p, K), h, K) for h in H ]
H.extend(Q)
for i in xrange(1, k):
Q = [ dup_inflate(q, p, K) for q in Q ]
H.extend(Q)
return H