def test_feasible_pt(): # constraints = """x0 + x1 + x6 - 2*x3 > 3""" #FIXME: allow inequalities constraints = """x0 + x1 + x6 - 2*x3 = 3""" constraints = solve(constraints) assert constraints == 'x0 = -x1 + 2*x3 - x6 + 3' solv = generate_solvers(constraints) conf = generate_constraint(solv) soln = _solve(conf, guess=[1.]*8) assert soln == [3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
def test_feasible_pt(): # constraints = """x0 + x1 + x6 - 2*x3 > 3""" #FIXME: allow inequalities constraints = """x0 + x1 + x6 - 2*x3 = 3""" constraints = solve(constraints) assert constraints == 'x0 = -x1 + 2*x3 - x6 + 3' solv = generate_solvers(constraints) conf = generate_constraint(solv) soln = _solve(conf, guess=[1.]*8) assert soln == [3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]