File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -322,6 +322,7 @@ cdef extern from "<symengine/basic.h>" namespace "SymEngine":
322
322
cdef extern from " <symengine/subs.h>" namespace " SymEngine" :
323
323
rcp_const_basic msubs (rcp_const_basic & x, const map_basic_basic & x) nogil
324
324
rcp_const_basic ssubs (rcp_const_basic & x, const map_basic_basic & x) nogil
325
+ rcp_const_basic xreplace (rcp_const_basic & x, const map_basic_basic & x) nogil
325
326
326
327
cdef extern from " <symengine/derivative.h>" namespace " SymEngine" :
327
328
rcp_const_basic diff " SymEngine::sdiff" (rcp_const_basic & arg, rcp_const_basic & x) nogil except +
Original file line number Diff line number Diff line change @@ -911,7 +911,11 @@ cdef class Basic(object):
911
911
cdef _DictBasic D = get_dict(* args)
912
912
return c2py(symengine.ssubs(self .thisptr, D.c))
913
913
914
- replace = xreplace = subs
914
+ def xreplace (Basic self not None , *args ):
915
+ cdef _DictBasic D = get_dict(* args)
916
+ return c2py(symengine.xreplace(self .thisptr, D.c))
917
+
918
+ replace = xreplace
915
919
916
920
def msubs (Basic self not None , *args ):
917
921
cdef _DictBasic D = get_dict(* args)
@@ -3531,7 +3535,11 @@ cdef class DenseMatrixBase(MatrixBase):
3531
3535
cdef _DictBasic D = get_dict(* args)
3532
3536
return self .applyfunc(lambda x : x.subs(D))
3533
3537
3534
- replace = xreplace = subs
3538
+ def xreplace (self , *args ):
3539
+ cdef _DictBasic D = get_dict(* args)
3540
+ return self .applyfunc(lambda x : x.xreplace(D))
3541
+
3542
+ replace = xreplace
3535
3543
3536
3544
@property
3537
3545
def free_symbols (self ):
You can’t perform that action at this time.
0 commit comments