本文整理汇总了Python中sage.all.ZZ.support方法的典型用法代码示例。如果您正苦于以下问题:Python ZZ.support方法的具体用法?Python ZZ.support怎么用?Python ZZ.support使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.all.ZZ
的用法示例。
在下文中一共展示了ZZ.support方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read_line
# 需要导入模块: from sage.all import ZZ [as 别名]
# 或者: from sage.all.ZZ import support [as 别名]
def read_line(line, debug=0):
r""" Parses one line from input file. Returns and a dict containing
fields with keys as above.
Sample line: 11 a 1 0,-1,1,-10,-20 7 1,0 0,1,0 0,0 0,1
Fields: label (3 fields)
a-invariants
p0
For each bad prime: 'a' if additive
lambda,mu if multiplicative (or 'o?' if unknown)
For each good prime: lambda,mu if ordinary (or 'o?' if unknown)
lambda+,lambda-,mu if supersingular (or 's?' if unknown)
"""
data = {}
if debug: print("Parsing input line {}".format(line[:-1]))
fields = line.split()
label = fields[0]+fields[1]+fields[2]
data['label'] = label
N = ZZ(fields[0])
badp = N.support()
nbadp = len(badp)
p0 = int(fields[4])
data['iwp0'] = p0
if debug: print("p0={}".format(p0))
iwdata = {}
# read data for bad primes
for p,pdat in zip(badp,fields[5:5+nbadp]):
p = str(p)
if debug>1: print("p={}, pdat={}".format(p,pdat))
if pdat in ['o?','a']:
iwdata[p]=pdat
else:
iwdata[p]=[int(x) for x in pdat.split(",")]
# read data for all primes
for p,pdat in zip(primes(1000),fields[5+nbadp:]):
p = str(p)
if debug>1: print("p={}, pdat={}".format(p,pdat))
if pdat in ['s?','o?','a']:
iwdata[p]=pdat
else:
iwdata[p]=[int(x) for x in pdat.split(",")]
data['iwdata'] = iwdata
if debug: print("label {}, data {}".format(label,data))
return label, data