@@ -1026,7 +1026,7 @@ cdef class Mul(Basic):
1026
1026
cdef map_basic_basic dict = deref(X).get_dict()
1027
1027
d = collections.defaultdict(int )
1028
1028
d[c2py(< RCP[const symengine.Basic]> symengine.mul_from_dict(\
1029
- symengine.rcp_static_cast_Number_Int (one),
1029
+ < RCP[const symengine.Number] > (one),
1030
1030
symengine.std_move_map_basic_basic(dict )))] = \
1031
1031
c2py(< RCP[const symengine.Basic]> deref(X).get_coef())
1032
1032
return d
@@ -1196,7 +1196,7 @@ cdef class PyNumber(Number):
1196
1196
if obj is None :
1197
1197
return
1198
1198
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)
1200
1200
1201
1201
def _sympy_ (self ):
1202
1202
import sympy
@@ -1223,7 +1223,7 @@ cdef class PyFunction(FunctionSymbol):
1223
1223
cdef PyFunctionClass _pyfunction_class = get_function_class(pyfunction_class, module)
1224
1224
cdef PyObject* _pyfunction = < PyObject* > pyfunction
1225
1225
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)
1227
1227
1228
1228
def _sympy_ (self ):
1229
1229
import sympy
@@ -1240,7 +1240,7 @@ cdef class PyFunctionClass(object):
1240
1240
1241
1241
def __cinit__ (self , function , PyModule module not None ):
1242
1242
self .thisptr = symengine.make_rcp_PyFunctionClass(< PyObject* > (function), str (function).encode(" utf-8" ),
1243
- < const RCP[const symengine.PyModule] > module.thisptr)
1243
+ module.thisptr)
1244
1244
1245
1245
# TODO: remove this once SymEngine conversions are available in Sage.
1246
1246
def wrap_sage_function (func ):
@@ -1288,7 +1288,7 @@ cdef class Derivative(Basic):
1288
1288
for s in symbols:
1289
1289
s_ = sympify(s, True )
1290
1290
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)
1292
1292
1293
1293
def _sympy_ (self ):
1294
1294
cdef RCP[const symengine.Derivative] X = \
@@ -1324,7 +1324,7 @@ cdef class Subs(Basic):
1324
1324
v_ = sympify(v, True )
1325
1325
p_ = sympify(p, True )
1326
1326
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)
1328
1328
1329
1329
def _sympy_ (self ):
1330
1330
cdef RCP[const symengine.Subs] X = symengine.rcp_static_cast_Subs(self .thisptr)
@@ -1664,7 +1664,7 @@ cdef class DenseMatrix(MatrixBase):
1664
1664
# No error checking is done
1665
1665
cdef Basic e_ = sympify(e)
1666
1666
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)
1668
1668
1669
1669
def det (self ):
1670
1670
if self .nrows() != self .ncols():
@@ -1702,13 +1702,13 @@ cdef class DenseMatrix(MatrixBase):
1702
1702
def add_scalar (self , k ):
1703
1703
cdef Basic k_ = sympify(k)
1704
1704
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))
1706
1706
return result
1707
1707
1708
1708
def mul_scalar (self , k ):
1709
1709
cdef Basic k_ = sympify(k)
1710
1710
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))
1712
1712
return result
1713
1713
1714
1714
def transpose (self ):
@@ -2392,12 +2392,12 @@ def primitive_root_list(n):
2392
2392
def totient (n ):
2393
2393
cdef Integer _n = sympify(n)
2394
2394
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))
2396
2396
2397
2397
def carmichael (n ):
2398
2398
cdef Integer _n = sympify(n)
2399
2399
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))
2401
2401
2402
2402
def multiplicative_order (a , n ):
2403
2403
cdef Integer _n = sympify(n)
@@ -2406,7 +2406,7 @@ def multiplicative_order(a, n):
2406
2406
cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
2407
2407
cdef RCP[const symengine.Integer] o
2408
2408
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)
2410
2410
if not c:
2411
2411
return None
2412
2412
return c2py(< RCP[const symengine.Basic]> o)
@@ -2437,9 +2437,7 @@ def nthroot_mod(a, n, m):
2437
2437
cdef RCP[const symengine.Integer] n1 = symengine.rcp_static_cast_Integer(_n.thisptr)
2438
2438
cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
2439
2439
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)
2443
2441
if not ret_val:
2444
2442
return None
2445
2443
return c2py(< RCP[const symengine.Basic]> root)
@@ -2452,8 +2450,7 @@ def nthroot_mod_list(a, n, m):
2452
2450
cdef RCP[const symengine.Integer] n1 = symengine.rcp_static_cast_Integer(_n.thisptr)
2453
2451
cdef RCP[const symengine.Integer] a1 = symengine.rcp_static_cast_Integer(_a.thisptr)
2454
2452
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)
2457
2454
s = []
2458
2455
for i in range (root_list.size()):
2459
2456
s.append(c2py(< RCP[const symengine.Basic]> (root_list[i])))
@@ -2468,9 +2465,7 @@ def powermod(a, b, m):
2468
2465
cdef RCP[const symengine.Number] b1 = symengine.rcp_static_cast_Number(_b.thisptr)
2469
2466
cdef RCP[const symengine.Integer] root
2470
2467
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)
2474
2469
if ret_val == 0 :
2475
2470
return None
2476
2471
return c2py(< RCP[const symengine.Basic]> root)
@@ -2484,9 +2479,7 @@ def powermod_list(a, b, m):
2484
2479
cdef RCP[const symengine.Number] b1 = symengine.rcp_static_cast_Number(_b.thisptr)
2485
2480
cdef symengine.vec_integer v
2486
2481
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)
2490
2483
s = []
2491
2484
for i in range (v.size()):
2492
2485
s.append(c2py(< RCP[const symengine.Basic]> (v[i])))
@@ -2545,8 +2538,8 @@ def with_buffer(iterable, real=True):
2545
2538
try :
2546
2539
real_view = iterable
2547
2540
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' )
2550
2543
for i in range (_size(iterable)):
2551
2544
real_view[i] = iterable[i]
2552
2545
return real_view
@@ -2556,8 +2549,8 @@ def with_buffer(iterable, real=True):
2556
2549
try :
2557
2550
cmplx_view = iterable
2558
2551
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' )
2561
2554
for i in range (_size(iterable)):
2562
2555
cmplx_view[i] = iterable[i]
2563
2556
return cmplx_view
@@ -2762,11 +2755,11 @@ cdef class Lambdify(object):
2762
2755
self .real else np.complex128)
2763
2756
else :
2764
2757
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' )
2767
2760
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' )
2770
2763
reshape_out = len (new_out_shape) > 1
2771
2764
else :
2772
2765
if use_numpy:
@@ -2812,15 +2805,15 @@ cdef class Lambdify(object):
2812
2805
out = out.reshape(new_out_shape)
2813
2806
elif reshape_out:
2814
2807
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' )
2817
2810
real_out_view = out
2818
2811
memcpy(< double * > tmp.data, & real_out_view[0 ],
2819
2812
sizeof(double )* new_out_size)
2820
2813
out = tmp
2821
2814
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' )
2824
2817
cmplx_out_view = tmp
2825
2818
memcpy(< double complex * > tmp.data, & cmplx_out_view[0 ],
2826
2819
sizeof(double complex )* new_out_size)
0 commit comments