def test_minimize():
    inc = lambda x: x + 1
    dec = lambda x: x - 1
    rl = minimize(inc, dec)
    assert rl(4) == 3

    rl = minimize(inc, dec, objective=lambda x: -x)
    assert rl(4) == 5
Example #2
0
def test_minimize():
    inc = lambda x: x + 1
    dec = lambda x: x - 1
    rl = minimize(inc, dec)
    assert rl(4) == 3

    rl = minimize(inc, dec, objective=lambda x: -x)
    assert rl(4) == 5