Changeset 831 for mystic/tests/test_symbolic.py
- Timestamp:
- 09/28/15 20:45:46 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/tests/test_symbolic.py
r781 r831 76 76 assert (x[1] - x[0]) - 1.0 == mean(x[:-1]) 77 77 78 def test_simplify(): 79 constraints = """ 80 mean([x0, x1, x2]) <= 5.0 81 x0 <= x1 + x2""" 82 83 from mystic.math.measures import mean 84 _constraints = simplify(constraints) 85 solv = generate_solvers(_constraints) 86 constraint = generate_constraint(solv) 87 x = constraint([1.0, -2.0, -3.0]) 88 assert all(x) == all([-5.0, -2.0, -3.0]) 89 assert mean(x) <= 5.0 90 assert x[0] <= x[1] + x[2] 91 78 92 79 93 if __name__ == '__main__': … … 82 96 test_generate_constraint() 83 97 test_solve_constraint() 98 test_simplify() 84 99
Note: See TracChangeset
for help on using the changeset viewer.