#10750: Fix solve so that additional args are properly handled
-------------------------+--------------------------------------------------
   Reporter:  kcrisman   |          Owner:  burcin               
       Type:  defect     |         Status:  new                  
   Priority:  major      |      Milestone:                       
  Component:  symbolics  |       Keywords:  solve, maxima, Maxima
Work_issues:             |       Upstream:  N/A                  
   Reviewer:             |         Author:                       
     Merged:             |   Dependencies:                       
-------------------------+--------------------------------------------------

Comment(by jhpalmieri):

 The documentation for "solve" in symbolic/relation.py says that the
 arguments are
 {{{
     -  ``f`` - equation or system of equations (given by a
        list or tuple)

     -  ``*args`` - variables to solve for.

     -  ``solution_dict``
 }}}
 The function is defined as {{{def solve(f, *args, **kwds):}}}.  So I think
 we can assume that {{{args}}} is the list of variables, whereas any
 keywords are in {{{kwds}}}.  So

  - we should document some more possible keywords, like
 {{{multiplicities}}}, or at least give pointers to documentation to any
 other solve routines which get called by this one, and

  - if args has length greater than one, then we obviously shouldn't just
 call `Expression.solve()`, but deal with it some other way.  Can we just
 change the beginning?
 {{{
 #!diff
 diff --git a/sage/symbolic/relation.py b/sage/symbolic/relation.py
 --- a/sage/symbolic/relation.py
 +++ b/sage/symbolic/relation.py
 @@ -646,7 +646,8 @@ def solve(f, *args, **kwds):
          []
      """
      from sage.symbolic.expression import is_Expression
 -    if is_Expression(f): # f is a single expression
 +    # f is a single expression and there is a single variable
 +    if is_Expression(f) and len(args) == 1:
          ans = f.solve(*args,**kwds)
          return ans
 }}}
  (This is completely untested.  Maybe we also need to check
 `is_SymbolicVariable(args[0])`...)

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10750#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to