power_estimate.py 文件源码

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

项目:delight-diploma-thesis 作者: alexpeits 项目源码 文件源码
def construct_table():
    """:rtype: list"""
    solutions = []
    MAX, _ = quad(integrand, 0, HALF_P)
    for i in [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]:
        power = MAX*i
        results = []

        for tol in tolerance:
            if len(results) > 0:
                break
            for start in linspace(0, HALF_P, 1000):
                res, _ = quad(integrand, start, HALF_P)
                #print res
                if isclose(res, power, abs_tol=tol):
                    results.append(start)

        mean = sum(results)/len(results)
        solutions.append(mean)

    conv = interp1d([min(solutions), max(solutions)], [DIM_MIN, DIM_MAX])
    mapped_sol = conv(solutions)
    return [int(i) for i in mapped_sol] # = DIM_TABLE
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号