コード例 #1
0
ファイル: test_estimate.py プロジェクト: CollasLab/edd
def test_f3():
    idx = f3(xs).argmax()    
    correct_val = xs[idx]
    x = golden_section_search(f3, 0, 30, 40, 0.01)
    assert abs(correct_val - x) < 0.01
コード例 #2
0
ファイル: test_estimate.py プロジェクト: researchapps/edd
def test_f3():
    idx = f3(xs).argmax()
    correct_val = xs[idx]
    x = golden_section_search(f3, 0, 30, 40, 0.01)
    assert abs(correct_val - x) < 0.01
コード例 #3
0
ファイル: test_estimate.py プロジェクト: CollasLab/edd
def test_f2():
    idx = f2(xs).argmax()
    correct_val = xs[idx]
    x = golden_section_search(f2, 0, 30, 40, 0.005)
    msg = 'correct %.2f, but got %.2f' % (correct_val, x)
    assert abs(correct_val - x) < 0.01, msg
コード例 #4
0
ファイル: test_estimate.py プロジェクト: researchapps/edd
def test_f2():
    idx = f2(xs).argmax()
    correct_val = xs[idx]
    x = golden_section_search(f2, 0, 30, 40, 0.005)
    msg = 'correct %.2f, but got %.2f' % (correct_val, x)
    assert abs(correct_val - x) < 0.01, msg