예제 #1
0
def test_ncp_newton_FBLSA():
    ncp = SN.NCP(2, ncp_function, ncp_Nablafunction)
    z = np.array([0., 0.])
    w = np.array([0., 0.])

    SO = SN.SolverOptions(SN.SICONOS_NCP_NEWTON_FB_FBLSA)
    info = SN.ncp_driver(ncp, z, w, SO)
    assert (np.linalg.norm(z - zsol) <= ztol)
    assert not info
예제 #2
0
def test_ncp_path():
    ncp = SN.NCP(2, ncp_function, ncp_Nablafunction)
    z = np.array([0., 0.])
    w = np.array([0., 0.])

    SO = SN.SolverOptions(SN.SICONOS_NCP_PATH)
    info = SN.ncp_driver(ncp, z, w, SO)

    if siconos.WITH_PATHFERRIS:
        assert (np.linalg.norm(z - zsol) <= ztol)
        assert not info
        return
    else:
        assert info != 0

        try:
            SN.ncp_path(ncp, z, w, SO)
        except RuntimeError:
            pass
        except:
            assert 0
예제 #3
0
def test_new():
    return SN.NCP(1, ncp_function, ncp_Nablafunction)
예제 #4
0
파일: test_ncp.py 프로젝트: stpua/siconos
def test_new():
    ncp = SN.NCP(1, ncp_function, ncp_Nablafunction)