File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ cdef extern from "<symengine/basic.h>" namespace "SymEngine":
133133 RCP[const Rational] rcp_static_cast_Rational " SymEngine::rcp_static_cast<const SymEngine::Rational>" (rcp_const_basic & b) nogil
134134 RCP[const Complex] rcp_static_cast_Complex " SymEngine::rcp_static_cast<const SymEngine::Complex>" (rcp_const_basic & b) nogil
135135 RCP[const Number] rcp_static_cast_Number " SymEngine::rcp_static_cast<const SymEngine::Number>" (rcp_const_basic & b) nogil
136+ RCP[const Dummy] rcp_static_cast_Dummy " SymEngine::rcp_static_cast<const SymEngine::Dummy>" (rcp_const_basic & b) nogil
136137 RCP[const Add] rcp_static_cast_Add " SymEngine::rcp_static_cast<const SymEngine::Add>" (rcp_const_basic & b) nogil
137138 RCP[const Mul] rcp_static_cast_Mul " SymEngine::rcp_static_cast<const SymEngine::Mul>" (rcp_const_basic & b) nogil
138139 RCP[const Pow] rcp_static_cast_Pow " SymEngine::rcp_static_cast<const SymEngine::Pow>" (rcp_const_basic & b) nogil
@@ -180,7 +181,7 @@ cdef extern from "<symengine/symbol.h>" namespace "SymEngine":
180181 Symbol(string name) nogil
181182 string get_name() nogil
182183 cdef cppclass Dummy(Symbol):
183- pass
184+ size_t get_index()
184185
185186cdef extern from " <symengine/number.h>" namespace " SymEngine" :
186187 cdef cppclass Number(Basic):
Original file line number Diff line number Diff line change @@ -1355,6 +1355,12 @@ cdef class Dummy(Symbol):
13551355 def func (self ):
13561356 return self .__class__
13571357
1358+ @property
1359+ def dummy_index (self ):
1360+ cdef RCP[const symengine.Dummy] this = \
1361+ symengine.rcp_static_cast_Dummy(self .thisptr)
1362+ cdef size_t index = deref(this).get_index()
1363+ return index
13581364
13591365def symarray (prefix , shape , **kwargs ):
13601366 """ Creates an nd-array of symbols
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ def test_dummy():
156156 x2 = Symbol ('x' )
157157 xdummy1 = Dummy ('x' )
158158 xdummy2 = Dummy ('x' )
159+ assert xdummy1 .dummy_index != xdummy2 .dummy_index # maybe test using "less than"?
159160
160161 assert x1 == x2
161162 assert x1 != xdummy1
You can’t perform that action at this time.
0 commit comments