Skip to content

Commit c01bbd9

Browse files
committed
Revert "Merge pull request #291 from richardotis/master"
This reverts commit 45d649e, reversing changes made to d21ec88.
1 parent 9a30d58 commit c01bbd9

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

symengine/lib/symengine_wrapper.pxd

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,9 @@ cdef class _Lambdify(object):
3939

4040
cdef _init(self, symengine.vec_basic& args_, symengine.vec_basic& outs_, cppbool cse)
4141
cdef _load(self, const string &s)
42-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil
4342
cpdef unsafe_real(self,
4443
double[::1] inp, double[::1] out,
4544
int inp_offset=*, int out_offset=*)
46-
cdef void unsafe_complex_ptr(self, double complex *inp, double complex *out) nogil
4745
cpdef unsafe_complex(self, double complex[::1] inp, double complex[::1] out,
4846
int inp_offset=*, int out_offset=*)
4947
cpdef eval_real(self, inp, out)
@@ -53,9 +51,7 @@ cdef class LambdaDouble(_Lambdify):
5351
cdef vector[symengine.LambdaRealDoubleVisitor] lambda_double
5452
cdef vector[symengine.LambdaComplexDoubleVisitor] lambda_double_complex
5553
cdef _init(self, symengine.vec_basic& args_, symengine.vec_basic& outs_, cppbool cse)
56-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil
5754
cpdef unsafe_real(self, double[::1] inp, double[::1] out, int inp_offset=*, int out_offset=*)
58-
cdef void unsafe_complex_ptr(self, double complex *inp, double complex *out) nogil
5955
cpdef unsafe_complex(self, double complex[::1] inp, double complex[::1] out, int inp_offset=*, int out_offset=*)
6056
cpdef as_scipy_low_level_callable(self)
6157
cpdef as_ctypes(self)
@@ -65,7 +61,6 @@ IF HAVE_SYMENGINE_LLVM:
6561
cdef vector[symengine.LLVMDoubleVisitor] lambda_double
6662
cdef _init(self, symengine.vec_basic& args_, symengine.vec_basic& outs_, cppbool cse)
6763
cdef _load(self, const string &s)
68-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil
6964
cpdef unsafe_real(self, double[::1] inp, double[::1] out, int inp_offset=*, int out_offset=*)
7065
cpdef as_scipy_low_level_callable(self)
7166
cpdef as_ctypes(self)

symengine/lib/symengine_wrapper.pyx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4507,19 +4507,11 @@ cdef class _Lambdify(object):
45074507
cdef _load(self, const string &s):
45084508
raise ValueError("Not supported")
45094509

4510-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil:
4511-
with gil:
4512-
raise ValueError("Not supported")
4513-
45144510
cpdef unsafe_real(self,
45154511
double[::1] inp, double[::1] out,
45164512
int inp_offset=0, int out_offset=0):
45174513
raise ValueError("Not supported")
45184514

4519-
cdef void unsafe_complex_ptr(self, double complex *inp, double complex *out) nogil:
4520-
with gil:
4521-
raise ValueError("Not supported")
4522-
45234515
cpdef unsafe_complex(self, double complex[::1] inp, double complex[::1] out,
45244516
int inp_offset=0, int out_offset=0):
45254517
raise ValueError("Not supported")
@@ -4705,17 +4697,11 @@ cdef class LambdaDouble(_Lambdify):
47054697
self.lambda_double_complex.resize(1)
47064698
self.lambda_double_complex[0].init(args_, outs_, cse)
47074699

4708-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil:
4709-
self.lambda_double[0].call(out, inp)
4710-
47114700
cpdef unsafe_real(self, double[::1] inp, double[::1] out, int inp_offset=0, int out_offset=0):
4712-
self.unsafe_real_ptr(&inp[inp_offset], &out[out_offset])
4713-
4714-
cdef void unsafe_complex_ptr(self, double complex *inp, double complex *out) nogil:
4715-
self.lambda_double_complex[0].call(out, inp)
4701+
self.lambda_double[0].call(&out[out_offset], &inp[inp_offset])
47164702

47174703
cpdef unsafe_complex(self, double complex[::1] inp, double complex[::1] out, int inp_offset=0, int out_offset=0):
4718-
self.unsafe_complex_ptr(&inp[inp_offset], &out[out_offset])
4704+
self.lambda_double_complex[0].call(&out[out_offset], &inp[inp_offset])
47194705

47204706
cpdef as_scipy_low_level_callable(self):
47214707
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
@@ -4764,11 +4750,8 @@ IF HAVE_SYMENGINE_LLVM:
47644750
return llvm_loading_func, (self.args_size, self.tot_out_size, self.out_shapes, self.real, \
47654751
self.n_exprs, self.order, self.accum_out_sizes, self.numpy_dtype, s)
47664752

4767-
cdef void unsafe_real_ptr(self, double *inp, double *out) nogil:
4768-
self.lambda_double[0].call(out, inp)
4769-
47704753
cpdef unsafe_real(self, double[::1] inp, double[::1] out, int inp_offset=0, int out_offset=0):
4771-
self.unsafe_real_ptr(&inp[inp_offset], &out[out_offset])
4754+
self.lambda_double[0].call(&out[out_offset], &inp[inp_offset])
47724755

47734756
cpdef as_scipy_low_level_callable(self):
47744757
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE

0 commit comments

Comments
 (0)