@@ -4507,11 +4507,19 @@ 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+
45104514 cpdef unsafe_real(self ,
45114515 double [::1 ] inp, double [::1 ] out,
45124516 int inp_offset = 0 , int out_offset = 0 ):
45134517 raise ValueError (" Not supported" )
45144518
4519+ cdef void unsafe_complex_ptr(self , double complex * inp, double complex * out) nogil:
4520+ with gil:
4521+ raise ValueError (" Not supported" )
4522+
45154523 cpdef unsafe_complex(self , double complex [::1 ] inp, double complex [::1 ] out,
45164524 int inp_offset = 0 , int out_offset = 0 ):
45174525 raise ValueError (" Not supported" )
@@ -4690,11 +4698,17 @@ cdef class LambdaDouble(_Lambdify):
46904698 self .lambda_double_complex.resize(1 )
46914699 self .lambda_double_complex[0 ].init(args_, outs_, cse)
46924700
4701+ cdef void unsafe_real_ptr(self , double * inp, double * out) nogil:
4702+ self .lambda_double[0 ].call(out, inp)
4703+
46934704 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)
46954709
46964710 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 ])
46984712
46994713 cpdef as_scipy_low_level_callable(self ):
47004714 from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
@@ -4726,8 +4740,11 @@ IF HAVE_SYMENGINE_LLVM:
47264740 return llvm_loading_func, (self .args_size, self .tot_out_size, self .out_shapes, self .real, \
47274741 self .n_exprs, self .order, self .accum_out_sizes, self .numpy_dtype, s)
47284742
4743+ cdef void unsafe_real_ptr(self , double * inp, double * out) nogil:
4744+ self .lambda_double[0 ].call(out, inp)
4745+
47294746 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 ])
47314748
47324749 cpdef as_scipy_low_level_callable(self ):
47334750 from ctypes import c_double, c_void_p, c_int, cast, POINTER, CFUNCTYPE
0 commit comments