Exemplo n.º 1
0
def test_mcp_newton_FB_FBLSA_2():
    mcp = SN.MCP(n - 5, 5, mcp_function_2, mcp_Nablafunction_2)
    z = np.zeros(n)
    w = np.zeros(n)
    SO = SN.SolverOptions(mcp, SN.SICONOS_MCP_NEWTON_FB_FBLSA)
    info = SN.mcp_newton_FB_FBLSA(mcp, z, w, SO)
    print("z = ", z)
    print("w = ", w)
    #assert (np.linalg.norm(z-zsol) <= ztol)
    assert not info
Exemplo n.º 2
0
def test_mcp_newton_FB_FBLSA():
    mcp = sn.MCP(0, 2, mcp_function, mcp_Nablafunction)
    z = np.array([0., 0.])
    w = np.array([0., 0.])

    SO = sn.SolverOptions(sn.SICONOS_MCP_NEWTON_FB_FBLSA)
    info = sn.mcp_newton_FB_FBLSA(mcp, z, w, SO)
    print("z = ", z)
    print("w = ", w)
    assert (np.linalg.norm(z - zsol) <= ztol)
    assert not info