Ejemplo n.º 1
0
def test_solve_unbounded(use_indirect, gpu):
    data = tools.gen_unbounded(K, n=m // 3)
    sol = scs.solve(data, K, use_indirect=use_indirect, gpu=gpu, **params)
    x = sol['x']
    s = sol['s']
    np.testing.assert_array_less(np.linalg.norm(data['A'] @ x + s), 1e-3)
    np.testing.assert_array_less(data['c'].T @ x, -0.1)
    np.testing.assert_almost_equal(s, tools.proj_cone(s, K), decimal=4)
Ejemplo n.º 2
0
def test_solve_unbounded(use_indirect, gpu):
    data = tools.gen_unbounded(K, n=m // 2)
    solver = scs.SCS(data, K, use_indirect=use_indirect, gpu=gpu, **params)
    sol = solver.solve()
    x = sol["x"]
    s = sol["s"]
    np.testing.assert_array_less(np.linalg.norm(data["A"] @ x + s), 1e-3)
    np.testing.assert_array_less(data["c"].T @ x, -0.1)
    np.testing.assert_almost_equal(s, tools.proj_cone(s, K), decimal=4)
Ejemplo n.º 3
0
def solve_unbounded(use_indirect, gpu):
    K = {
        'f': 10,
        'l': 15,
        'q': [5, 10, 0, 1],
        's': [3, 4, 0, 0, 1],
        'ep': 10,
        'ed': 10,
        'p': [-0.25, 0.5, 0.75, -0.33]
    }
    m = tools.get_scs_cone_dims(K)
    data = tools.gen_unbounded(K, n=m // 3)
    params = {'normalize': True, 'scale': 0.5, 'cg_rate': 2}
    sol = scs.solve(data, K, use_indirect=use_indirect, gpu=gpu, **params)
Ejemplo n.º 4
0
def solve_unbounded(use_indirect, gpu):
    K = {
        "f": 10,
        "l": 15,
        "q": [5, 10, 0, 1],
        "s": [3, 4, 0, 0, 1],
        "ep": 10,
        "ed": 10,
        "p": [-0.25, 0.5, 0.75, -0.33],
    }
    m = tools.get_scs_cone_dims(K)
    data = tools.gen_unbounded(K, n=m // 3)
    params = {"normalize": True, "scale": 0.5}
    sol = scs.solve(data, K, use_indirect=use_indirect, gpu=gpu, **params)
def test_unbounded():
  for i in range(num_unb):
    data = tools.gen_unbounded(K, n=m // 2)

    yield check_unbounded, scs.solve(data, K, use_indirect=False, **opts)
    yield check_unbounded, scs.solve(data, K, use_indirect=True, **opts)
Ejemplo n.º 6
0
def test_unbounded(use_indirect):
    for i in range(num_unb):
        data = tools.gen_unbounded(K, n=m // 2)
        solver = scs.SCS(data, K, use_indirect=use_indirect, **opts)
        sol = solver.solve()
        check_unbounded(sol)
def test_solve_unbounded(use_indirect, gpu):
    data = tools.gen_unbounded(K, n=m // 3)
    sol = scs.solve(data, K, use_indirect=use_indirect, gpu=gpu, **params)