test_hyperexpand.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:Python-iBeacon-Scan 作者: NikNitro 项目源码 文件源码
def can_do(ap, bq, numerical=True, div=1, lowerplane=False):
    from sympy import exp_polar, exp
    r = hyperexpand(hyper(ap, bq, z))
    if r.has(hyper):
        return False
    if not numerical:
        return True
    repl = {}
    randsyms = r.free_symbols - {z}
    while randsyms:
        # Only randomly generated parameters are checked.
        for n, a in enumerate(randsyms):
            repl[a] = randcplx(n)/div
        if not any([b.is_Integer and b <= 0 for b in Tuple(*bq).subs(repl)]):
            break
    [a, b, c, d] = [2, -1, 3, 1]
    if lowerplane:
        [a, b, c, d] = [2, -2, 3, -1]
    return tn(
        hyper(ap, bq, z).subs(repl),
        r.replace(exp_polar, exp).subs(repl),
        z, a=a, b=b, c=c, d=d)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号