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
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
def test_new(): return SN.NCP(1, ncp_function, ncp_Nablafunction)
def test_new(): ncp = SN.NCP(1, ncp_function, ncp_Nablafunction)