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 @@ -907,7 +907,11 @@ cdef class Basic(object):
907
907
cdef _DictBasic D = get_dict(* args)
908
908
return c2py(symengine.ssubs(self .thisptr, D.c))
909
909
910
- replace = xreplace = subs
910
+ def xreplace (Basic self not None , *args ):
911
+ cdef _DictBasic D = get_dict(* args)
912
+ return c2py(symengine.xreplace(self .thisptr, D.c))
913
+
914
+ replace = xreplace
911
915
912
916
def msubs (Basic self not None , *args ):
913
917
cdef _DictBasic D = get_dict(* args)
@@ -3509,7 +3513,11 @@ cdef class DenseMatrixBase(MatrixBase):
3509
3513
cdef _DictBasic D = get_dict(* args)
3510
3514
return self .applyfunc(lambda x : x.subs(D))
3511
3515
3512
- replace = xreplace = subs
3516
+ def xreplace (self , *args ):
3517
+ cdef _DictBasic D = get_dict(* args)
3518
+ return self .applyfunc(lambda x : x.xreplace(D))
3519
+
3520
+ replace = xreplace
3513
3521
3514
3522
@property
3515
3523
def free_symbols (self ):
You can’t perform that action at this time.
0 commit comments