- Timestamp:
- 12/26/12 19:53:09 (3 years ago)
- Location:
- branches/decorate
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/decorate/_symbolic.py
r622 r623 9 9 # >>> soln = symsol([eq2, eq1], [x1, x2, x3]) 10 10 11 from symbolic import *12 11 from mystic.tools import permutations 12 from mystic.tools import list_or_tuple_or_ndarray 13 13 #from wrapper import isbounded 14 14 #from penalty import issolution … … 51 51 raise NotImplementedError, "cannot classify inequalities" 52 52 53 from symbolic import replace_variables, get_variables 53 54 #XXX: use solve? or first if not in form xi = ... ? 54 55 if list_or_tuple_or_ndarray(variables): … … 171 172 raise NotImplementedError, "cannot simplify inequalities" 172 173 174 from symbolic import replace_variables, get_variables 173 175 #XXX: if constraints contain x1,x2,x4 for 'x', should x3 be in code,xlist? 174 176 if list_or_tuple_or_ndarray(variables): … … 274 276 target = list(target) # not the best for ndarray, but should work 275 277 278 from symbolic import replace_variables, get_variables 276 279 if list_or_tuple_or_ndarray(variables): 277 280 if nvars: variables = variables[:nvars] … … 439 442 target = list(target) # not the best for ndarray, but should work 440 443 444 from symbolic import replace_variables, get_variables 441 445 if list_or_tuple_or_ndarray(variables): 442 446 if nvars: variables = variables[:nvars] … … 468 472 locals = kwds.get('locals', None) 469 473 if locals is None: locals = {} 470 # if sympy not installed, call generate_constraint474 # if sympy not installed, return original constraints 471 475 try: 472 476 code = """from sympy import Eq, Symbol;""" … … 697 701 target = list(target) # not the best for ndarray, but should work 698 702 703 from symbolic import replace_variables, get_variables 699 704 if list_or_tuple_or_ndarray(variables): 700 705 if nvars: variables = variables[:nvars] -
branches/decorate/symbolic.py
r620 r623 6 6 from __future__ import division 7 7 from numpy import ndarray, asarray 8 from _symbolic import solve 9 from mystic.tools import list_or_tuple_or_ndarray, flatten 8 10 9 11 # XXX: another function for the inverse... symbolic to matrix? (good for scipy) … … 85 87 86 88 87 from mystic.tools import list_or_tuple_or_ndarray, flatten88 89 def replace_variables(constraints, variables=None, markers='$'): 89 90 """Replace variables in constraints string with a marker. -
branches/decorate/test_symbolic.py
r622 r623 1 1 from symbolic import * 2 from _symbolic import *3 2 from mystic.math import almostEqual 4 3 from penalty import as_constraint
Note: See TracChangeset
for help on using the changeset viewer.