Ticket #11941: trac_11941.patch

File trac_11941.patch, 1.0 KB (added by mboratko, 8 years ago)

limited workaround for assumption and solve

  • sage/symbolic/assumptions.py

    # HG changeset patch
    # User Michael Boratko <boratko@gmail.com>
    # Date 1321550251 18000
    # Node ID 2921ac5c16ef8691f47fc3abcf0924f1c4242f7f
    # Parent  540f1f6a45d6ce46157ca726092ac6ac76e6a7f1
    trac 11941: limited workaround for assumption and solve
    
    diff --git a/sage/symbolic/assumptions.py b/sage/symbolic/assumptions.py
    a b  
    11from sage.structure.sage_object import SageObject
    22from sage.rings.all import ZZ, QQ, RR, CC
    33from sage.symbolic.ring import is_SymbolicVariable
     4from sage.interfaces.maxima_lib import maxima
     5from sage.misc.sage_eval import sage_eval
    46_assumptions = []
    57
    68class GenericDeclaration(SageObject):
     
    203205            value = soln.rhs()
    204206        else:
    205207            return False
     208        maxima.eval('domain: real')
     209        value_real = maxima.eval(str(value))
     210        maxima.eval('domain: complex')
     211        try:
     212            value = sage_eval(value_real)
     213        except:
     214            pass
    206215        try:
    207216            CC(value)
    208217        except: