Beispiel #1
0
def test_warm():
    data, cone, true_x = ex.simple_pcp()

    # computing a fresh solution takes some number of iters
    sol = scs.solve(data, cone)
    assert sol['info']['iter'] >= 10

    # should take 0 iterations
    sol = scs.solve(data, cone, warm_start=sol)
    assert sol['info']['iter'] == 0

    # change solution a bit
    sol['x'] *= 2

    # perturbing the solution should take a few iterations to correct
    sol = scs.solve(data, cone, warm_start=sol)
    assert sol['info']['iter'] >= 3
Beispiel #2
0
def test_warm():
    data, cone, true_x = ex.simple_pcp()

    # computing a fresh solution takes some number of iters
    sol = scs.solve(data, cone)
    assert sol['info']['iter'] >= 10

    # should take 0 iterations
    sol = scs.solve(data, cone, warm_start = sol)
    assert sol['info']['iter'] == 0

    # change solution a bit
    sol['x'] *= 2

    # perturbing the solution should take a few iterations to correct
    sol = scs.solve(data, cone, warm_start = sol)
    assert sol['info']['iter'] >= 3
Beispiel #3
0
def test_simple_pcp():
    data, cone, true_x = ex.simple_pcp()
    sol = scs.solve(data, cone, eps=1e-6)

    assert np.allclose(sol['x'], true_x)