@@ -4507,11 +4507,19 @@ cdef class _Lambdify(object):
4507
4507
cdef _load(self , const string & s):
4508
4508
raise ValueError (" Not supported" )
4509
4509
4510
+ cdef void unsafe_real_ptr(self , double * inp, double * out) nogil:
4511
+ with gil:
4512
+ raise ValueError (" Not supported" )
4513
+
4510
4514
cpdef unsafe_real(self ,
4511
4515
double [::1 ] inp, double [::1 ] out,
4512
4516
int inp_offset = 0 , int out_offset = 0 ):
4513
4517
raise ValueError (" Not supported" )
4514
4518
4519
+ cdef void unsafe_complex_ptr(self , double complex * inp, double complex * out) nogil:
4520
+ with gil:
4521
+ raise ValueError (" Not supported" )
4522
+
4515
4523
cpdef unsafe_complex(self , double complex [::1 ] inp, double complex [::1 ] out,
4516
4524
int inp_offset = 0 , int out_offset = 0 ):
4517
4525
raise ValueError (" Not supported" )
@@ -4690,11 +4698,17 @@ cdef class LambdaDouble(_Lambdify):
4690
4698
self .lambda_double_complex.resize(1 )
4691
4699
self .lambda_double_complex[0 ].init(args_, outs_, cse)
4692
4700
4701
+ cdef void unsafe_real_ptr(self , double * inp, double * out) nogil:
4702
+ self .lambda_double[0 ].call(out, inp)
4703
+
4693
4704
cpdef unsafe_real(self , double [::1 ] inp, double [::1 ] out, int inp_offset = 0 , int out_offset = 0 ):
4694
- self .lambda_double[0 ].call(& out[out_offset], & inp[inp_offset])
4705
+ self .unsafe_real_ptr(& inp[inp_offset], & out[out_offset])
4706
+
4707
+ cdef void unsafe_complex_ptr(self , double complex * inp, double complex * out) nogil:
4708
+ self .lambda_double_complex[0 ].call(out, inp)
4695
4709
4696
4710
cpdef unsafe_complex(self , double complex [::1 ] inp, double complex [::1 ] out, int inp_offset = 0 , int out_offset = 0 ):
4697
- self .lambda_double_complex[ 0 ].call( & out[out_offset ], & inp[inp_offset ])
4711
+ self .unsafe_complex_ptr( & inp[inp_offset ], & out[out_offset ])
4698
4712
4699
4713
cpdef as_scipy_low_level_callable(self ):
4700
4714
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
@@ -4726,8 +4740,11 @@ IF HAVE_SYMENGINE_LLVM:
4726
4740
return llvm_loading_func, (self .args_size, self .tot_out_size, self .out_shapes, self .real, \
4727
4741
self .n_exprs, self .order, self .accum_out_sizes, self .numpy_dtype, s)
4728
4742
4743
+ cdef void unsafe_real_ptr(self , double * inp, double * out) nogil:
4744
+ self .lambda_double[0 ].call(out, inp)
4745
+
4729
4746
cpdef unsafe_real(self , double [::1 ] inp, double [::1 ] out, int inp_offset = 0 , int out_offset = 0 ):
4730
- self .lambda_double[ 0 ].call( & out[out_offset ], & inp[inp_offset ])
4747
+ self .unsafe_real_ptr( & inp[inp_offset ], & out[out_offset ])
4731
4748
4732
4749
cpdef as_scipy_low_level_callable(self ):
4733
4750
from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
0 commit comments