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