Suggestion in Issue #12052 (Better input validation for nsolve)
26 views
Skip to first unread message
Mohit Raj
unread,
Jan 25, 2017, 1:15:58 PM1/25/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sympy
Hey all, I would like to have any valuable suggestions on this code below. It is maintaining order of variables. I think preorder_traversal would also work. Kindly do give suggestions on this.
if fargs is None: fargs = [ ] seen = [ ] out = [ ] for i in f: temp = i.as_ordered_terms() for j in temp: if(isinstance(j,Symbol)): out.append(j) for m in out: if m not in seen: fargs.append(m) seen.append(m)
Aaron Meurer
unread,
Jan 25, 2017, 2:03:38 PM1/25/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to sy...@googlegroups.com
It is possible to canonically order Symbols, but that order is
completely arbitrary, and might not be what the user expects. It's
best to require the user to specify the symbol order, so there is no
ambiguity.