1 from a.trajpoly5 cimport *
3 @cython.wraparound(False)
4 @cython.boundscheck(False)
5 @cython.auto_pickle(False)
8 def __init__(self, a_float ts, a_float p0, a_float p1, a_float v0 = 0, a_float v1 = 0, a_float a0 = 0, a_float a1 = 0):
9 a_trajpoly5_gen(&self.ctx, ts, p0, p1, v0, v1, a0, a1)
10 def gen(self, a_float ts, a_float p0, a_float p1, a_float v0 = 0, a_float v1 = 0, a_float a0 = 0, a_float a1 = 0):
11 a_trajpoly5_gen(&self.ctx, ts, p0, p1, v0, v1, a0, a1)
13 cdef inline pos_n(self, array dt):
15 cdef Py_ssize_t n = len(dt)
16 cdef a_float *p = <a_float *>dt.data.as_voidptr
17 for i in prange(n, nogil=True):
18 p[i] = a_trajpoly5_pos(&self.ctx, p[i])
22 return self.pos_n(array_num(dt))
23 return a_trajpoly5_pos(&self.ctx, dt)
24 cdef inline vel_n(self, array dt):
26 cdef Py_ssize_t n = len(dt)
27 cdef a_float *p = <a_float *>dt.data.as_voidptr
28 for i in prange(n, nogil=True):
29 p[i] = a_trajpoly5_vel(&self.ctx, p[i])
33 return self.vel_n(array_num(dt))
34 return a_trajpoly5_vel(&self.ctx, dt)
35 cdef inline acc_n(self, array dt):
37 cdef Py_ssize_t n = len(dt)
38 cdef a_float *p = <a_float *>dt.data.as_voidptr
39 for i in prange(n, nogil=True):
40 p[i] = a_trajpoly5_acc(&self.ctx, p[i])
44 return self.acc_n(array_num(dt))
45 return a_trajpoly5_acc(&self.ctx, dt)