Changeset 767
- Timestamp:
- 11/11/14 15:02:35 (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
mystic/mystic/_symbolic.py
r760 r767 355 355 if permute or not target: #XXX: the goal is solving *only one* equation 356 356 code += '_xlist = %s\n' % ','.join(targeted) 357 code += '_xlist = [symsol(['+eqlist+'], [i]) for i in _xlist]\n' 357 code += '_elist = [symsol(['+eqlist+'], [i]) for i in _xlist]\n' 358 code += '_elist = [i if isinstance(i, dict) else {j:i[-1][-1]} for j,i in zip(_xlist,_elist)]\n' 358 359 code += 'soln = {}\n' 359 code += '[soln.update(i) for i in _ xlist if i]\n'360 code += '[soln.update(i) for i in _elist if i]\n' 360 361 else: 361 362 code += 'soln = symsol([' + eqlist + '], [' + target[0] + '])\n' 362 363 #code += 'soln = symsol([' + eqlist + '], [' + targeted[0] + '])\n' 364 code += 'soln = soln if isinstance(soln, dict) else {' + target[0] + ': soln[-1][-1]}\n' 363 365 ######################################################################## 364 366 … … 535 537 # returns: {x0: f(xn,...), x1: f(xn,...), ...} 536 538 _code += 'soln = symsol([' + eqlist + '], [' + xlist + '])' 539 #XXX: need to convert/check soln similarly as in _solve_single ? 537 540 if verbose: print _code 538 541 _code = compile(_code, '<string>', 'exec')
Note: See TracChangeset
for help on using the changeset viewer.