@@ -1026,7 +1026,7 @@ cdef class Mul(Basic):
10261026 cdef map_basic_basic dict = deref(X).get_dict()
10271027 d = collections.defaultdict(int )
10281028 d[c2py(< RCP[const symengine.Basic]> symengine.mul_from_dict(\
1029- symengine.rcp_static_cast_Number_Int (one),
1029+ < RCP[const symengine.Number] > (one),
10301030 symengine.std_move_map_basic_basic(dict )))] = \
10311031 c2py(< RCP[const symengine.Basic]> deref(X).get_coef())
10321032 return d
@@ -1196,7 +1196,7 @@ cdef class PyNumber(Number):
11961196 if obj is None :
11971197 return
11981198 Py_XINCREF(< PyObject* > (obj))
1199- self .thisptr = symengine.make_rcp_PyNumber(< PyObject* > (obj), < const RCP[const symengine.PyModule] > module.thisptr)
1199+ self .thisptr = symengine.make_rcp_PyNumber(< PyObject* > (obj), module.thisptr)
12001200
12011201 def _sympy_ (self ):
12021202 import sympy
@@ -1223,7 +1223,7 @@ cdef class PyFunction(FunctionSymbol):
12231223 cdef PyFunctionClass _pyfunction_class = get_function_class(pyfunction_class, module)
12241224 cdef PyObject* _pyfunction = < PyObject* > pyfunction
12251225 Py_XINCREF(_pyfunction)
1226- self .thisptr = symengine.make_rcp_PyFunction(v, < const RCP[const symengine.PyFunctionClass] > ( _pyfunction_class.thisptr) , _pyfunction)
1226+ self .thisptr = symengine.make_rcp_PyFunction(v, _pyfunction_class.thisptr, _pyfunction)
12271227
12281228 def _sympy_ (self ):
12291229 import sympy
@@ -1240,7 +1240,7 @@ cdef class PyFunctionClass(object):
12401240
12411241 def __cinit__ (self , function , PyModule module not None ):
12421242 self .thisptr = symengine.make_rcp_PyFunctionClass(< PyObject* > (function), str (function).encode(" utf-8" ),
1243- < const RCP[const symengine.PyModule] > module.thisptr)
1243+ module.thisptr)
12441244
12451245# TODO: remove this once SymEngine conversions are available in Sage.
12461246def wrap_sage_function (func ):
@@ -1288,7 +1288,7 @@ cdef class Derivative(Basic):
12881288 for s in symbols:
12891289 s_ = sympify(s, True )
12901290 m.insert(< RCP[symengine.const_Basic]> (s_.thisptr))
1291- self .thisptr = symengine.make_rcp_Derivative(< const RCP[const symengine.Basic] > expr_.thisptr, m)
1291+ self .thisptr = symengine.make_rcp_Derivative(expr_.thisptr, m)
12921292
12931293 def _sympy_ (self ):
12941294 cdef RCP[const symengine.Derivative] X = \
@@ -1324,7 +1324,7 @@ cdef class Subs(Basic):
13241324 v_ = sympify(v, True )
13251325 p_ = sympify(p, True )
13261326 m[v_.thisptr] = p_.thisptr
1327- self .thisptr = symengine.make_rcp_Subs(< const RCP[const symengine.Basic] > expr_.thisptr, m)
1327+ self .thisptr = symengine.make_rcp_Subs(expr_.thisptr, m)
13281328
13291329 def _sympy_ (self ):
13301330 cdef RCP[const symengine.Subs] X = symengine.rcp_static_cast_Subs(self .thisptr)
@@ -1664,7 +1664,7 @@ cdef class DenseMatrix(MatrixBase):
16641664 # No error checking is done
16651665 cdef Basic e_ = sympify(e)
16661666 if e_ is not None :
1667- deref(self .thisptr).set(i, j, < const RCP[const symengine.Basic] & > ( e_.thisptr) )
1667+ deref(self .thisptr).set(i, j, e_.thisptr)
16681668
16691669 def det (self ):
16701670 if self .nrows() != self .ncols():
@@ -1702,13 +1702,13 @@ cdef class DenseMatrix(MatrixBase):
17021702 def add_scalar (self , k ):
17031703 cdef Basic k_ = sympify(k)
17041704 result = DenseMatrix(self .nrows(), self .ncols())
1705- deref(self .thisptr).add_scalar(< const RCP[const symengine.Basic] & > ( k_.thisptr) , deref(result.thisptr))
1705+ deref(self .thisptr).add_scalar(k_.thisptr, deref(result.thisptr))
17061706 return result
17071707
17081708 def mul_scalar (self , k ):
17091709 cdef Basic k_ = sympify(k)
17101710 result = DenseMatrix(self .nrows(), self .ncols())
1711- deref(self .thisptr).mul_scalar(< const RCP[const symengine.Basic] & > ( k_.thisptr) , deref(result.thisptr))
1711+ deref(self .thisptr).mul_scalar(k_.thisptr, deref(result.thisptr))
17121712 return result
17131713
17141714 def transpose (self ):
@@ -2392,12 +2392,12 @@ def primitive_root_list(n):
23922392def totient (n ):
23932393 cdef Integer _n = sympify(n)
23942394 cdef RCP[const symengine.Integer] m = symengine.rcp_static_cast_Integer(_n.thisptr)
2395- return c2py(< RCP[const symengine.Basic]> symengine.totient(< const RCP[const symengine.Integer] > m))
2395+ return c2py(< RCP[const symengine.Basic]> symengine.totient(m))
23962396
23972397def carmichael (n ):
23982398 cdef Integer _n = sympify(n)
23992399 cdef RCP[const symengine.Integer] m = symengine.rcp_static_cast_Integer(_n.thisptr)
2400- return c2py(< RCP[const symengine.Basic]> symengine.carmichael(< const RCP[const symengine.Integer] > m))
2400+ return c2py(< RCP[const symengine.Basic]> symengine.carmichael(m))
24012401
24022402def multiplicative_order (a , n ):
24032403 cdef Integer _n = sympify(n)
@@ -2406,7 +2406,7 @@ def multiplicative_order(a, n):
24062406 cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
24072407 cdef RCP[const symengine.Integer] o
24082408 cdef bool c = symengine.multiplicative_order(symengine.outArg_Integer(o),
2409- < const RCP[const symengine.Integer] > a1, < const RCP[const symengine.Integer] > n1)
2409+ a1, n1)
24102410 if not c:
24112411 return None
24122412 return c2py(< RCP[const symengine.Basic]> o)
@@ -2437,9 +2437,7 @@ def nthroot_mod(a, n, m):
24372437 cdef RCP[const symengine.Integer] n1 = symengine.rcp_static_cast_Integer(_n.thisptr)
24382438 cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
24392439 cdef RCP[const symengine.Integer] m1 = symengine.rcp_static_cast_Integer(_m.thisptr)
2440- cdef bool ret_val = symengine.nthroot_mod(symengine.outArg_Integer(root),
2441- < const RCP[const symengine.Integer]> a1, < const RCP[const symengine.Integer]> n1,
2442- < const RCP[const symengine.Integer]> m1)
2440+ cdef bool ret_val = symengine.nthroot_mod(symengine.outArg_Integer(root), a1, n1, m1)
24432441 if not ret_val:
24442442 return None
24452443 return c2py(< RCP[const symengine.Basic]> root)
@@ -2452,8 +2450,7 @@ def nthroot_mod_list(a, n, m):
24522450 cdef RCP[const symengine.Integer] n1 = symengine.rcp_static_cast_Integer(_n.thisptr)
24532451 cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
24542452 cdef RCP[const symengine.Integer] m1 = symengine.rcp_static_cast_Integer(_m.thisptr)
2455- symengine.nthroot_mod_list(root_list, < const RCP[const symengine.Integer]> a1,
2456- < const RCP[const symengine.Integer]> n1, < const RCP[const symengine.Integer]> m1)
2453+ symengine.nthroot_mod_list(root_list, a1, n1, m1)
24572454 s = []
24582455 for i in range (root_list.size()):
24592456 s.append(c2py(< RCP[const symengine.Basic]> (root_list[i])))
@@ -2468,9 +2465,7 @@ def powermod(a, b, m):
24682465 cdef RCP[const symengine.Number] b1 = symengine.rcp_static_cast_Number(_b.thisptr)
24692466 cdef RCP[const symengine.Integer] root
24702467
2471- cdef bool ret_val = symengine.powermod(symengine.outArg_Integer(root),
2472- < const RCP[const symengine.Integer]> a1, < const RCP[const symengine.Number]> b1,
2473- < const RCP[const symengine.Integer]> m1)
2468+ cdef bool ret_val = symengine.powermod(symengine.outArg_Integer(root), a1, b1, m1)
24742469 if ret_val == 0 :
24752470 return None
24762471 return c2py(< RCP[const symengine.Basic]> root)
@@ -2484,9 +2479,7 @@ def powermod_list(a, b, m):
24842479 cdef RCP[const symengine.Number] b1 = symengine.rcp_static_cast_Number(_b.thisptr)
24852480 cdef symengine.vec_integer v
24862481
2487- symengine.powermod_list(v,
2488- < const RCP[const symengine.Integer]> a1, < const RCP[const symengine.Number]> b1,
2489- < const RCP[const symengine.Integer]> m1)
2482+ symengine.powermod_list(v, a1, b1, m1)
24902483 s = []
24912484 for i in range (v.size()):
24922485 s.append(c2py(< RCP[const symengine.Basic]> (v[i])))
@@ -2545,8 +2538,8 @@ def with_buffer(iterable, real=True):
25452538 try :
25462539 real_view = iterable
25472540 except (ValueError , TypeError ):
2548- real_view = cython.view.array(shape = (_size(iterable),),
2549- itemsize = sizeof(double ), format = ' d' )
2541+ real_view = cython.view.array((_size(iterable),),
2542+ sizeof(double ), format = ' d' )
25502543 for i in range (_size(iterable)):
25512544 real_view[i] = iterable[i]
25522545 return real_view
@@ -2556,8 +2549,8 @@ def with_buffer(iterable, real=True):
25562549 try :
25572550 cmplx_view = iterable
25582551 except (ValueError , TypeError ):
2559- cmplx_view = cython.view.array(shape = (_size(iterable),),
2560- itemsize = sizeof(double complex ), format = ' Zd' )
2552+ cmplx_view = cython.view.array((_size(iterable),),
2553+ sizeof(double complex ), format = ' Zd' )
25612554 for i in range (_size(iterable)):
25622555 cmplx_view[i] = iterable[i]
25632556 return cmplx_view
@@ -2762,11 +2755,11 @@ cdef class Lambdify(object):
27622755 self .real else np.complex128)
27632756 else :
27642757 if self .real:
2765- out = cython.view.array(shape = (new_out_size,),
2766- itemsize = sizeof(double ), format = ' d' )
2758+ out = cython.view.array((new_out_size,),
2759+ sizeof(double ), format = ' d' )
27672760 else :
2768- out = cython.view.array(shape = (new_out_size,),
2769- itemsize = sizeof(double complex ), format = ' Zd' )
2761+ out = cython.view.array((new_out_size,),
2762+ sizeof(double complex ), format = ' Zd' )
27702763 reshape_out = len (new_out_shape) > 1
27712764 else :
27722765 if use_numpy:
@@ -2812,15 +2805,15 @@ cdef class Lambdify(object):
28122805 out = out.reshape(new_out_shape)
28132806 elif reshape_out:
28142807 if self .real:
2815- tmp = cython.view.array(shape = new_out_shape,
2816- itemsize = sizeof(double ), format = ' d' )
2808+ tmp = cython.view.array(new_out_shape,
2809+ sizeof(double ), format = ' d' )
28172810 real_out_view = out
28182811 memcpy(< double * > tmp.data, & real_out_view[0 ],
28192812 sizeof(double )* new_out_size)
28202813 out = tmp
28212814 else :
2822- tmp = cython.view.array(shape = new_out_shape,
2823- itemsize = sizeof(double complex ), format = ' Zd' )
2815+ tmp = cython.view.array(new_out_shape,
2816+ sizeof(double complex ), format = ' Zd' )
28242817 cmplx_out_view = tmp
28252818 memcpy(< double complex * > tmp.data, & cmplx_out_view[0 ],
28262819 sizeof(double complex )* new_out_size)
0 commit comments