1 /* Generated by Cython 0.29.21 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6     #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8     #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_21"
11 #define CYTHON_HEX_VERSION 0x001D15F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18   #ifndef __stdcall
19     #define __stdcall
20   #endif
21   #ifndef __cdecl
22     #define __cdecl
23   #endif
24   #ifndef __fastcall
25     #define __fastcall
26   #endif
27 #endif
28 #ifndef DL_IMPORT
29   #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32   #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36   #if PY_VERSION_HEX >= 0x02070000
37     #define HAVE_LONG_LONG
38   #endif
39 #endif
40 #ifndef PY_LONG_LONG
41   #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44   #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47   #define CYTHON_COMPILING_IN_PYPY 1
48   #define CYTHON_COMPILING_IN_PYSTON 0
49   #define CYTHON_COMPILING_IN_CPYTHON 0
50   #undef CYTHON_USE_TYPE_SLOTS
51   #define CYTHON_USE_TYPE_SLOTS 0
52   #undef CYTHON_USE_PYTYPE_LOOKUP
53   #define CYTHON_USE_PYTYPE_LOOKUP 0
54   #if PY_VERSION_HEX < 0x03050000
55     #undef CYTHON_USE_ASYNC_SLOTS
56     #define CYTHON_USE_ASYNC_SLOTS 0
57   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58     #define CYTHON_USE_ASYNC_SLOTS 1
59   #endif
60   #undef CYTHON_USE_PYLIST_INTERNALS
61   #define CYTHON_USE_PYLIST_INTERNALS 0
62   #undef CYTHON_USE_UNICODE_INTERNALS
63   #define CYTHON_USE_UNICODE_INTERNALS 0
64   #undef CYTHON_USE_UNICODE_WRITER
65   #define CYTHON_USE_UNICODE_WRITER 0
66   #undef CYTHON_USE_PYLONG_INTERNALS
67   #define CYTHON_USE_PYLONG_INTERNALS 0
68   #undef CYTHON_AVOID_BORROWED_REFS
69   #define CYTHON_AVOID_BORROWED_REFS 1
70   #undef CYTHON_ASSUME_SAFE_MACROS
71   #define CYTHON_ASSUME_SAFE_MACROS 0
72   #undef CYTHON_UNPACK_METHODS
73   #define CYTHON_UNPACK_METHODS 0
74   #undef CYTHON_FAST_THREAD_STATE
75   #define CYTHON_FAST_THREAD_STATE 0
76   #undef CYTHON_FAST_PYCALL
77   #define CYTHON_FAST_PYCALL 0
78   #undef CYTHON_PEP489_MULTI_PHASE_INIT
79   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80   #undef CYTHON_USE_TP_FINALIZE
81   #define CYTHON_USE_TP_FINALIZE 0
82   #undef CYTHON_USE_DICT_VERSIONS
83   #define CYTHON_USE_DICT_VERSIONS 0
84   #undef CYTHON_USE_EXC_INFO_STACK
85   #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87   #define CYTHON_COMPILING_IN_PYPY 0
88   #define CYTHON_COMPILING_IN_PYSTON 1
89   #define CYTHON_COMPILING_IN_CPYTHON 0
90   #ifndef CYTHON_USE_TYPE_SLOTS
91     #define CYTHON_USE_TYPE_SLOTS 1
92   #endif
93   #undef CYTHON_USE_PYTYPE_LOOKUP
94   #define CYTHON_USE_PYTYPE_LOOKUP 0
95   #undef CYTHON_USE_ASYNC_SLOTS
96   #define CYTHON_USE_ASYNC_SLOTS 0
97   #undef CYTHON_USE_PYLIST_INTERNALS
98   #define CYTHON_USE_PYLIST_INTERNALS 0
99   #ifndef CYTHON_USE_UNICODE_INTERNALS
100     #define CYTHON_USE_UNICODE_INTERNALS 1
101   #endif
102   #undef CYTHON_USE_UNICODE_WRITER
103   #define CYTHON_USE_UNICODE_WRITER 0
104   #undef CYTHON_USE_PYLONG_INTERNALS
105   #define CYTHON_USE_PYLONG_INTERNALS 0
106   #ifndef CYTHON_AVOID_BORROWED_REFS
107     #define CYTHON_AVOID_BORROWED_REFS 0
108   #endif
109   #ifndef CYTHON_ASSUME_SAFE_MACROS
110     #define CYTHON_ASSUME_SAFE_MACROS 1
111   #endif
112   #ifndef CYTHON_UNPACK_METHODS
113     #define CYTHON_UNPACK_METHODS 1
114   #endif
115   #undef CYTHON_FAST_THREAD_STATE
116   #define CYTHON_FAST_THREAD_STATE 0
117   #undef CYTHON_FAST_PYCALL
118   #define CYTHON_FAST_PYCALL 0
119   #undef CYTHON_PEP489_MULTI_PHASE_INIT
120   #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121   #undef CYTHON_USE_TP_FINALIZE
122   #define CYTHON_USE_TP_FINALIZE 0
123   #undef CYTHON_USE_DICT_VERSIONS
124   #define CYTHON_USE_DICT_VERSIONS 0
125   #undef CYTHON_USE_EXC_INFO_STACK
126   #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128   #define CYTHON_COMPILING_IN_PYPY 0
129   #define CYTHON_COMPILING_IN_PYSTON 0
130   #define CYTHON_COMPILING_IN_CPYTHON 1
131   #ifndef CYTHON_USE_TYPE_SLOTS
132     #define CYTHON_USE_TYPE_SLOTS 1
133   #endif
134   #if PY_VERSION_HEX < 0x02070000
135     #undef CYTHON_USE_PYTYPE_LOOKUP
136     #define CYTHON_USE_PYTYPE_LOOKUP 0
137   #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138     #define CYTHON_USE_PYTYPE_LOOKUP 1
139   #endif
140   #if PY_MAJOR_VERSION < 3
141     #undef CYTHON_USE_ASYNC_SLOTS
142     #define CYTHON_USE_ASYNC_SLOTS 0
143   #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144     #define CYTHON_USE_ASYNC_SLOTS 1
145   #endif
146   #if PY_VERSION_HEX < 0x02070000
147     #undef CYTHON_USE_PYLONG_INTERNALS
148     #define CYTHON_USE_PYLONG_INTERNALS 0
149   #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150     #define CYTHON_USE_PYLONG_INTERNALS 1
151   #endif
152   #ifndef CYTHON_USE_PYLIST_INTERNALS
153     #define CYTHON_USE_PYLIST_INTERNALS 1
154   #endif
155   #ifndef CYTHON_USE_UNICODE_INTERNALS
156     #define CYTHON_USE_UNICODE_INTERNALS 1
157   #endif
158   #if PY_VERSION_HEX < 0x030300F0
159     #undef CYTHON_USE_UNICODE_WRITER
160     #define CYTHON_USE_UNICODE_WRITER 0
161   #elif !defined(CYTHON_USE_UNICODE_WRITER)
162     #define CYTHON_USE_UNICODE_WRITER 1
163   #endif
164   #ifndef CYTHON_AVOID_BORROWED_REFS
165     #define CYTHON_AVOID_BORROWED_REFS 0
166   #endif
167   #ifndef CYTHON_ASSUME_SAFE_MACROS
168     #define CYTHON_ASSUME_SAFE_MACROS 1
169   #endif
170   #ifndef CYTHON_UNPACK_METHODS
171     #define CYTHON_UNPACK_METHODS 1
172   #endif
173   #ifndef CYTHON_FAST_THREAD_STATE
174     #define CYTHON_FAST_THREAD_STATE 1
175   #endif
176   #ifndef CYTHON_FAST_PYCALL
177     #define CYTHON_FAST_PYCALL 1
178   #endif
179   #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180     #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181   #endif
182   #ifndef CYTHON_USE_TP_FINALIZE
183     #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184   #endif
185   #ifndef CYTHON_USE_DICT_VERSIONS
186     #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187   #endif
188   #ifndef CYTHON_USE_EXC_INFO_STACK
189     #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190   #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196   #include "longintrepr.h"
197   #undef SHIFT
198   #undef BASE
199   #undef MASK
200   #ifdef SIZEOF_VOID_P
201     enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202   #endif
203 #endif
204 #ifndef __has_attribute
205   #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208   #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211   #if defined(__GNUC__)
212     #define CYTHON_RESTRICT __restrict__
213   #elif defined(_MSC_VER) && _MSC_VER >= 1400
214     #define CYTHON_RESTRICT __restrict
215   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216     #define CYTHON_RESTRICT restrict
217   #else
218     #define CYTHON_RESTRICT
219   #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 #     define CYTHON_UNUSED __attribute__ ((__unused__))
225 #   else
226 #     define CYTHON_UNUSED
227 #   endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 #   define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 #   define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 #  if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236      template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 #  else
238 #    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 #  endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 #  define CYTHON_NCP_UNUSED
244 # else
245 #  define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250     #ifndef _MSC_STDINT_H_
251         #if _MSC_VER < 1300
252            typedef unsigned char     uint8_t;
253            typedef unsigned int      uint32_t;
254         #else
255            typedef unsigned __int8   uint8_t;
256            typedef unsigned __int32  uint32_t;
257         #endif
258     #endif
259 #else
260    #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263   #if defined(__cplusplus) && __cplusplus >= 201103L
264     #if __has_cpp_attribute(fallthrough)
265       #define CYTHON_FALLTHROUGH [[fallthrough]]
266     #elif __has_cpp_attribute(clang::fallthrough)
267       #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268     #elif __has_cpp_attribute(gnu::fallthrough)
269       #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270     #endif
271   #endif
272   #ifndef CYTHON_FALLTHROUGH
273     #if __has_attribute(fallthrough)
274       #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275     #else
276       #define CYTHON_FALLTHROUGH
277     #endif
278   #endif
279   #if defined(__clang__ ) && defined(__apple_build_version__)
280     #if __apple_build_version__ < 7000000
281       #undef  CYTHON_FALLTHROUGH
282       #define CYTHON_FALLTHROUGH
283     #endif
284   #endif
285 #endif
286 
287 #ifndef CYTHON_INLINE
288   #if defined(__clang__)
289     #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290   #elif defined(__GNUC__)
291     #define CYTHON_INLINE __inline__
292   #elif defined(_MSC_VER)
293     #define CYTHON_INLINE __inline
294   #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295     #define CYTHON_INLINE inline
296   #else
297     #define CYTHON_INLINE
298   #endif
299 #endif
300 
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302   #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307   #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309           PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310   #define __Pyx_DefaultClassType PyClass_Type
311 #else
312   #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315           PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317   #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320   #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323   #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326   #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329   #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332   #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335   #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338   #ifndef METH_FASTCALL
339      #define METH_FASTCALL 0x80
340   #endif
341   typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342   typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343                                                           Py_ssize_t nargs, PyObject *kwnames);
344 #else
345   #define __Pyx_PyCFunctionFast _PyCFunctionFast
346   #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350     ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355   #define PyObject_Malloc(s)   PyMem_Malloc(s)
356   #define PyObject_Free(p)     PyMem_Free(p)
357   #define PyObject_Realloc(p)  PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360   #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
361   #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
362   #define PyMem_RawFree(p)             PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365   #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
366   #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368   #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
369   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372   #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374   #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376   #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378   #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385   *key = PyThread_create_key();
386   return 0;
387 }
PyThread_tss_alloc(void)388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389   Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390   *key = Py_tss_NEEDS_INIT;
391   return key;
392 }
PyThread_tss_free(Py_tss_t * key)393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394   PyObject_Free(key);
395 }
PyThread_tss_is_created(Py_tss_t * key)396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397   return *key != Py_tss_NEEDS_INIT;
398 }
PyThread_tss_delete(Py_tss_t * key)399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400   PyThread_delete_key(*key);
401   *key = Py_tss_NEEDS_INIT;
402 }
PyThread_tss_set(Py_tss_t * key,void * value)403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404   return PyThread_set_key_value(*key, value);
405 }
PyThread_tss_get(Py_tss_t * key)406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407   return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n)  PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
417   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
418 #else
419   #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
420   #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428   #define CYTHON_PEP393_ENABLED 1
429   #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
430                                               0 : _PyUnicode_Ready((PyObject *)(op)))
431   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
432   #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
434   #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
435   #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
436   #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
437   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
438   #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
439   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
440   #else
441   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
442   #endif
443 #else
444   #define CYTHON_PEP393_ENABLED 0
445   #define PyUnicode_1BYTE_KIND  1
446   #define PyUnicode_2BYTE_KIND  2
447   #define PyUnicode_4BYTE_KIND  4
448   #define __Pyx_PyUnicode_READY(op)       (0)
449   #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
450   #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
451   #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
452   #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
453   #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
454   #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
455   #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
456   #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
457 #endif
458 #if CYTHON_COMPILING_IN_PYPY
459   #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
460   #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
461 #else
462   #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
463   #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
464       PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
465 #endif
466 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
467   #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
468 #endif
469 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
470   #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
471 #endif
472 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
473   #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
474 #endif
475 #define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
476 #define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
477 #if PY_MAJOR_VERSION >= 3
478   #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
479 #else
480   #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
481 #endif
482 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
483   #define PyObject_ASCII(o)            PyObject_Repr(o)
484 #endif
485 #if PY_MAJOR_VERSION >= 3
486   #define PyBaseString_Type            PyUnicode_Type
487   #define PyStringObject               PyUnicodeObject
488   #define PyString_Type                PyUnicode_Type
489   #define PyString_Check               PyUnicode_Check
490   #define PyString_CheckExact          PyUnicode_CheckExact
491 #ifndef PyObject_Unicode
492   #define PyObject_Unicode             PyObject_Str
493 #endif
494 #endif
495 #if PY_MAJOR_VERSION >= 3
496   #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
497   #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
498 #else
499   #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
500   #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
501 #endif
502 #ifndef PySet_CheckExact
503   #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
504 #endif
505 #if PY_VERSION_HEX >= 0x030900A4
506   #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
507   #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
508 #else
509   #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
510   #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
511 #endif
512 #if CYTHON_ASSUME_SAFE_MACROS
513   #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
514 #else
515   #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
516 #endif
517 #if PY_MAJOR_VERSION >= 3
518   #define PyIntObject                  PyLongObject
519   #define PyInt_Type                   PyLong_Type
520   #define PyInt_Check(op)              PyLong_Check(op)
521   #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
522   #define PyInt_FromString             PyLong_FromString
523   #define PyInt_FromUnicode            PyLong_FromUnicode
524   #define PyInt_FromLong               PyLong_FromLong
525   #define PyInt_FromSize_t             PyLong_FromSize_t
526   #define PyInt_FromSsize_t            PyLong_FromSsize_t
527   #define PyInt_AsLong                 PyLong_AsLong
528   #define PyInt_AS_LONG                PyLong_AS_LONG
529   #define PyInt_AsSsize_t              PyLong_AsSsize_t
530   #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
531   #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
532   #define PyNumber_Int                 PyNumber_Long
533 #endif
534 #if PY_MAJOR_VERSION >= 3
535   #define PyBoolObject                 PyLongObject
536 #endif
537 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
538   #ifndef PyUnicode_InternFromString
539     #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
540   #endif
541 #endif
542 #if PY_VERSION_HEX < 0x030200A4
543   typedef long Py_hash_t;
544   #define __Pyx_PyInt_FromHash_t PyInt_FromLong
545   #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
546 #else
547   #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
548   #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
549 #endif
550 #if PY_MAJOR_VERSION >= 3
551   #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
552 #else
553   #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
554 #endif
555 #if CYTHON_USE_ASYNC_SLOTS
556   #if PY_VERSION_HEX >= 0x030500B1
557     #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
558     #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
559   #else
560     #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
561   #endif
562 #else
563   #define __Pyx_PyType_AsAsync(obj) NULL
564 #endif
565 #ifndef __Pyx_PyAsyncMethodsStruct
566     typedef struct {
567         unaryfunc am_await;
568         unaryfunc am_aiter;
569         unaryfunc am_anext;
570     } __Pyx_PyAsyncMethodsStruct;
571 #endif
572 
573 #if defined(WIN32) || defined(MS_WINDOWS)
574   #define _USE_MATH_DEFINES
575 #endif
576 #include <math.h>
577 #ifdef NAN
578 #define __PYX_NAN() ((float) NAN)
579 #else
__PYX_NAN()580 static CYTHON_INLINE float __PYX_NAN() {
581   float value;
582   memset(&value, 0xFF, sizeof(value));
583   return value;
584 }
585 #endif
586 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
587 #define __Pyx_truncl trunc
588 #else
589 #define __Pyx_truncl truncl
590 #endif
591 
592 #define __PYX_MARK_ERR_POS(f_index, lineno) \
593     { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
594 #define __PYX_ERR(f_index, lineno, Ln_error) \
595     { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
596 
597 #ifndef __PYX_EXTERN_C
598   #ifdef __cplusplus
599     #define __PYX_EXTERN_C extern "C"
600   #else
601     #define __PYX_EXTERN_C extern
602   #endif
603 #endif
604 
605 #define __PYX_HAVE__GPy__models__state_space_cython
606 #define __PYX_HAVE_API__GPy__models__state_space_cython
607 /* Early includes */
608 #include <string.h>
609 #include <stdio.h>
610 #include "numpy/arrayobject.h"
611 #include "numpy/ndarrayobject.h"
612 #include "numpy/ndarraytypes.h"
613 #include "numpy/arrayscalars.h"
614 #include "numpy/ufuncobject.h"
615 
616     /* NumPy API declarations from "numpy/__init__.pxd" */
617 
618 #include "numpy/npy_math.h"
619 #ifdef _OPENMP
620 #include <omp.h>
621 #endif /* _OPENMP */
622 
623 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
624 #define CYTHON_WITHOUT_ASSERTIONS
625 #endif
626 
627 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
628                 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
629 
630 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
631 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
632 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
633 #define __PYX_DEFAULT_STRING_ENCODING ""
634 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
635 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
636 #define __Pyx_uchar_cast(c) ((unsigned char)c)
637 #define __Pyx_long_cast(x) ((long)x)
638 #define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
639     (sizeof(type) < sizeof(Py_ssize_t))  ||\
640     (sizeof(type) > sizeof(Py_ssize_t) &&\
641           likely(v < (type)PY_SSIZE_T_MAX ||\
642                  v == (type)PY_SSIZE_T_MAX)  &&\
643           (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
644                                 v == (type)PY_SSIZE_T_MIN)))  ||\
645     (sizeof(type) == sizeof(Py_ssize_t) &&\
646           (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
647                                v == (type)PY_SSIZE_T_MAX)))  )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)648 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
649     return (size_t) i < (size_t) limit;
650 }
651 #if defined (__cplusplus) && __cplusplus >= 201103L
652     #include <cstdlib>
653     #define __Pyx_sst_abs(value) std::abs(value)
654 #elif SIZEOF_INT >= SIZEOF_SIZE_T
655     #define __Pyx_sst_abs(value) abs(value)
656 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
657     #define __Pyx_sst_abs(value) labs(value)
658 #elif defined (_MSC_VER)
659     #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
660 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
661     #define __Pyx_sst_abs(value) llabs(value)
662 #elif defined (__GNUC__)
663     #define __Pyx_sst_abs(value) __builtin_llabs(value)
664 #else
665     #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
666 #endif
667 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
668 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
669 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
670 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
671 #define __Pyx_PyBytes_FromString        PyBytes_FromString
672 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
673 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
674 #if PY_MAJOR_VERSION < 3
675     #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
676     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
677 #else
678     #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
679     #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
680 #endif
681 #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
682 #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
683 #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
684 #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
685 #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
686 #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
687 #define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
688 #define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
689 #define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
690 #define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
691 #define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
692 #define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
693 #define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
694 #define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
695 #define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
696 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)697 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
698     const Py_UNICODE *u_end = u;
699     while (*u_end++) ;
700     return (size_t)(u_end - u - 1);
701 }
702 #define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
703 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
704 #define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
705 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
706 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
707 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
708 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
709 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
710 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
711 #define __Pyx_PySequence_Tuple(obj)\
712     (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
713 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
714 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
715 #if CYTHON_ASSUME_SAFE_MACROS
716 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
717 #else
718 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
719 #endif
720 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
721 #if PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
723 #else
724 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
725 #endif
726 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
727 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
728 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)729 static int __Pyx_init_sys_getdefaultencoding_params(void) {
730     PyObject* sys;
731     PyObject* default_encoding = NULL;
732     PyObject* ascii_chars_u = NULL;
733     PyObject* ascii_chars_b = NULL;
734     const char* default_encoding_c;
735     sys = PyImport_ImportModule("sys");
736     if (!sys) goto bad;
737     default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
738     Py_DECREF(sys);
739     if (!default_encoding) goto bad;
740     default_encoding_c = PyBytes_AsString(default_encoding);
741     if (!default_encoding_c) goto bad;
742     if (strcmp(default_encoding_c, "ascii") == 0) {
743         __Pyx_sys_getdefaultencoding_not_ascii = 0;
744     } else {
745         char ascii_chars[128];
746         int c;
747         for (c = 0; c < 128; c++) {
748             ascii_chars[c] = c;
749         }
750         __Pyx_sys_getdefaultencoding_not_ascii = 1;
751         ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
752         if (!ascii_chars_u) goto bad;
753         ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
754         if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
755             PyErr_Format(
756                 PyExc_ValueError,
757                 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
758                 default_encoding_c);
759             goto bad;
760         }
761         Py_DECREF(ascii_chars_u);
762         Py_DECREF(ascii_chars_b);
763     }
764     Py_DECREF(default_encoding);
765     return 0;
766 bad:
767     Py_XDECREF(default_encoding);
768     Py_XDECREF(ascii_chars_u);
769     Py_XDECREF(ascii_chars_b);
770     return -1;
771 }
772 #endif
773 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
774 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
775 #else
776 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
777 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
778 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)779 static int __Pyx_init_sys_getdefaultencoding_params(void) {
780     PyObject* sys;
781     PyObject* default_encoding = NULL;
782     char* default_encoding_c;
783     sys = PyImport_ImportModule("sys");
784     if (!sys) goto bad;
785     default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
786     Py_DECREF(sys);
787     if (!default_encoding) goto bad;
788     default_encoding_c = PyBytes_AsString(default_encoding);
789     if (!default_encoding_c) goto bad;
790     __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
791     if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
792     strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
793     Py_DECREF(default_encoding);
794     return 0;
795 bad:
796     Py_XDECREF(default_encoding);
797     return -1;
798 }
799 #endif
800 #endif
801 
802 
803 /* Test for GCC > 2.95 */
804 #if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
805   #define likely(x)   __builtin_expect(!!(x), 1)
806   #define unlikely(x) __builtin_expect(!!(x), 0)
807 #else /* !__GNUC__ or GCC < 2.95 */
808   #define likely(x)   (x)
809   #define unlikely(x) (x)
810 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)811 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
812 
813 static PyObject *__pyx_m = NULL;
814 static PyObject *__pyx_d;
815 static PyObject *__pyx_b;
816 static PyObject *__pyx_cython_runtime = NULL;
817 static PyObject *__pyx_empty_tuple;
818 static PyObject *__pyx_empty_bytes;
819 static PyObject *__pyx_empty_unicode;
820 static int __pyx_lineno;
821 static int __pyx_clineno = 0;
822 static const char * __pyx_cfilenm= __FILE__;
823 static const char *__pyx_filename;
824 
825 /* Header.proto */
826 #if !defined(CYTHON_CCOMPLEX)
827   #if defined(__cplusplus)
828     #define CYTHON_CCOMPLEX 1
829   #elif defined(_Complex_I)
830     #define CYTHON_CCOMPLEX 1
831   #else
832     #define CYTHON_CCOMPLEX 0
833   #endif
834 #endif
835 #if CYTHON_CCOMPLEX
836   #ifdef __cplusplus
837     #include <complex>
838   #else
839     #include <complex.h>
840   #endif
841 #endif
842 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
843   #undef _Complex_I
844   #define _Complex_I 1.0fj
845 #endif
846 
847 
848 static const char *__pyx_f[] = {
849   "GPy/models/state_space_cython.pyx",
850   "stringsource",
851   "__init__.pxd",
852   "type.pxd",
853 };
854 /* BufferFormatStructs.proto */
855 #define IS_UNSIGNED(type) (((type) -1) > 0)
856 struct __Pyx_StructField_;
857 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
858 typedef struct {
859   const char* name;
860   struct __Pyx_StructField_* fields;
861   size_t size;
862   size_t arraysize[8];
863   int ndim;
864   char typegroup;
865   char is_unsigned;
866   int flags;
867 } __Pyx_TypeInfo;
868 typedef struct __Pyx_StructField_ {
869   __Pyx_TypeInfo* type;
870   const char* name;
871   size_t offset;
872 } __Pyx_StructField;
873 typedef struct {
874   __Pyx_StructField* field;
875   size_t parent_offset;
876 } __Pyx_BufFmt_StackElem;
877 typedef struct {
878   __Pyx_StructField root;
879   __Pyx_BufFmt_StackElem* head;
880   size_t fmt_offset;
881   size_t new_count, enc_count;
882   size_t struct_alignment;
883   int is_complex;
884   char enc_type;
885   char new_packmode;
886   char enc_packmode;
887   char is_valid_array;
888 } __Pyx_BufFmt_Context;
889 
890 
891 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":690
892  * # in Cython to enable them only on the right systems.
893  *
894  * ctypedef npy_int8       int8_t             # <<<<<<<<<<<<<<
895  * ctypedef npy_int16      int16_t
896  * ctypedef npy_int32      int32_t
897  */
898 typedef npy_int8 __pyx_t_5numpy_int8_t;
899 
900 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":691
901  *
902  * ctypedef npy_int8       int8_t
903  * ctypedef npy_int16      int16_t             # <<<<<<<<<<<<<<
904  * ctypedef npy_int32      int32_t
905  * ctypedef npy_int64      int64_t
906  */
907 typedef npy_int16 __pyx_t_5numpy_int16_t;
908 
909 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":692
910  * ctypedef npy_int8       int8_t
911  * ctypedef npy_int16      int16_t
912  * ctypedef npy_int32      int32_t             # <<<<<<<<<<<<<<
913  * ctypedef npy_int64      int64_t
914  * #ctypedef npy_int96      int96_t
915  */
916 typedef npy_int32 __pyx_t_5numpy_int32_t;
917 
918 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":693
919  * ctypedef npy_int16      int16_t
920  * ctypedef npy_int32      int32_t
921  * ctypedef npy_int64      int64_t             # <<<<<<<<<<<<<<
922  * #ctypedef npy_int96      int96_t
923  * #ctypedef npy_int128     int128_t
924  */
925 typedef npy_int64 __pyx_t_5numpy_int64_t;
926 
927 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":697
928  * #ctypedef npy_int128     int128_t
929  *
930  * ctypedef npy_uint8      uint8_t             # <<<<<<<<<<<<<<
931  * ctypedef npy_uint16     uint16_t
932  * ctypedef npy_uint32     uint32_t
933  */
934 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
935 
936 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":698
937  *
938  * ctypedef npy_uint8      uint8_t
939  * ctypedef npy_uint16     uint16_t             # <<<<<<<<<<<<<<
940  * ctypedef npy_uint32     uint32_t
941  * ctypedef npy_uint64     uint64_t
942  */
943 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
944 
945 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":699
946  * ctypedef npy_uint8      uint8_t
947  * ctypedef npy_uint16     uint16_t
948  * ctypedef npy_uint32     uint32_t             # <<<<<<<<<<<<<<
949  * ctypedef npy_uint64     uint64_t
950  * #ctypedef npy_uint96     uint96_t
951  */
952 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
953 
954 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":700
955  * ctypedef npy_uint16     uint16_t
956  * ctypedef npy_uint32     uint32_t
957  * ctypedef npy_uint64     uint64_t             # <<<<<<<<<<<<<<
958  * #ctypedef npy_uint96     uint96_t
959  * #ctypedef npy_uint128    uint128_t
960  */
961 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
962 
963 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":704
964  * #ctypedef npy_uint128    uint128_t
965  *
966  * ctypedef npy_float32    float32_t             # <<<<<<<<<<<<<<
967  * ctypedef npy_float64    float64_t
968  * #ctypedef npy_float80    float80_t
969  */
970 typedef npy_float32 __pyx_t_5numpy_float32_t;
971 
972 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":705
973  *
974  * ctypedef npy_float32    float32_t
975  * ctypedef npy_float64    float64_t             # <<<<<<<<<<<<<<
976  * #ctypedef npy_float80    float80_t
977  * #ctypedef npy_float128   float128_t
978  */
979 typedef npy_float64 __pyx_t_5numpy_float64_t;
980 
981 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":714
982  * # The int types are mapped a bit surprising --
983  * # numpy.int corresponds to 'l' and numpy.long to 'q'
984  * ctypedef npy_long       int_t             # <<<<<<<<<<<<<<
985  * ctypedef npy_longlong   long_t
986  * ctypedef npy_longlong   longlong_t
987  */
988 typedef npy_long __pyx_t_5numpy_int_t;
989 
990 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":715
991  * # numpy.int corresponds to 'l' and numpy.long to 'q'
992  * ctypedef npy_long       int_t
993  * ctypedef npy_longlong   long_t             # <<<<<<<<<<<<<<
994  * ctypedef npy_longlong   longlong_t
995  *
996  */
997 typedef npy_longlong __pyx_t_5numpy_long_t;
998 
999 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":716
1000  * ctypedef npy_long       int_t
1001  * ctypedef npy_longlong   long_t
1002  * ctypedef npy_longlong   longlong_t             # <<<<<<<<<<<<<<
1003  *
1004  * ctypedef npy_ulong      uint_t
1005  */
1006 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1007 
1008 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":718
1009  * ctypedef npy_longlong   longlong_t
1010  *
1011  * ctypedef npy_ulong      uint_t             # <<<<<<<<<<<<<<
1012  * ctypedef npy_ulonglong  ulong_t
1013  * ctypedef npy_ulonglong  ulonglong_t
1014  */
1015 typedef npy_ulong __pyx_t_5numpy_uint_t;
1016 
1017 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":719
1018  *
1019  * ctypedef npy_ulong      uint_t
1020  * ctypedef npy_ulonglong  ulong_t             # <<<<<<<<<<<<<<
1021  * ctypedef npy_ulonglong  ulonglong_t
1022  *
1023  */
1024 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1025 
1026 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":720
1027  * ctypedef npy_ulong      uint_t
1028  * ctypedef npy_ulonglong  ulong_t
1029  * ctypedef npy_ulonglong  ulonglong_t             # <<<<<<<<<<<<<<
1030  *
1031  * ctypedef npy_intp       intp_t
1032  */
1033 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1034 
1035 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":722
1036  * ctypedef npy_ulonglong  ulonglong_t
1037  *
1038  * ctypedef npy_intp       intp_t             # <<<<<<<<<<<<<<
1039  * ctypedef npy_uintp      uintp_t
1040  *
1041  */
1042 typedef npy_intp __pyx_t_5numpy_intp_t;
1043 
1044 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":723
1045  *
1046  * ctypedef npy_intp       intp_t
1047  * ctypedef npy_uintp      uintp_t             # <<<<<<<<<<<<<<
1048  *
1049  * ctypedef npy_double     float_t
1050  */
1051 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1052 
1053 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":725
1054  * ctypedef npy_uintp      uintp_t
1055  *
1056  * ctypedef npy_double     float_t             # <<<<<<<<<<<<<<
1057  * ctypedef npy_double     double_t
1058  * ctypedef npy_longdouble longdouble_t
1059  */
1060 typedef npy_double __pyx_t_5numpy_float_t;
1061 
1062 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":726
1063  *
1064  * ctypedef npy_double     float_t
1065  * ctypedef npy_double     double_t             # <<<<<<<<<<<<<<
1066  * ctypedef npy_longdouble longdouble_t
1067  *
1068  */
1069 typedef npy_double __pyx_t_5numpy_double_t;
1070 
1071 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":727
1072  * ctypedef npy_double     float_t
1073  * ctypedef npy_double     double_t
1074  * ctypedef npy_longdouble longdouble_t             # <<<<<<<<<<<<<<
1075  *
1076  * ctypedef npy_cfloat      cfloat_t
1077  */
1078 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1079 
1080 /* "GPy/models/state_space_cython.pyx":17
1081  * DTYPE_int = np.int64
1082  *
1083  * ctypedef np.float64_t DTYPE_t             # <<<<<<<<<<<<<<
1084  * ctypedef np.int64_t DTYPE_int_t
1085  *
1086  */
1087 typedef __pyx_t_5numpy_float64_t __pyx_t_3GPy_6models_18state_space_cython_DTYPE_t;
1088 
1089 /* "GPy/models/state_space_cython.pyx":18
1090  *
1091  * ctypedef np.float64_t DTYPE_t
1092  * ctypedef np.int64_t DTYPE_int_t             # <<<<<<<<<<<<<<
1093  *
1094  * # Template class for dynamic callables
1095  */
1096 typedef __pyx_t_5numpy_int64_t __pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t;
1097 /* Declarations.proto */
1098 #if CYTHON_CCOMPLEX
1099   #ifdef __cplusplus
1100     typedef ::std::complex< float > __pyx_t_float_complex;
1101   #else
1102     typedef float _Complex __pyx_t_float_complex;
1103   #endif
1104 #else
1105     typedef struct { float real, imag; } __pyx_t_float_complex;
1106 #endif
1107 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1108 
1109 /* Declarations.proto */
1110 #if CYTHON_CCOMPLEX
1111   #ifdef __cplusplus
1112     typedef ::std::complex< double > __pyx_t_double_complex;
1113   #else
1114     typedef double _Complex __pyx_t_double_complex;
1115   #endif
1116 #else
1117     typedef struct { double real, imag; } __pyx_t_double_complex;
1118 #endif
1119 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1120 
1121 
1122 /*--- Type declarations ---*/
1123 struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
1124 struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
1125 struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython;
1126 struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
1127 struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython;
1128 struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
1129 struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
1130 
1131 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":729
1132  * ctypedef npy_longdouble longdouble_t
1133  *
1134  * ctypedef npy_cfloat      cfloat_t             # <<<<<<<<<<<<<<
1135  * ctypedef npy_cdouble     cdouble_t
1136  * ctypedef npy_clongdouble clongdouble_t
1137  */
1138 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1139 
1140 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":730
1141  *
1142  * ctypedef npy_cfloat      cfloat_t
1143  * ctypedef npy_cdouble     cdouble_t             # <<<<<<<<<<<<<<
1144  * ctypedef npy_clongdouble clongdouble_t
1145  *
1146  */
1147 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1148 
1149 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":731
1150  * ctypedef npy_cfloat      cfloat_t
1151  * ctypedef npy_cdouble     cdouble_t
1152  * ctypedef npy_clongdouble clongdouble_t             # <<<<<<<<<<<<<<
1153  *
1154  * ctypedef npy_cdouble     complex_t
1155  */
1156 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1157 
1158 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":733
1159  * ctypedef npy_clongdouble clongdouble_t
1160  *
1161  * ctypedef npy_cdouble     complex_t             # <<<<<<<<<<<<<<
1162  *
1163  * cdef inline object PyArray_MultiIterNew1(a):
1164  */
1165 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1166 struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset;
1167 struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset;
1168 struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset;
1169 struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset;
1170 struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse;
1171 
1172 /* "GPy/models/state_space_cython.pyx":40
1173  *         raise NotImplemented("(cython) dQk is not implemented!")
1174  *
1175  *     cpdef reset(self, bint compute_derivatives = False):             # <<<<<<<<<<<<<<
1176  *         raise NotImplemented("(cython) reset is not implemented!")
1177  *
1178  */
1179 struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset {
1180   int __pyx_n;
1181   int compute_derivatives;
1182 };
1183 
1184 /* "GPy/models/state_space_cython.pyx":63
1185  *         raise NotImplemented("(cython) dQk is not implemented!")
1186  *
1187  *     cpdef reset(self,compute_derivatives = False):             # <<<<<<<<<<<<<<
1188  *         raise NotImplemented("(cython) reset is not implemented!")
1189  *
1190  */
1191 struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset {
1192   int __pyx_n;
1193   PyObject *compute_derivatives;
1194 };
1195 
1196 /* "GPy/models/state_space_cython.pyx":365
1197  *
1198  *
1199  *     cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
1200  *         """
1201  *         For reusing this object e.g. in smoother computation. It makes sence
1202  */
1203 struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset {
1204   int __pyx_n;
1205   int compute_derivatives;
1206 };
1207 
1208 /* "GPy/models/state_space_cython.pyx":446
1209  *             return np.dot(A, m) # default dynamic model
1210  *
1211  *         cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
1212  *             """
1213  *             For reusing this object e.g. in smoother computation. It makes sence
1214  */
1215 struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset {
1216   int __pyx_n;
1217   int compute_derivatives;
1218 };
1219 
1220 /* "GPy/models/state_space_cython.pyx":501
1221  *
1222  *
1223  *         cpdef Q_inverse(self, int k, float jitter=0.0):             # <<<<<<<<<<<<<<
1224  *             """
1225  *             Square root of the noise matrix Q
1226  */
1227 struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse {
1228   int __pyx_n;
1229   float jitter;
1230 };
1231 
1232 /* "GPy/models/state_space_cython.pyx":21
1233  *
1234  * # Template class for dynamic callables
1235  * cdef class Dynamic_Callables_Cython:             # <<<<<<<<<<<<<<
1236  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):
1237  *         raise NotImplemented("(cython) f_a is not implemented!")
1238  */
1239 struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython {
1240   PyObject_HEAD
1241   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_vtab;
1242 };
1243 
1244 
1245 /* "GPy/models/state_space_cython.pyx":44
1246  *
1247  * # Template class for measurement callables
1248  * cdef class Measurement_Callables_Cython:             # <<<<<<<<<<<<<<
1249  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] Hk):
1250  *         raise NotImplemented("(cython) f_a is not implemented!")
1251  */
1252 struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython {
1253   PyObject_HEAD
1254   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_vtab;
1255 };
1256 
1257 
1258 /* "GPy/models/state_space_cython.pyx":66
1259  *         raise NotImplemented("(cython) reset is not implemented!")
1260  *
1261  * cdef class R_handling_Cython(Measurement_Callables_Cython):             # <<<<<<<<<<<<<<
1262  *     """
1263  *     The calss handles noise matrix R.
1264  */
1265 struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython {
1266   struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython __pyx_base;
1267   PyArrayObject *R;
1268   PyArrayObject *index;
1269   int R_time_var_index;
1270   PyArrayObject *dR;
1271   int svd_each_time;
1272   PyObject *R_square_root;
1273 };
1274 
1275 
1276 /* "GPy/models/state_space_cython.pyx":165
1277  *
1278  *
1279  * cdef class Std_Measurement_Callables_Cython(R_handling_Cython):             # <<<<<<<<<<<<<<
1280  *
1281  *     cdef:
1282  */
1283 struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython {
1284   struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython __pyx_base;
1285   PyArrayObject *H;
1286   int H_time_var_index;
1287   PyArrayObject *dH;
1288 };
1289 
1290 
1291 /* "GPy/models/state_space_cython.pyx":212
1292  *
1293  *
1294  * cdef class Q_handling_Cython(Dynamic_Callables_Cython):             # <<<<<<<<<<<<<<
1295  *
1296  *     cdef:
1297  */
1298 struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython {
1299   struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython __pyx_base;
1300   PyArrayObject *Q;
1301   PyArrayObject *index;
1302   int Q_time_var_index;
1303   PyArrayObject *dQ;
1304   PyObject *Q_square_root;
1305   int svd_each_time;
1306 };
1307 
1308 
1309 /* "GPy/models/state_space_cython.pyx":318
1310  *         return square_root
1311  *
1312  * cdef class Std_Dynamic_Callables_Cython(Q_handling_Cython):             # <<<<<<<<<<<<<<
1313  *     cdef:
1314  *         np.ndarray A
1315  */
1316 struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython {
1317   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython __pyx_base;
1318   PyArrayObject *A;
1319   int A_time_var_index;
1320   PyArrayObject *dA;
1321 };
1322 
1323 
1324 /* "GPy/models/state_space_cython.pyx":373
1325  *         return self
1326  *
1327  * cdef class AQcompute_batch_Cython(Q_handling_Cython):             # <<<<<<<<<<<<<<
1328  *         """
1329  *         Class for calculating matrices A, Q, dA, dQ of the discrete Kalman Filter
1330  */
1331 struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython {
1332   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython __pyx_base;
1333   PyArrayObject *As;
1334   PyArrayObject *Qs;
1335   PyArrayObject *dAs;
1336   PyArrayObject *dQs;
1337   PyArrayObject *reconstruct_indices;
1338   PyObject *Q_svd_dict;
1339   int last_k;
1340 };
1341 
1342 
1343 
1344 /* "GPy/models/state_space_cython.pyx":21
1345  *
1346  * # Template class for dynamic callables
1347  * cdef class Dynamic_Callables_Cython:             # <<<<<<<<<<<<<<
1348  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):
1349  *         raise NotImplemented("(cython) f_a is not implemented!")
1350  */
1351 
1352 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython {
1353   PyObject *(*f_a)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
1354   PyObject *(*Ak)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
1355   PyObject *(*Qk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch);
1356   PyObject *(*Q_srk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch);
1357   PyObject *(*dAk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch);
1358   PyObject *(*dQk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch);
1359   PyObject *(*reset)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args);
1360 };
1361 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
1362 
1363 
1364 /* "GPy/models/state_space_cython.pyx":44
1365  *
1366  * # Template class for measurement callables
1367  * cdef class Measurement_Callables_Cython:             # <<<<<<<<<<<<<<
1368  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] Hk):
1369  *         raise NotImplemented("(cython) f_a is not implemented!")
1370  */
1371 
1372 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython {
1373   PyObject *(*f_h)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
1374   PyObject *(*Hk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch);
1375   PyObject *(*Rk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch);
1376   PyObject *(*R_isrk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch);
1377   PyObject *(*dHk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch);
1378   PyObject *(*dRk)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch);
1379   PyObject *(*reset)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset *__pyx_optional_args);
1380 };
1381 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
1382 
1383 
1384 /* "GPy/models/state_space_cython.pyx":66
1385  *         raise NotImplemented("(cython) reset is not implemented!")
1386  *
1387  * cdef class R_handling_Cython(Measurement_Callables_Cython):             # <<<<<<<<<<<<<<
1388  *     """
1389  *     The calss handles noise matrix R.
1390  */
1391 
1392 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_R_handling_Cython {
1393   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython __pyx_base;
1394 };
1395 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_R_handling_Cython;
1396 
1397 
1398 /* "GPy/models/state_space_cython.pyx":165
1399  *
1400  *
1401  * cdef class Std_Measurement_Callables_Cython(R_handling_Cython):             # <<<<<<<<<<<<<<
1402  *
1403  *     cdef:
1404  */
1405 
1406 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython {
1407   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_R_handling_Cython __pyx_base;
1408 };
1409 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
1410 
1411 
1412 /* "GPy/models/state_space_cython.pyx":212
1413  *
1414  *
1415  * cdef class Q_handling_Cython(Dynamic_Callables_Cython):             # <<<<<<<<<<<<<<
1416  *
1417  *     cdef:
1418  */
1419 
1420 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Q_handling_Cython {
1421   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython __pyx_base;
1422 };
1423 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython;
1424 
1425 
1426 /* "GPy/models/state_space_cython.pyx":318
1427  *         return square_root
1428  *
1429  * cdef class Std_Dynamic_Callables_Cython(Q_handling_Cython):             # <<<<<<<<<<<<<<
1430  *     cdef:
1431  *         np.ndarray A
1432  */
1433 
1434 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython {
1435   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Q_handling_Cython __pyx_base;
1436 };
1437 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
1438 
1439 
1440 /* "GPy/models/state_space_cython.pyx":373
1441  *         return self
1442  *
1443  * cdef class AQcompute_batch_Cython(Q_handling_Cython):             # <<<<<<<<<<<<<<
1444  *         """
1445  *         Class for calculating matrices A, Q, dA, dQ of the discrete Kalman Filter
1446  */
1447 
1448 struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_AQcompute_batch_Cython {
1449   struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Q_handling_Cython __pyx_base;
1450   PyObject *(*Q_inverse)(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse *__pyx_optional_args);
1451 };
1452 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
1453 
1454 /* --- Runtime support code (head) --- */
1455 /* Refnanny.proto */
1456 #ifndef CYTHON_REFNANNY
1457   #define CYTHON_REFNANNY 0
1458 #endif
1459 #if CYTHON_REFNANNY
1460   typedef struct {
1461     void (*INCREF)(void*, PyObject*, int);
1462     void (*DECREF)(void*, PyObject*, int);
1463     void (*GOTREF)(void*, PyObject*, int);
1464     void (*GIVEREF)(void*, PyObject*, int);
1465     void* (*SetupContext)(const char*, int, const char*);
1466     void (*FinishContext)(void**);
1467   } __Pyx_RefNannyAPIStruct;
1468   static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1469   static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1470   #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1471 #ifdef WITH_THREAD
1472   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1473           if (acquire_gil) {\
1474               PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1475               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1476               PyGILState_Release(__pyx_gilstate_save);\
1477           } else {\
1478               __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1479           }
1480 #else
1481   #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1482           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1483 #endif
1484   #define __Pyx_RefNannyFinishContext()\
1485           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1486   #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1487   #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1488   #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1489   #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1490   #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1491   #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1492   #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1493   #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1494 #else
1495   #define __Pyx_RefNannyDeclarations
1496   #define __Pyx_RefNannySetupContext(name, acquire_gil)
1497   #define __Pyx_RefNannyFinishContext()
1498   #define __Pyx_INCREF(r) Py_INCREF(r)
1499   #define __Pyx_DECREF(r) Py_DECREF(r)
1500   #define __Pyx_GOTREF(r)
1501   #define __Pyx_GIVEREF(r)
1502   #define __Pyx_XINCREF(r) Py_XINCREF(r)
1503   #define __Pyx_XDECREF(r) Py_XDECREF(r)
1504   #define __Pyx_XGOTREF(r)
1505   #define __Pyx_XGIVEREF(r)
1506 #endif
1507 #define __Pyx_XDECREF_SET(r, v) do {\
1508         PyObject *tmp = (PyObject *) r;\
1509         r = v; __Pyx_XDECREF(tmp);\
1510     } while (0)
1511 #define __Pyx_DECREF_SET(r, v) do {\
1512         PyObject *tmp = (PyObject *) r;\
1513         r = v; __Pyx_DECREF(tmp);\
1514     } while (0)
1515 #define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1516 #define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1517 
1518 /* PyObjectGetAttrStr.proto */
1519 #if CYTHON_USE_TYPE_SLOTS
1520 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1521 #else
1522 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1523 #endif
1524 
1525 /* GetBuiltinName.proto */
1526 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1527 
1528 /* IsLittleEndian.proto */
1529 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1530 
1531 /* BufferFormatCheck.proto */
1532 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1533 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1534                               __Pyx_BufFmt_StackElem* stack,
1535                               __Pyx_TypeInfo* type);
1536 
1537 /* BufferGetAndValidate.proto */
1538 #define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
1539     ((obj == Py_None || obj == NULL) ?\
1540     (__Pyx_ZeroBuffer(buf), 0) :\
1541     __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
1542 static int  __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
1543     __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
1544 static void __Pyx_ZeroBuffer(Py_buffer* buf);
1545 static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
1546 static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
1547 static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
1548 
1549 /* PyDictVersioning.proto */
1550 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1551 #define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
1552 #define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
1553 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1554     (version_var) = __PYX_GET_DICT_VERSION(dict);\
1555     (cache_var) = (value);
1556 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1557     static PY_UINT64_T __pyx_dict_version = 0;\
1558     static PyObject *__pyx_dict_cached_value = NULL;\
1559     if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1560         (VAR) = __pyx_dict_cached_value;\
1561     } else {\
1562         (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1563         __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1564     }\
1565 }
1566 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1567 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1568 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1569 #else
1570 #define __PYX_GET_DICT_VERSION(dict)  (0)
1571 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1572 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
1573 #endif
1574 
1575 /* PyFunctionFastCall.proto */
1576 #if CYTHON_FAST_PYCALL
1577 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1578     __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1579 #if 1 || PY_VERSION_HEX < 0x030600B1
1580 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1581 #else
1582 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1583 #endif
1584 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1585     (sizeof(char [1 - 2*!(cond)]) - 1)
1586 #ifndef Py_MEMBER_SIZE
1587 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1588 #endif
1589   static size_t __pyx_pyframe_localsplus_offset = 0;
1590   #include "frameobject.h"
1591   #define __Pxy_PyFrame_Initialize_Offsets()\
1592     ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1593      (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1594   #define __Pyx_PyFrame_GetLocalsplus(frame)\
1595     (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1596 #endif
1597 
1598 /* PyCFunctionFastCall.proto */
1599 #if CYTHON_FAST_PYCCALL
1600 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1601 #else
1602 #define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
1603 #endif
1604 
1605 /* PyObjectCall.proto */
1606 #if CYTHON_COMPILING_IN_CPYTHON
1607 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1608 #else
1609 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1610 #endif
1611 
1612 /* PyThreadStateGet.proto */
1613 #if CYTHON_FAST_THREAD_STATE
1614 #define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
1615 #define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
1616 #define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
1617 #else
1618 #define __Pyx_PyThreadState_declare
1619 #define __Pyx_PyThreadState_assign
1620 #define __Pyx_PyErr_Occurred()  PyErr_Occurred()
1621 #endif
1622 
1623 /* PyErrFetchRestore.proto */
1624 #if CYTHON_FAST_THREAD_STATE
1625 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1626 #define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1627 #define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1628 #define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1629 #define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1630 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1631 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1632 #if CYTHON_COMPILING_IN_CPYTHON
1633 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1634 #else
1635 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1636 #endif
1637 #else
1638 #define __Pyx_PyErr_Clear() PyErr_Clear()
1639 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1640 #define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
1641 #define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
1642 #define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
1643 #define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
1644 #define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
1645 #define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
1646 #endif
1647 
1648 /* RaiseException.proto */
1649 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1650 
1651 /* RaiseArgTupleInvalid.proto */
1652 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1653     Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1654 
1655 /* RaiseDoubleKeywords.proto */
1656 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1657 
1658 /* ParseKeywords.proto */
1659 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1660     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1661     const char* function_name);
1662 
1663 /* ArgTypeTest.proto */
1664 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1665     ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1666         __Pyx__ArgTypeTest(obj, type, name, exact))
1667 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1668 
1669 /* PyObjectCall2Args.proto */
1670 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1671 
1672 /* PyObjectCallMethO.proto */
1673 #if CYTHON_COMPILING_IN_CPYTHON
1674 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1675 #endif
1676 
1677 /* PyObjectCallOneArg.proto */
1678 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1679 
1680 /* PyErrExceptionMatches.proto */
1681 #if CYTHON_FAST_THREAD_STATE
1682 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1683 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1684 #else
1685 #define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
1686 #endif
1687 
1688 /* GetAttr.proto */
1689 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1690 
1691 /* GetAttr3.proto */
1692 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1693 
1694 /* GetModuleGlobalName.proto */
1695 #if CYTHON_USE_DICT_VERSIONS
1696 #define __Pyx_GetModuleGlobalName(var, name)  {\
1697     static PY_UINT64_T __pyx_dict_version = 0;\
1698     static PyObject *__pyx_dict_cached_value = NULL;\
1699     (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1700         (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1701         __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1702 }
1703 #define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
1704     PY_UINT64_T __pyx_dict_version;\
1705     PyObject *__pyx_dict_cached_value;\
1706     (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1707 }
1708 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1709 #else
1710 #define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1711 #define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
1712 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1713 #endif
1714 
1715 /* GetItemInt.proto */
1716 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1717     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1718     __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1719     (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1720                __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1721 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1722     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1723     __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1724     (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1725 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1726                                                               int wraparound, int boundscheck);
1727 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1728     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1729     __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1730     (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1731 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1732                                                               int wraparound, int boundscheck);
1733 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1734 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1735                                                      int is_list, int wraparound, int boundscheck);
1736 
1737 /* ObjectGetItem.proto */
1738 #if CYTHON_USE_TYPE_SLOTS
1739 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1740 #else
1741 #define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
1742 #endif
1743 
1744 /* ExtTypeTest.proto */
1745 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1746 
1747 /* BufferFallbackError.proto */
1748 static void __Pyx_RaiseBufferFallbackError(void);
1749 
1750 /* RaiseTooManyValuesToUnpack.proto */
1751 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1752 
1753 /* RaiseNeedMoreValuesToUnpack.proto */
1754 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1755 
1756 /* IterFinish.proto */
1757 static CYTHON_INLINE int __Pyx_IterFinish(void);
1758 
1759 /* UnpackItemEndCheck.proto */
1760 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1761 
1762 /* PyDictContains.proto */
__Pyx_PyDict_ContainsTF(PyObject * item,PyObject * dict,int eq)1763 static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
1764     int result = PyDict_Contains(dict, item);
1765     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1766 }
1767 
1768 /* DictGetItem.proto */
1769 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1770 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1771 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1772     (likely(PyDict_CheckExact(obj)) ?\
1773      __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1774 #else
1775 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1776 #define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
1777 #endif
1778 
1779 /* PyObjectSetAttrStr.proto */
1780 #if CYTHON_USE_TYPE_SLOTS
1781 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1782 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1783 #else
1784 #define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
1785 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1786 #endif
1787 
1788 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1789 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1790     int result = PySequence_Contains(seq, item);
1791     return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1792 }
1793 
1794 /* SetItemInt.proto */
1795 #define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1796     (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1797     __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
1798     (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
1799                __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
1800 static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
1801 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
1802                                                int is_list, int wraparound, int boundscheck);
1803 
1804 /* PyFloatBinop.proto */
1805 #if !CYTHON_COMPILING_IN_PYPY
1806 static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
1807 #else
1808 #define __Pyx_PyFloat_DivideCObj(op1, op2, floatval, inplace, zerodivision_check)\
1809     ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
1810     #endif
1811 
1812 /* Import.proto */
1813 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1814 
1815 /* ImportFrom.proto */
1816 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1817 
1818 /* HasAttr.proto */
1819 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1820 
1821 /* GetTopmostException.proto */
1822 #if CYTHON_USE_EXC_INFO_STACK
1823 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1824 #endif
1825 
1826 /* SaveResetException.proto */
1827 #if CYTHON_FAST_THREAD_STATE
1828 #define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1829 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1830 #define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1831 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1832 #else
1833 #define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
1834 #define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
1835 #endif
1836 
1837 /* GetException.proto */
1838 #if CYTHON_FAST_THREAD_STATE
1839 #define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
1840 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1841 #else
1842 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1843 #endif
1844 
1845 /* CallNextTpTraverse.proto */
1846 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
1847 
1848 /* CallNextTpClear.proto */
1849 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
1850 
1851 /* PyObject_GenericGetAttrNoDict.proto */
1852 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1853 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1854 #else
1855 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1856 #endif
1857 
1858 /* PyObject_GenericGetAttr.proto */
1859 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1860 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1861 #else
1862 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1863 #endif
1864 
1865 /* SetVTable.proto */
1866 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1867 
1868 /* PyObjectGetAttrStrNoError.proto */
1869 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1870 
1871 /* SetupReduce.proto */
1872 static int __Pyx_setup_reduce(PyObject* type_obj);
1873 
1874 /* TypeImport.proto */
1875 #ifndef __PYX_HAVE_RT_ImportType_proto
1876 #define __PYX_HAVE_RT_ImportType_proto
1877 enum __Pyx_ImportType_CheckSize {
1878    __Pyx_ImportType_CheckSize_Error = 0,
1879    __Pyx_ImportType_CheckSize_Warn = 1,
1880    __Pyx_ImportType_CheckSize_Ignore = 2
1881 };
1882 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1883 #endif
1884 
1885 /* CLineInTraceback.proto */
1886 #ifdef CYTHON_CLINE_IN_TRACEBACK
1887 #define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1888 #else
1889 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1890 #endif
1891 
1892 /* CodeObjectCache.proto */
1893 typedef struct {
1894     PyCodeObject* code_object;
1895     int code_line;
1896 } __Pyx_CodeObjectCacheEntry;
1897 struct __Pyx_CodeObjectCache {
1898     int count;
1899     int max_count;
1900     __Pyx_CodeObjectCacheEntry* entries;
1901 };
1902 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1903 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1904 static PyCodeObject *__pyx_find_code_object(int code_line);
1905 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1906 
1907 /* AddTraceback.proto */
1908 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1909                                int py_line, const char *filename);
1910 
1911 /* CIntToPy.proto */
1912 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1913 
1914 /* BufferStructDeclare.proto */
1915 typedef struct {
1916   Py_ssize_t shape, strides, suboffsets;
1917 } __Pyx_Buf_DimInfo;
1918 typedef struct {
1919   size_t refcount;
1920   Py_buffer pybuffer;
1921 } __Pyx_Buffer;
1922 typedef struct {
1923   __Pyx_Buffer *rcbuffer;
1924   char *data;
1925   __Pyx_Buf_DimInfo diminfo[8];
1926 } __Pyx_LocalBuf_ND;
1927 
1928 #if PY_MAJOR_VERSION < 3
1929     static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1930     static void __Pyx_ReleaseBuffer(Py_buffer *view);
1931 #else
1932     #define __Pyx_GetBuffer PyObject_GetBuffer
1933     #define __Pyx_ReleaseBuffer PyBuffer_Release
1934 #endif
1935 
1936 
1937 /* CIntToPy.proto */
1938 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1939 
1940 /* CIntToPy.proto */
1941 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1942 
1943 /* RealImag.proto */
1944 #if CYTHON_CCOMPLEX
1945   #ifdef __cplusplus
1946     #define __Pyx_CREAL(z) ((z).real())
1947     #define __Pyx_CIMAG(z) ((z).imag())
1948   #else
1949     #define __Pyx_CREAL(z) (__real__(z))
1950     #define __Pyx_CIMAG(z) (__imag__(z))
1951   #endif
1952 #else
1953     #define __Pyx_CREAL(z) ((z).real)
1954     #define __Pyx_CIMAG(z) ((z).imag)
1955 #endif
1956 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1957         && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1958     #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1959     #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1960 #else
1961     #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1962     #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1963 #endif
1964 
1965 /* Arithmetic.proto */
1966 #if CYTHON_CCOMPLEX
1967     #define __Pyx_c_eq_float(a, b)   ((a)==(b))
1968     #define __Pyx_c_sum_float(a, b)  ((a)+(b))
1969     #define __Pyx_c_diff_float(a, b) ((a)-(b))
1970     #define __Pyx_c_prod_float(a, b) ((a)*(b))
1971     #define __Pyx_c_quot_float(a, b) ((a)/(b))
1972     #define __Pyx_c_neg_float(a)     (-(a))
1973   #ifdef __cplusplus
1974     #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
1975     #define __Pyx_c_conj_float(z)    (::std::conj(z))
1976     #if 1
1977         #define __Pyx_c_abs_float(z)     (::std::abs(z))
1978         #define __Pyx_c_pow_float(a, b)  (::std::pow(a, b))
1979     #endif
1980   #else
1981     #define __Pyx_c_is_zero_float(z) ((z)==0)
1982     #define __Pyx_c_conj_float(z)    (conjf(z))
1983     #if 1
1984         #define __Pyx_c_abs_float(z)     (cabsf(z))
1985         #define __Pyx_c_pow_float(a, b)  (cpowf(a, b))
1986     #endif
1987  #endif
1988 #else
1989     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
1990     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
1991     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
1992     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
1993     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
1994     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
1995     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
1996     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
1997     #if 1
1998         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
1999         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2000     #endif
2001 #endif
2002 
2003 /* Arithmetic.proto */
2004 #if CYTHON_CCOMPLEX
2005     #define __Pyx_c_eq_double(a, b)   ((a)==(b))
2006     #define __Pyx_c_sum_double(a, b)  ((a)+(b))
2007     #define __Pyx_c_diff_double(a, b) ((a)-(b))
2008     #define __Pyx_c_prod_double(a, b) ((a)*(b))
2009     #define __Pyx_c_quot_double(a, b) ((a)/(b))
2010     #define __Pyx_c_neg_double(a)     (-(a))
2011   #ifdef __cplusplus
2012     #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2013     #define __Pyx_c_conj_double(z)    (::std::conj(z))
2014     #if 1
2015         #define __Pyx_c_abs_double(z)     (::std::abs(z))
2016         #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
2017     #endif
2018   #else
2019     #define __Pyx_c_is_zero_double(z) ((z)==0)
2020     #define __Pyx_c_conj_double(z)    (conj(z))
2021     #if 1
2022         #define __Pyx_c_abs_double(z)     (cabs(z))
2023         #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
2024     #endif
2025  #endif
2026 #else
2027     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2028     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2029     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2030     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2031     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2032     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2033     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2034     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2035     #if 1
2036         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2037         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2038     #endif
2039 #endif
2040 
2041 /* CIntFromPy.proto */
2042 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2043 
2044 /* CIntFromPy.proto */
2045 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2046 
2047 /* FastTypeChecks.proto */
2048 #if CYTHON_COMPILING_IN_CPYTHON
2049 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
2050 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
2051 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
2052 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
2053 #else
2054 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
2055 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
2056 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
2057 #endif
2058 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
2059 
2060 /* CheckBinaryVersion.proto */
2061 static int __Pyx_check_binary_version(void);
2062 
2063 /* InitStrings.proto */
2064 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2065 
2066 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch); /* proto*/
2067 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Ak(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_P, int __pyx_skip_dispatch); /* proto*/
2068 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Qk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2069 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Q_srk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2070 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dAk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2071 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dQk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2072 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args); /* proto*/
2073 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_Hk, int __pyx_skip_dispatch); /* proto*/
2074 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Hk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch); /* proto*/
2075 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Rk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2076 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_R_isrk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2077 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dHk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2078 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dRk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2079 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset *__pyx_optional_args); /* proto*/
2080 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2081 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2082 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2083 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_H, int __pyx_skip_dispatch); /* proto*/
2084 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch); /* proto*/
2085 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2086 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2087 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2088 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2089 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch); /* proto*/
2090 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch); /* proto*/
2091 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2092 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset *__pyx_optional_args); /* proto*/
2093 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch); /* proto*/
2094 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset *__pyx_optional_args); /* proto*/
2095 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_P, int __pyx_skip_dispatch); /* proto*/
2096 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2097 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2098 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2099 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch); /* proto*/
2100 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse *__pyx_optional_args); /* proto*/
2101 
2102 /* Module declarations from 'cpython.buffer' */
2103 
2104 /* Module declarations from 'libc.string' */
2105 
2106 /* Module declarations from 'libc.stdio' */
2107 
2108 /* Module declarations from '__builtin__' */
2109 
2110 /* Module declarations from 'cpython.type' */
2111 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2112 
2113 /* Module declarations from 'cpython' */
2114 
2115 /* Module declarations from 'cpython.object' */
2116 
2117 /* Module declarations from 'cpython.ref' */
2118 
2119 /* Module declarations from 'cpython.mem' */
2120 
2121 /* Module declarations from 'numpy' */
2122 
2123 /* Module declarations from 'numpy' */
2124 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2125 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2126 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2127 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2128 static PyTypeObject *__pyx_ptype_5numpy_generic = 0;
2129 static PyTypeObject *__pyx_ptype_5numpy_number = 0;
2130 static PyTypeObject *__pyx_ptype_5numpy_integer = 0;
2131 static PyTypeObject *__pyx_ptype_5numpy_signedinteger = 0;
2132 static PyTypeObject *__pyx_ptype_5numpy_unsignedinteger = 0;
2133 static PyTypeObject *__pyx_ptype_5numpy_inexact = 0;
2134 static PyTypeObject *__pyx_ptype_5numpy_floating = 0;
2135 static PyTypeObject *__pyx_ptype_5numpy_complexfloating = 0;
2136 static PyTypeObject *__pyx_ptype_5numpy_flexible = 0;
2137 static PyTypeObject *__pyx_ptype_5numpy_character = 0;
2138 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2139 
2140 /* Module declarations from 'cython' */
2141 
2142 /* Module declarations from 'GPy.models.state_space_cython' */
2143 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython = 0;
2144 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython = 0;
2145 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_R_handling_Cython = 0;
2146 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython = 0;
2147 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_Q_handling_Cython = 0;
2148 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython = 0;
2149 static PyTypeObject *__pyx_ptype_3GPy_6models_18state_space_cython_AQcompute_batch_Cython = 0;
2150 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, PyObject *); /*proto*/
2151 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, PyObject *); /*proto*/
2152 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_R_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *, PyObject *); /*proto*/
2153 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *, PyObject *); /*proto*/
2154 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Q_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *, PyObject *); /*proto*/
2155 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *, PyObject *); /*proto*/
2156 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_AQcompute_batch_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *, PyObject *); /*proto*/
2157 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t = { "DTYPE_t", NULL, sizeof(__pyx_t_3GPy_6models_18state_space_cython_DTYPE_t), { 0 }, 0, 'R', 0, 0 };
2158 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t = { "DTYPE_int_t", NULL, sizeof(__pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t) ? 'U' : 'I', IS_UNSIGNED(__pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t), 0 };
2159 #define __Pyx_MODULE_NAME "GPy.models.state_space_cython"
2160 extern int __pyx_module_is_main_GPy__models__state_space_cython;
2161 int __pyx_module_is_main_GPy__models__state_space_cython = 0;
2162 
2163 /* Implementation of 'GPy.models.state_space_cython' */
2164 static PyObject *__pyx_builtin_NotImplemented;
2165 static PyObject *__pyx_builtin_ValueError;
2166 static PyObject *__pyx_builtin_super;
2167 static PyObject *__pyx_builtin_range;
2168 static PyObject *__pyx_builtin_ImportError;
2169 static const char __pyx_k_A[] = "A";
2170 static const char __pyx_k_H[] = "H";
2171 static const char __pyx_k_K[] = "K";
2172 static const char __pyx_k_M[] = "M";
2173 static const char __pyx_k_P[] = "P";
2174 static const char __pyx_k_Q[] = "Q";
2175 static const char __pyx_k_R[] = "R";
2176 static const char __pyx_k_S[] = "S";
2177 static const char __pyx_k_T[] = "T";
2178 static const char __pyx_k_U[] = "U";
2179 static const char __pyx_k_X[] = "X";
2180 static const char __pyx_k_Y[] = "Y";
2181 static const char __pyx_k_j[] = "j";
2182 static const char __pyx_k_k[] = "k";
2183 static const char __pyx_k_m[] = "m";
2184 static const char __pyx_k_v[] = "v";
2185 static const char __pyx_k_Ak[] = "Ak";
2186 static const char __pyx_k_As[] = "As";
2187 static const char __pyx_k_Hk[] = "Hk";
2188 static const char __pyx_k_Qk[] = "Qk";
2189 static const char __pyx_k_Qs[] = "Qs";
2190 static const char __pyx_k_Rk[] = "Rk";
2191 static const char __pyx_k_Vh[] = "Vh";
2192 static const char __pyx_k_dA[] = "dA";
2193 static const char __pyx_k_dH[] = "dH";
2194 static const char __pyx_k_dK[] = "dK";
2195 static const char __pyx_k_dQ[] = "dQ";
2196 static const char __pyx_k_dR[] = "dR";
2197 static const char __pyx_k_dS[] = "dS";
2198 static const char __pyx_k_dv[] = "dv";
2199 static const char __pyx_k_np[] = "np";
2200 static const char __pyx_k_pi[] = "pi";
2201 static const char __pyx_k_sp[] = "sp";
2202 static const char __pyx_k_all[] = "all";
2203 static const char __pyx_k_any[] = "any";
2204 static const char __pyx_k_dAk[] = "dAk";
2205 static const char __pyx_k_dAs[] = "dAs";
2206 static const char __pyx_k_dHk[] = "dHk";
2207 static const char __pyx_k_dQk[] = "dQk";
2208 static const char __pyx_k_dQs[] = "dQs";
2209 static const char __pyx_k_dRk[] = "dRk";
2210 static const char __pyx_k_dot[] = "dot";
2211 static const char __pyx_k_f_a[] = "f_a";
2212 static const char __pyx_k_f_h[] = "f_h";
2213 static const char __pyx_k_log[] = "log";
2214 static const char __pyx_k_new[] = "__new__";
2215 static const char __pyx_k_p_P[] = "p_P";
2216 static const char __pyx_k_p_m[] = "p_m";
2217 static const char __pyx_k_res[] = "res";
2218 static const char __pyx_k_ret[] = "ret";
2219 static const char __pyx_k_sum[] = "sum";
2220 static const char __pyx_k_svd[] = "svd";
2221 static const char __pyx_k_Q_sr[] = "Q_sr";
2222 static const char __pyx_k_axis[] = "axis";
2223 static const char __pyx_k_diag[] = "diag";
2224 static const char __pyx_k_dict[] = "__dict__";
2225 static const char __pyx_k_init[] = "__init__";
2226 static const char __pyx_k_main[] = "__main__";
2227 static const char __pyx_k_name[] = "__name__";
2228 static const char __pyx_k_p_dP[] = "p_dP";
2229 static const char __pyx_k_p_dm[] = "p_dm";
2230 static const char __pyx_k_sqrt[] = "sqrt";
2231 static const char __pyx_k_test[] = "__test__";
2232 static const char __pyx_k_tmp1[] = "tmp1";
2233 static const char __pyx_k_tmp2[] = "tmp2";
2234 static const char __pyx_k_tmp3[] = "tmp3";
2235 static const char __pyx_k_tmp5[] = "tmp5";
2236 static const char __pyx_k_DTYPE[] = "DTYPE";
2237 static const char __pyx_k_P_upd[] = "P_upd";
2238 static const char __pyx_k_Q_srk[] = "Q_srk";
2239 static const char __pyx_k_R_isr[] = "R_isr";
2240 static const char __pyx_k_S_new[] = "S_new";
2241 static const char __pyx_k_S_old[] = "S_old";
2242 static const char __pyx_k_S_svd[] = "S_svd";
2243 static const char __pyx_k_S_upd[] = "S_upd";
2244 static const char __pyx_k_U_upd[] = "U_upd";
2245 static const char __pyx_k_V_new[] = "V_new";
2246 static const char __pyx_k_V_old[] = "V_old";
2247 static const char __pyx_k_dtype[] = "dtype";
2248 static const char __pyx_k_empty[] = "empty";
2249 static const char __pyx_k_index[] = "index";
2250 static const char __pyx_k_int64[] = "int64";
2251 static const char __pyx_k_isnan[] = "isnan";
2252 static const char __pyx_k_m_upd[] = "m_upd";
2253 static const char __pyx_k_numpy[] = "numpy";
2254 static const char __pyx_k_param[] = "param";
2255 static const char __pyx_k_range[] = "range";
2256 static const char __pyx_k_reset[] = "reset";
2257 static const char __pyx_k_scipy[] = "scipy";
2258 static const char __pyx_k_shape[] = "shape";
2259 static const char __pyx_k_super[] = "super";
2260 static const char __pyx_k_zeros[] = "zeros";
2261 static const char __pyx_k_P_init[] = "P_init";
2262 static const char __pyx_k_P_pred[] = "P_pred";
2263 static const char __pyx_k_R_isrk[] = "R_isrk";
2264 static const char __pyx_k_S_pred[] = "S_pred";
2265 static const char __pyx_k_V_pred[] = "V_pred";
2266 static const char __pyx_k_dP_upd[] = "dP_upd";
2267 static const char __pyx_k_dm_upd[] = "dm_upd";
2268 static const char __pyx_k_import[] = "__import__";
2269 static const char __pyx_k_jitter[] = "jitter";
2270 static const char __pyx_k_linalg[] = "linalg";
2271 static const char __pyx_k_m_init[] = "m_init";
2272 static const char __pyx_k_m_pred[] = "m_pred";
2273 static const char __pyx_k_nbytes[] = "nbytes";
2274 static const char __pyx_k_pickle[] = "pickle";
2275 static const char __pyx_k_reduce[] = "__reduce__";
2276 static const char __pyx_k_unique[] = "unique";
2277 static const char __pyx_k_update[] = "update";
2278 static const char __pyx_k_vstack[] = "vstack";
2279 static const char __pyx_k_dP_init[] = "dP_init";
2280 static const char __pyx_k_dP_pred[] = "dP_pred";
2281 static const char __pyx_k_dm_init[] = "dm_init";
2282 static const char __pyx_k_dm_pred[] = "dm_pred";
2283 static const char __pyx_k_float64[] = "float64";
2284 static const char __pyx_k_regular[] = "regular";
2285 static const char __pyx_k_Prev_cov[] = "Prev_cov";
2286 static const char __pyx_k_getstate[] = "__getstate__";
2287 static const char __pyx_k_pyx_type[] = "__pyx_type";
2288 static const char __pyx_k_setstate[] = "__setstate__";
2289 static const char __pyx_k_steps_no[] = "steps_no";
2290 static const char __pyx_k_DTYPE_int[] = "DTYPE_int";
2291 static const char __pyx_k_Q_inverse[] = "Q_inverse";
2292 static const char __pyx_k_prev_mean[] = "prev_mean";
2293 static const char __pyx_k_pyx_state[] = "__pyx_state";
2294 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2295 static const char __pyx_k_state_dim[] = "state_dim";
2296 static const char __pyx_k_ValueError[] = "ValueError";
2297 static const char __pyx_k_compute_uv[] = "compute_uv";
2298 static const char __pyx_k_pyx_result[] = "__pyx_result";
2299 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2300 static const char __pyx_k_svd_1_matr[] = "svd_1_matr";
2301 static const char __pyx_k_svd_2_matr[] = "svd_2_matr";
2302 static const char __pyx_k_ImportError[] = "ImportError";
2303 static const char __pyx_k_PickleError[] = "PickleError";
2304 static const char __pyx_k_measurement[] = "measurement";
2305 static const char __pyx_k_overwrite_a[] = "overwrite_a";
2306 static const char __pyx_k_check_finite[] = "check_finite";
2307 static const char __pyx_k_k_measurment[] = "k_measurment";
2308 static const char __pyx_k_param_number[] = "param_number";
2309 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2310 static const char __pyx_k_stringsource[] = "stringsource";
2311 static const char __pyx_k_dA_all_params[] = "dA_all_params";
2312 static const char __pyx_k_dH_all_params[] = "dH_all_params";
2313 static const char __pyx_k_dQ_all_params[] = "dQ_all_params";
2314 static const char __pyx_k_dR_all_params[] = "dR_all_params";
2315 static const char __pyx_k_full_matrices[] = "full_matrices";
2316 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2317 static const char __pyx_k_NotImplemented[] = "NotImplemented";
2318 static const char __pyx_k_Q_inverse_dict[] = "Q_inverse_dict";
2319 static const char __pyx_k_grad_params_no[] = "grad_params_no";
2320 static const char __pyx_k_log_likelihood[] = "log_likelihood";
2321 static const char __pyx_k_time_series_no[] = "time_series_no";
2322 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2323 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2324 static const char __pyx_k_unique_Q_number[] = "unique_Q_number";
2325 static const char __pyx_k_unique_R_number[] = "unique_R_number";
2326 static const char __pyx_k_A_time_var_index[] = "A_time_var_index";
2327 static const char __pyx_k_H_time_var_index[] = "H_time_var_index";
2328 static const char __pyx_k_Q_time_var_index[] = "Q_time_var_index";
2329 static const char __pyx_k_R_time_var_index[] = "R_time_var_index";
2330 static const char __pyx_k_Q_handling_Cython[] = "Q_handling_Cython";
2331 static const char __pyx_k_R_handling_Cython[] = "R_handling_Cython";
2332 static const char __pyx_k_p_unique_Q_number[] = "p_unique_Q_number";
2333 static const char __pyx_k_p_unique_R_number[] = "p_unique_R_number";
2334 static const char __pyx_k_Q_square_root_dict[] = "Q_square_root_dict";
2335 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2336 static const char __pyx_k_dP_pred_all_params[] = "dP_pred_all_params";
2337 static const char __pyx_k_dm_pred_all_params[] = "dm_pred_all_params";
2338 static const char __pyx_k_total_size_of_data[] = "total_size_of_data";
2339 static const char __pyx_k_calc_log_likelihood[] = "calc_log_likelihood";
2340 static const char __pyx_k_compute_derivatives[] = "compute_derivatives";
2341 static const char __pyx_k_grad_log_likelihood[] = "grad_log_likelihood";
2342 static const char __pyx_k_p_dynamic_callables[] = "p_dynamic_callables";
2343 static const char __pyx_k_reconstruct_indices[] = "reconstruct_indices";
2344 static const char __pyx_k_p_kalman_filter_type[] = "p_kalman_filter_type";
2345 static const char __pyx_k_dA_derivative_is_None[] = "dA derivative is None";
2346 static const char __pyx_k_dH_derivative_is_None[] = "dH derivative is None";
2347 static const char __pyx_k_dQ_derivative_is_None[] = "dQ derivative is None";
2348 static const char __pyx_k_dR_derivative_is_None[] = "dR derivative is None";
2349 static const char __pyx_k_log_likelihood_update[] = "log_likelihood_update";
2350 static const char __pyx_k_AQcompute_batch_Cython[] = "AQcompute_batch_Cython";
2351 static const char __pyx_k_measurement_dim_gt_one[] = "measurement_dim_gt_one";
2352 static const char __pyx_k_d_log_likelihood_update[] = "d_log_likelihood_update";
2353 static const char __pyx_k_p_measurement_callables[] = "p_measurement_callables";
2354 static const char __pyx_k_Dynamic_Callables_Cython[] = "Dynamic_Callables_Cython";
2355 static const char __pyx_k_calc_grad_log_likelihood[] = "calc_grad_log_likelihood";
2356 static const char __pyx_k_Measurement_Callables_Cython[] = "Measurement_Callables_Cython";
2357 static const char __pyx_k_Std_Dynamic_Callables_Cython[] = "Std_Dynamic_Callables_Cython";
2358 static const char __pyx_k_cython_Ak_is_not_implemented[] = "(cython) Ak is not implemented!";
2359 static const char __pyx_k_cython_Hk_is_not_implemented[] = "(cython) Hk is not implemented!";
2360 static const char __pyx_k_cython_Qk_is_not_implemented[] = "(cython) Qk is not implemented!";
2361 static const char __pyx_k_cython_Rk_is_not_implemented[] = "(cython) Rk is not implemented!";
2362 static const char __pyx_k_GPy_models_state_space_cython[] = "GPy.models.state_space_cython";
2363 static const char __pyx_k_cython_dAk_is_not_implemented[] = "(cython) dAk is not implemented!";
2364 static const char __pyx_k_cython_dQk_is_not_implemented[] = "(cython) dQk is not implemented!";
2365 static const char __pyx_k_cython_f_a_is_not_implemented[] = "(cython) f_a is not implemented!";
2366 static const char __pyx_k_kalman_update_step_SVD_Cython[] = "_kalman_update_step_SVD_Cython";
2367 static const char __pyx_k_pyx_unpickle_AQcompute_batch_C[] = "__pyx_unpickle_AQcompute_batch_Cython";
2368 static const char __pyx_k_pyx_unpickle_Dynamic_Callables[] = "__pyx_unpickle_Dynamic_Callables_Cython";
2369 static const char __pyx_k_pyx_unpickle_Measurement_Calla[] = "__pyx_unpickle_Measurement_Callables_Cython";
2370 static const char __pyx_k_pyx_unpickle_Q_handling_Cython[] = "__pyx_unpickle_Q_handling_Cython";
2371 static const char __pyx_k_pyx_unpickle_R_handling_Cython[] = "__pyx_unpickle_R_handling_Cython";
2372 static const char __pyx_k_pyx_unpickle_Std_Dynamic_Calla[] = "__pyx_unpickle_Std_Dynamic_Callables_Cython";
2373 static const char __pyx_k_pyx_unpickle_Std_Measurement_C[] = "__pyx_unpickle_Std_Measurement_Callables_Cython";
2374 static const char __pyx_k_Contains_some_cython_code_for_s[] = "\nContains some cython code for state space modelling.\n";
2375 static const char __pyx_k_Nan_values_in_likelihood_update[] = "Nan values in likelihood update!";
2376 static const char __pyx_k_cont_discr_kalman_filter_raw_Cy[] = "_cont_discr_kalman_filter_raw_Cython";
2377 static const char __pyx_k_cython_Q_srk_is_not_implemented[] = "(cython) Q_srk is not implemented!";
2378 static const char __pyx_k_cython_reset_is_not_implemented[] = "(cython) reset is not implemented!";
2379 static const char __pyx_k_kalman_prediction_step_SVD_Cyth[] = "_kalman_prediction_step_SVD_Cython";
2380 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2381 static const char __pyx_k_GPy_models_state_space_cython_py[] = "GPy/models/state_space_cython.pyx";
2382 static const char __pyx_k_Incompatible_checksums_s_vs_0x14[] = "Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))";
2383 static const char __pyx_k_Incompatible_checksums_s_vs_0x70[] = "Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))";
2384 static const char __pyx_k_Incompatible_checksums_s_vs_0x77[] = "Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))";
2385 static const char __pyx_k_Incompatible_checksums_s_vs_0x9e[] = "Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))";
2386 static const char __pyx_k_Incompatible_checksums_s_vs_0xd4[] = "Incompatible checksums (%s vs 0xd41d8cd = ())";
2387 static const char __pyx_k_Incompatible_checksums_s_vs_0xdf[] = "Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))";
2388 static const char __pyx_k_Kalman_Filter_Update_SVD_S_is_ne[] = "Kalman Filter Update SVD: S is negative step %i";
2389 static const char __pyx_k_Measurement_dimension_larger_the[] = "Measurement dimension larger then 1 is currently not supported";
2390 static const char __pyx_k_Nan_measurements_are_currently_n[] = "Nan measurements are currently not supported if\n                                     they are intermixed with not NaN measurements";
2391 static const char __pyx_k_Std_Measurement_Callables_Cython[] = "Std_Measurement_Callables_Cython";
2392 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2393 static PyObject *__pyx_n_s_A;
2394 static PyObject *__pyx_n_s_AQcompute_batch_Cython;
2395 static PyObject *__pyx_n_s_A_time_var_index;
2396 static PyObject *__pyx_n_s_Ak;
2397 static PyObject *__pyx_n_s_As;
2398 static PyObject *__pyx_n_s_DTYPE;
2399 static PyObject *__pyx_n_s_DTYPE_int;
2400 static PyObject *__pyx_n_s_Dynamic_Callables_Cython;
2401 static PyObject *__pyx_n_s_GPy_models_state_space_cython;
2402 static PyObject *__pyx_kp_s_GPy_models_state_space_cython_py;
2403 static PyObject *__pyx_n_s_H;
2404 static PyObject *__pyx_n_s_H_time_var_index;
2405 static PyObject *__pyx_n_s_Hk;
2406 static PyObject *__pyx_n_s_ImportError;
2407 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x14;
2408 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x70;
2409 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x77;
2410 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x9e;
2411 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xd4;
2412 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xdf;
2413 static PyObject *__pyx_n_s_K;
2414 static PyObject *__pyx_kp_s_Kalman_Filter_Update_SVD_S_is_ne;
2415 static PyObject *__pyx_n_s_M;
2416 static PyObject *__pyx_n_s_Measurement_Callables_Cython;
2417 static PyObject *__pyx_kp_s_Measurement_dimension_larger_the;
2418 static PyObject *__pyx_kp_s_Nan_measurements_are_currently_n;
2419 static PyObject *__pyx_kp_s_Nan_values_in_likelihood_update;
2420 static PyObject *__pyx_n_s_NotImplemented;
2421 static PyObject *__pyx_n_s_P;
2422 static PyObject *__pyx_n_s_P_init;
2423 static PyObject *__pyx_n_s_P_pred;
2424 static PyObject *__pyx_n_s_P_upd;
2425 static PyObject *__pyx_n_s_PickleError;
2426 static PyObject *__pyx_n_s_Prev_cov;
2427 static PyObject *__pyx_n_s_Q;
2428 static PyObject *__pyx_n_s_Q_handling_Cython;
2429 static PyObject *__pyx_n_s_Q_inverse;
2430 static PyObject *__pyx_n_s_Q_inverse_dict;
2431 static PyObject *__pyx_n_s_Q_square_root_dict;
2432 static PyObject *__pyx_n_s_Q_sr;
2433 static PyObject *__pyx_n_s_Q_srk;
2434 static PyObject *__pyx_n_s_Q_time_var_index;
2435 static PyObject *__pyx_n_s_Qk;
2436 static PyObject *__pyx_n_s_Qs;
2437 static PyObject *__pyx_n_s_R;
2438 static PyObject *__pyx_n_s_R_handling_Cython;
2439 static PyObject *__pyx_n_s_R_isr;
2440 static PyObject *__pyx_n_s_R_isrk;
2441 static PyObject *__pyx_n_s_R_time_var_index;
2442 static PyObject *__pyx_n_s_Rk;
2443 static PyObject *__pyx_n_s_S;
2444 static PyObject *__pyx_n_s_S_new;
2445 static PyObject *__pyx_n_s_S_old;
2446 static PyObject *__pyx_n_s_S_pred;
2447 static PyObject *__pyx_n_s_S_svd;
2448 static PyObject *__pyx_n_s_S_upd;
2449 static PyObject *__pyx_n_s_Std_Dynamic_Callables_Cython;
2450 static PyObject *__pyx_n_s_Std_Measurement_Callables_Cython;
2451 static PyObject *__pyx_n_s_T;
2452 static PyObject *__pyx_n_s_U;
2453 static PyObject *__pyx_n_s_U_upd;
2454 static PyObject *__pyx_n_s_V_new;
2455 static PyObject *__pyx_n_s_V_old;
2456 static PyObject *__pyx_n_s_V_pred;
2457 static PyObject *__pyx_n_s_ValueError;
2458 static PyObject *__pyx_n_s_Vh;
2459 static PyObject *__pyx_n_s_X;
2460 static PyObject *__pyx_n_s_Y;
2461 static PyObject *__pyx_n_s_all;
2462 static PyObject *__pyx_n_s_any;
2463 static PyObject *__pyx_n_s_axis;
2464 static PyObject *__pyx_n_s_calc_grad_log_likelihood;
2465 static PyObject *__pyx_n_s_calc_log_likelihood;
2466 static PyObject *__pyx_n_s_check_finite;
2467 static PyObject *__pyx_n_s_cline_in_traceback;
2468 static PyObject *__pyx_n_s_compute_derivatives;
2469 static PyObject *__pyx_n_s_compute_uv;
2470 static PyObject *__pyx_n_s_cont_discr_kalman_filter_raw_Cy;
2471 static PyObject *__pyx_kp_s_cython_Ak_is_not_implemented;
2472 static PyObject *__pyx_kp_s_cython_Hk_is_not_implemented;
2473 static PyObject *__pyx_kp_s_cython_Q_srk_is_not_implemented;
2474 static PyObject *__pyx_kp_s_cython_Qk_is_not_implemented;
2475 static PyObject *__pyx_kp_s_cython_Rk_is_not_implemented;
2476 static PyObject *__pyx_kp_s_cython_dAk_is_not_implemented;
2477 static PyObject *__pyx_kp_s_cython_dQk_is_not_implemented;
2478 static PyObject *__pyx_kp_s_cython_f_a_is_not_implemented;
2479 static PyObject *__pyx_kp_s_cython_reset_is_not_implemented;
2480 static PyObject *__pyx_n_s_dA;
2481 static PyObject *__pyx_n_s_dA_all_params;
2482 static PyObject *__pyx_kp_s_dA_derivative_is_None;
2483 static PyObject *__pyx_n_s_dAk;
2484 static PyObject *__pyx_n_s_dAs;
2485 static PyObject *__pyx_n_s_dH;
2486 static PyObject *__pyx_n_s_dH_all_params;
2487 static PyObject *__pyx_kp_s_dH_derivative_is_None;
2488 static PyObject *__pyx_n_s_dHk;
2489 static PyObject *__pyx_n_s_dK;
2490 static PyObject *__pyx_n_s_dP_init;
2491 static PyObject *__pyx_n_s_dP_pred;
2492 static PyObject *__pyx_n_s_dP_pred_all_params;
2493 static PyObject *__pyx_n_s_dP_upd;
2494 static PyObject *__pyx_n_s_dQ;
2495 static PyObject *__pyx_n_s_dQ_all_params;
2496 static PyObject *__pyx_kp_s_dQ_derivative_is_None;
2497 static PyObject *__pyx_n_s_dQk;
2498 static PyObject *__pyx_n_s_dQs;
2499 static PyObject *__pyx_n_s_dR;
2500 static PyObject *__pyx_n_s_dR_all_params;
2501 static PyObject *__pyx_kp_s_dR_derivative_is_None;
2502 static PyObject *__pyx_n_s_dRk;
2503 static PyObject *__pyx_n_s_dS;
2504 static PyObject *__pyx_n_s_d_log_likelihood_update;
2505 static PyObject *__pyx_n_s_diag;
2506 static PyObject *__pyx_n_s_dict;
2507 static PyObject *__pyx_n_s_dm_init;
2508 static PyObject *__pyx_n_s_dm_pred;
2509 static PyObject *__pyx_n_s_dm_pred_all_params;
2510 static PyObject *__pyx_n_s_dm_upd;
2511 static PyObject *__pyx_n_s_dot;
2512 static PyObject *__pyx_n_s_dtype;
2513 static PyObject *__pyx_n_s_dv;
2514 static PyObject *__pyx_n_s_empty;
2515 static PyObject *__pyx_n_s_f_a;
2516 static PyObject *__pyx_n_s_f_h;
2517 static PyObject *__pyx_n_s_float64;
2518 static PyObject *__pyx_n_s_full_matrices;
2519 static PyObject *__pyx_n_s_getstate;
2520 static PyObject *__pyx_n_s_grad_log_likelihood;
2521 static PyObject *__pyx_n_s_grad_params_no;
2522 static PyObject *__pyx_n_s_import;
2523 static PyObject *__pyx_n_s_index;
2524 static PyObject *__pyx_n_s_init;
2525 static PyObject *__pyx_n_s_int64;
2526 static PyObject *__pyx_n_s_isnan;
2527 static PyObject *__pyx_n_s_j;
2528 static PyObject *__pyx_n_s_jitter;
2529 static PyObject *__pyx_n_s_k;
2530 static PyObject *__pyx_n_s_k_measurment;
2531 static PyObject *__pyx_n_s_kalman_prediction_step_SVD_Cyth;
2532 static PyObject *__pyx_n_s_kalman_update_step_SVD_Cython;
2533 static PyObject *__pyx_n_s_linalg;
2534 static PyObject *__pyx_n_s_log;
2535 static PyObject *__pyx_n_s_log_likelihood;
2536 static PyObject *__pyx_n_s_log_likelihood_update;
2537 static PyObject *__pyx_n_s_m;
2538 static PyObject *__pyx_n_s_m_init;
2539 static PyObject *__pyx_n_s_m_pred;
2540 static PyObject *__pyx_n_s_m_upd;
2541 static PyObject *__pyx_n_s_main;
2542 static PyObject *__pyx_n_s_measurement;
2543 static PyObject *__pyx_n_s_measurement_dim_gt_one;
2544 static PyObject *__pyx_n_s_name;
2545 static PyObject *__pyx_n_s_nbytes;
2546 static PyObject *__pyx_n_s_new;
2547 static PyObject *__pyx_n_s_np;
2548 static PyObject *__pyx_n_s_numpy;
2549 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2550 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2551 static PyObject *__pyx_n_s_overwrite_a;
2552 static PyObject *__pyx_n_s_p_P;
2553 static PyObject *__pyx_n_s_p_dP;
2554 static PyObject *__pyx_n_s_p_dm;
2555 static PyObject *__pyx_n_s_p_dynamic_callables;
2556 static PyObject *__pyx_n_s_p_kalman_filter_type;
2557 static PyObject *__pyx_n_s_p_m;
2558 static PyObject *__pyx_n_s_p_measurement_callables;
2559 static PyObject *__pyx_n_s_p_unique_Q_number;
2560 static PyObject *__pyx_n_s_p_unique_R_number;
2561 static PyObject *__pyx_n_s_param;
2562 static PyObject *__pyx_n_s_param_number;
2563 static PyObject *__pyx_n_s_pi;
2564 static PyObject *__pyx_n_s_pickle;
2565 static PyObject *__pyx_n_s_prev_mean;
2566 static PyObject *__pyx_n_s_pyx_PickleError;
2567 static PyObject *__pyx_n_s_pyx_checksum;
2568 static PyObject *__pyx_n_s_pyx_result;
2569 static PyObject *__pyx_n_s_pyx_state;
2570 static PyObject *__pyx_n_s_pyx_type;
2571 static PyObject *__pyx_n_s_pyx_unpickle_AQcompute_batch_C;
2572 static PyObject *__pyx_n_s_pyx_unpickle_Dynamic_Callables;
2573 static PyObject *__pyx_n_s_pyx_unpickle_Measurement_Calla;
2574 static PyObject *__pyx_n_s_pyx_unpickle_Q_handling_Cython;
2575 static PyObject *__pyx_n_s_pyx_unpickle_R_handling_Cython;
2576 static PyObject *__pyx_n_s_pyx_unpickle_Std_Dynamic_Calla;
2577 static PyObject *__pyx_n_s_pyx_unpickle_Std_Measurement_C;
2578 static PyObject *__pyx_n_s_pyx_vtable;
2579 static PyObject *__pyx_n_s_range;
2580 static PyObject *__pyx_n_s_reconstruct_indices;
2581 static PyObject *__pyx_n_s_reduce;
2582 static PyObject *__pyx_n_s_reduce_cython;
2583 static PyObject *__pyx_n_s_reduce_ex;
2584 static PyObject *__pyx_n_s_regular;
2585 static PyObject *__pyx_n_s_res;
2586 static PyObject *__pyx_n_s_reset;
2587 static PyObject *__pyx_n_s_ret;
2588 static PyObject *__pyx_n_s_scipy;
2589 static PyObject *__pyx_n_s_setstate;
2590 static PyObject *__pyx_n_s_setstate_cython;
2591 static PyObject *__pyx_n_s_shape;
2592 static PyObject *__pyx_n_s_sp;
2593 static PyObject *__pyx_n_s_sqrt;
2594 static PyObject *__pyx_n_s_state_dim;
2595 static PyObject *__pyx_n_s_steps_no;
2596 static PyObject *__pyx_kp_s_stringsource;
2597 static PyObject *__pyx_n_s_sum;
2598 static PyObject *__pyx_n_s_super;
2599 static PyObject *__pyx_n_s_svd;
2600 static PyObject *__pyx_n_s_svd_1_matr;
2601 static PyObject *__pyx_n_s_svd_2_matr;
2602 static PyObject *__pyx_n_s_test;
2603 static PyObject *__pyx_n_s_time_series_no;
2604 static PyObject *__pyx_n_s_tmp1;
2605 static PyObject *__pyx_n_s_tmp2;
2606 static PyObject *__pyx_n_s_tmp3;
2607 static PyObject *__pyx_n_s_tmp5;
2608 static PyObject *__pyx_n_s_total_size_of_data;
2609 static PyObject *__pyx_n_s_unique;
2610 static PyObject *__pyx_n_s_unique_Q_number;
2611 static PyObject *__pyx_n_s_unique_R_number;
2612 static PyObject *__pyx_n_s_update;
2613 static PyObject *__pyx_n_s_v;
2614 static PyObject *__pyx_n_s_vstack;
2615 static PyObject *__pyx_n_s_zeros;
2616 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A); /* proto */
2617 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_2Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_P); /* proto */
2618 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_4Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2619 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2620 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_8dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2621 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_10dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2622 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_compute_derivatives); /* proto */
2623 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self); /* proto */
2624 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2625 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_Hk); /* proto */
2626 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_2Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred); /* proto */
2627 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_4Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2628 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2629 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_8dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2630 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_10dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2631 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v_compute_derivatives); /* proto */
2632 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self); /* proto */
2633 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2634 static int __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, PyArrayObject *__pyx_v_R, PyArrayObject *__pyx_v_index, int __pyx_v_R_time_var_index, int __pyx_v_p_unique_R_number, PyArrayObject *__pyx_v_dR); /* proto */
2635 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_2Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2636 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_4dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2637 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2638 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self); /* proto */
2639 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2640 static int __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, PyArrayObject *__pyx_v_H, int __pyx_v_H_time_var_index, PyArrayObject *__pyx_v_R, PyArrayObject *__pyx_v_index, int __pyx_v_R_time_var_index, int __pyx_v_unique_R_number, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_dR); /* proto */
2641 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_H); /* proto */
2642 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred); /* proto */
2643 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_6dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2644 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self); /* proto */
2645 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2646 static int __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_index, int __pyx_v_Q_time_var_index, int __pyx_v_p_unique_Q_number, PyArrayObject *__pyx_v_dQ); /* proto */
2647 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2648 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_4dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2649 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2650 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self); /* proto */
2651 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2652 static int __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, PyArrayObject *__pyx_v_A, int __pyx_v_A_time_var_index, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_index, int __pyx_v_Q_time_var_index, int __pyx_v_unique_Q_number, PyArrayObject *__pyx_v_dA, PyArrayObject *__pyx_v_dQ); /* proto */
2653 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A); /* proto */
2654 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred); /* proto */
2655 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_6dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2656 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_compute_derivatives); /* proto */
2657 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_10__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self); /* proto */
2658 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_12__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2659 static int __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, PyArrayObject *__pyx_v_As, PyArrayObject *__pyx_v_Qs, PyArrayObject *__pyx_v_reconstruct_indices, PyArrayObject *__pyx_v_dAs, PyArrayObject *__pyx_v_dQs); /* proto */
2660 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A); /* proto */
2661 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_compute_derivatives); /* proto */
2662 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_6Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_P); /* proto */
2663 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_8Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2664 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_10dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2665 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_12dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2666 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k); /* proto */
2667 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, float __pyx_v_jitter); /* proto */
2668 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_18__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self); /* proto */
2669 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_20__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2670 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython(CYTHON_UNUSED PyObject *__pyx_self, long __pyx_v_k, PyArrayObject *__pyx_v_p_m, PyObject *__pyx_v_p_P, struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables, int __pyx_v_calc_grad_log_likelihood, PyArrayObject *__pyx_v_p_dm, PyArrayObject *__pyx_v_p_dP); /* proto */
2671 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython(CYTHON_UNUSED PyObject *__pyx_self, long __pyx_v_k, PyArrayObject *__pyx_v_p_m, PyObject *__pyx_v_p_P, struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables, PyArrayObject *__pyx_v_measurement, int __pyx_v_calc_log_likelihood, int __pyx_v_calc_grad_log_likelihood, PyArrayObject *__pyx_v_p_dm, PyArrayObject *__pyx_v_p_dP); /* proto */
2672 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_4_cont_discr_kalman_filter_raw_Cython(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_state_dim, struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables, struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables, CYTHON_UNUSED PyObject *__pyx_v_X, PyObject *__pyx_v_Y, PyArrayObject *__pyx_v_m_init, PyArrayObject *__pyx_v_P_init, CYTHON_UNUSED PyObject *__pyx_v_p_kalman_filter_type, int __pyx_v_calc_log_likelihood, int __pyx_v_calc_grad_log_likelihood, int __pyx_v_grad_params_no, PyArrayObject *__pyx_v_dm_init, PyArrayObject *__pyx_v_dP_init); /* proto */
2673 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_6__pyx_unpickle_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2674 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_8__pyx_unpickle_Measurement_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2675 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_10__pyx_unpickle_R_handling_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2676 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_12__pyx_unpickle_Std_Measurement_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2677 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_14__pyx_unpickle_Q_handling_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2678 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_16__pyx_unpickle_Std_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2679 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_18__pyx_unpickle_AQcompute_batch_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2680 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2681 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2682 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_R_handling_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2683 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2684 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2685 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2686 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2687 static PyObject *__pyx_float_0_5;
2688 static PyObject *__pyx_float_1_0;
2689 static PyObject *__pyx_float_1eneg_17;
2690 static PyObject *__pyx_float_neg_0_5;
2691 static PyObject *__pyx_int_0;
2692 static PyObject *__pyx_int_1;
2693 static PyObject *__pyx_int_2;
2694 static PyObject *__pyx_int_21422583;
2695 static PyObject *__pyx_int_117883743;
2696 static PyObject *__pyx_int_125522784;
2697 static PyObject *__pyx_int_166296743;
2698 static PyObject *__pyx_int_222419149;
2699 static PyObject *__pyx_int_234819414;
2700 static PyObject *__pyx_tuple_;
2701 static PyObject *__pyx_tuple__2;
2702 static PyObject *__pyx_tuple__3;
2703 static PyObject *__pyx_tuple__4;
2704 static PyObject *__pyx_tuple__5;
2705 static PyObject *__pyx_tuple__6;
2706 static PyObject *__pyx_tuple__7;
2707 static PyObject *__pyx_tuple__8;
2708 static PyObject *__pyx_tuple__9;
2709 static PyObject *__pyx_slice__10;
2710 static PyObject *__pyx_tuple__11;
2711 static PyObject *__pyx_tuple__12;
2712 static PyObject *__pyx_tuple__13;
2713 static PyObject *__pyx_tuple__14;
2714 static PyObject *__pyx_tuple__15;
2715 static PyObject *__pyx_tuple__16;
2716 static PyObject *__pyx_tuple__17;
2717 static PyObject *__pyx_tuple__18;
2718 static PyObject *__pyx_tuple__19;
2719 static PyObject *__pyx_tuple__20;
2720 static PyObject *__pyx_tuple__21;
2721 static PyObject *__pyx_tuple__23;
2722 static PyObject *__pyx_tuple__25;
2723 static PyObject *__pyx_tuple__27;
2724 static PyObject *__pyx_tuple__29;
2725 static PyObject *__pyx_tuple__31;
2726 static PyObject *__pyx_tuple__33;
2727 static PyObject *__pyx_tuple__35;
2728 static PyObject *__pyx_tuple__37;
2729 static PyObject *__pyx_tuple__39;
2730 static PyObject *__pyx_codeobj__22;
2731 static PyObject *__pyx_codeobj__24;
2732 static PyObject *__pyx_codeobj__26;
2733 static PyObject *__pyx_codeobj__28;
2734 static PyObject *__pyx_codeobj__30;
2735 static PyObject *__pyx_codeobj__32;
2736 static PyObject *__pyx_codeobj__34;
2737 static PyObject *__pyx_codeobj__36;
2738 static PyObject *__pyx_codeobj__38;
2739 static PyObject *__pyx_codeobj__40;
2740 /* Late includes */
2741 
2742 /* "GPy/models/state_space_cython.pyx":22
2743  * # Template class for dynamic callables
2744  * cdef class Dynamic_Callables_Cython:
2745  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
2746  *         raise NotImplemented("(cython) f_a is not implemented!")
2747  *
2748  */
2749 
2750 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m,CYTHON_UNUSED PyArrayObject * __pyx_v_A,int __pyx_skip_dispatch)2751 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch) {
2752   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
2753   __Pyx_Buffer __pyx_pybuffer_A;
2754   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
2755   __Pyx_Buffer __pyx_pybuffer_m;
2756   PyObject *__pyx_r = NULL;
2757   __Pyx_RefNannyDeclarations
2758   PyObject *__pyx_t_1 = NULL;
2759   PyObject *__pyx_t_2 = NULL;
2760   PyObject *__pyx_t_3 = NULL;
2761   PyObject *__pyx_t_4 = NULL;
2762   PyObject *__pyx_t_5 = NULL;
2763   int __pyx_t_6;
2764   PyObject *__pyx_t_7 = NULL;
2765   int __pyx_lineno = 0;
2766   const char *__pyx_filename = NULL;
2767   int __pyx_clineno = 0;
2768   __Pyx_RefNannySetupContext("f_a", 0);
2769   __pyx_pybuffer_m.pybuffer.buf = NULL;
2770   __pyx_pybuffer_m.refcount = 0;
2771   __pyx_pybuffernd_m.data = NULL;
2772   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
2773   __pyx_pybuffer_A.pybuffer.buf = NULL;
2774   __pyx_pybuffer_A.refcount = 0;
2775   __pyx_pybuffernd_A.data = NULL;
2776   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
2777   {
2778     __Pyx_BufFmt_StackElem __pyx_stack[1];
2779     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
2780   }
2781   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
2782   {
2783     __Pyx_BufFmt_StackElem __pyx_stack[1];
2784     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
2785   }
2786   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
2787   /* Check if called by wrapper */
2788   if (unlikely(__pyx_skip_dispatch)) ;
2789   /* Check if overridden in Python */
2790   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
2791     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2792     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2793     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
2794       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2795       #endif
2796       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
2797       __Pyx_GOTREF(__pyx_t_1);
2798       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a)) {
2799         __Pyx_XDECREF(__pyx_r);
2800         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
2801         __Pyx_GOTREF(__pyx_t_3);
2802         __Pyx_INCREF(__pyx_t_1);
2803         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
2804         __pyx_t_6 = 0;
2805         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
2806           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
2807           if (likely(__pyx_t_5)) {
2808             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
2809             __Pyx_INCREF(__pyx_t_5);
2810             __Pyx_INCREF(function);
2811             __Pyx_DECREF_SET(__pyx_t_4, function);
2812             __pyx_t_6 = 1;
2813           }
2814         }
2815         #if CYTHON_FAST_PYCALL
2816         if (PyFunction_Check(__pyx_t_4)) {
2817           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
2818           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
2819           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2820           __Pyx_GOTREF(__pyx_t_2);
2821           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2822         } else
2823         #endif
2824         #if CYTHON_FAST_PYCCALL
2825         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
2826           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
2827           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
2828           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
2829           __Pyx_GOTREF(__pyx_t_2);
2830           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2831         } else
2832         #endif
2833         {
2834           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
2835           __Pyx_GOTREF(__pyx_t_7);
2836           if (__pyx_t_5) {
2837             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
2838           }
2839           __Pyx_GIVEREF(__pyx_t_3);
2840           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
2841           __Pyx_INCREF(((PyObject *)__pyx_v_m));
2842           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
2843           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
2844           __Pyx_INCREF(((PyObject *)__pyx_v_A));
2845           __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
2846           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_A));
2847           __pyx_t_3 = 0;
2848           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
2849           __Pyx_GOTREF(__pyx_t_2);
2850           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2851         }
2852         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2853         __pyx_r = __pyx_t_2;
2854         __pyx_t_2 = 0;
2855         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2856         goto __pyx_L0;
2857       }
2858       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2859       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
2860       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
2861       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
2862         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
2863       }
2864       #endif
2865       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2866       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
2867     }
2868     #endif
2869   }
2870 
2871   /* "GPy/models/state_space_cython.pyx":23
2872  * cdef class Dynamic_Callables_Cython:
2873  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):
2874  *         raise NotImplemented("(cython) f_a is not implemented!")             # <<<<<<<<<<<<<<
2875  *
2876  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix
2877  */
2878   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
2879   __Pyx_GOTREF(__pyx_t_1);
2880   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
2881   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2882   __PYX_ERR(0, 23, __pyx_L1_error)
2883 
2884   /* "GPy/models/state_space_cython.pyx":22
2885  * # Template class for dynamic callables
2886  * cdef class Dynamic_Callables_Cython:
2887  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
2888  *         raise NotImplemented("(cython) f_a is not implemented!")
2889  *
2890  */
2891 
2892   /* function exit code */
2893   __pyx_L1_error:;
2894   __Pyx_XDECREF(__pyx_t_1);
2895   __Pyx_XDECREF(__pyx_t_2);
2896   __Pyx_XDECREF(__pyx_t_3);
2897   __Pyx_XDECREF(__pyx_t_4);
2898   __Pyx_XDECREF(__pyx_t_5);
2899   __Pyx_XDECREF(__pyx_t_7);
2900   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2901     __Pyx_PyThreadState_declare
2902     __Pyx_PyThreadState_assign
2903     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2904     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
2905     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
2906   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2907   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
2908   __pyx_r = 0;
2909   goto __pyx_L2;
2910   __pyx_L0:;
2911   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
2912   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
2913   __pyx_L2:;
2914   __Pyx_XGIVEREF(__pyx_r);
2915   __Pyx_RefNannyFinishContext();
2916   return __pyx_r;
2917 }
2918 
2919 /* Python wrapper */
2920 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2921 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2922   int __pyx_v_k;
2923   PyArrayObject *__pyx_v_m = 0;
2924   PyArrayObject *__pyx_v_A = 0;
2925   int __pyx_lineno = 0;
2926   const char *__pyx_filename = NULL;
2927   int __pyx_clineno = 0;
2928   PyObject *__pyx_r = 0;
2929   __Pyx_RefNannyDeclarations
2930   __Pyx_RefNannySetupContext("f_a (wrapper)", 0);
2931   {
2932     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_A,0};
2933     PyObject* values[3] = {0,0,0};
2934     if (unlikely(__pyx_kwds)) {
2935       Py_ssize_t kw_args;
2936       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2937       switch (pos_args) {
2938         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2939         CYTHON_FALLTHROUGH;
2940         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2941         CYTHON_FALLTHROUGH;
2942         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2943         CYTHON_FALLTHROUGH;
2944         case  0: break;
2945         default: goto __pyx_L5_argtuple_error;
2946       }
2947       kw_args = PyDict_Size(__pyx_kwds);
2948       switch (pos_args) {
2949         case  0:
2950         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
2951         else goto __pyx_L5_argtuple_error;
2952         CYTHON_FALLTHROUGH;
2953         case  1:
2954         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
2955         else {
2956           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 1); __PYX_ERR(0, 22, __pyx_L3_error)
2957         }
2958         CYTHON_FALLTHROUGH;
2959         case  2:
2960         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
2961         else {
2962           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 2); __PYX_ERR(0, 22, __pyx_L3_error)
2963         }
2964       }
2965       if (unlikely(kw_args > 0)) {
2966         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f_a") < 0)) __PYX_ERR(0, 22, __pyx_L3_error)
2967       }
2968     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2969       goto __pyx_L5_argtuple_error;
2970     } else {
2971       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2972       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2973       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2974     }
2975     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 22, __pyx_L3_error)
2976     __pyx_v_m = ((PyArrayObject *)values[1]);
2977     __pyx_v_A = ((PyArrayObject *)values[2]);
2978   }
2979   goto __pyx_L4_argument_unpacking_done;
2980   __pyx_L5_argtuple_error:;
2981   __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 22, __pyx_L3_error)
2982   __pyx_L3_error:;
2983   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
2984   __Pyx_RefNannyFinishContext();
2985   return NULL;
2986   __pyx_L4_argument_unpacking_done:;
2987   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2988   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 22, __pyx_L1_error)
2989   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_A);
2990 
2991   /* function exit code */
2992   goto __pyx_L0;
2993   __pyx_L1_error:;
2994   __pyx_r = NULL;
2995   __pyx_L0:;
2996   __Pyx_RefNannyFinishContext();
2997   return __pyx_r;
2998 }
2999 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_A)3000 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A) {
3001   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
3002   __Pyx_Buffer __pyx_pybuffer_A;
3003   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
3004   __Pyx_Buffer __pyx_pybuffer_m;
3005   PyObject *__pyx_r = NULL;
3006   __Pyx_RefNannyDeclarations
3007   PyObject *__pyx_t_1 = NULL;
3008   int __pyx_lineno = 0;
3009   const char *__pyx_filename = NULL;
3010   int __pyx_clineno = 0;
3011   __Pyx_RefNannySetupContext("f_a", 0);
3012   __pyx_pybuffer_m.pybuffer.buf = NULL;
3013   __pyx_pybuffer_m.refcount = 0;
3014   __pyx_pybuffernd_m.data = NULL;
3015   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
3016   __pyx_pybuffer_A.pybuffer.buf = NULL;
3017   __pyx_pybuffer_A.refcount = 0;
3018   __pyx_pybuffernd_A.data = NULL;
3019   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
3020   {
3021     __Pyx_BufFmt_StackElem __pyx_stack[1];
3022     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
3023   }
3024   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
3025   {
3026     __Pyx_BufFmt_StackElem __pyx_stack[1];
3027     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 22, __pyx_L1_error)
3028   }
3029   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
3030   __Pyx_XDECREF(__pyx_r);
3031   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a(__pyx_v_self, __pyx_v_k, __pyx_v_m, __pyx_v_A, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
3032   __Pyx_GOTREF(__pyx_t_1);
3033   __pyx_r = __pyx_t_1;
3034   __pyx_t_1 = 0;
3035   goto __pyx_L0;
3036 
3037   /* function exit code */
3038   __pyx_L1_error:;
3039   __Pyx_XDECREF(__pyx_t_1);
3040   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3041     __Pyx_PyThreadState_declare
3042     __Pyx_PyThreadState_assign
3043     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3044     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
3045     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3046   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3047   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
3048   __pyx_r = NULL;
3049   goto __pyx_L2;
3050   __pyx_L0:;
3051   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
3052   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3053   __pyx_L2:;
3054   __Pyx_XGIVEREF(__pyx_r);
3055   __Pyx_RefNannyFinishContext();
3056   return __pyx_r;
3057 }
3058 
3059 /* "GPy/models/state_space_cython.pyx":25
3060  *         raise NotImplemented("(cython) f_a is not implemented!")
3061  *
3062  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix             # <<<<<<<<<<<<<<
3063  *         raise NotImplemented("(cython) Ak is not implemented!")
3064  *
3065  */
3066 
3067 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Ak(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m,CYTHON_UNUSED PyArrayObject * __pyx_v_P,int __pyx_skip_dispatch)3068 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Ak(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_P, int __pyx_skip_dispatch) {
3069   __Pyx_LocalBuf_ND __pyx_pybuffernd_P;
3070   __Pyx_Buffer __pyx_pybuffer_P;
3071   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
3072   __Pyx_Buffer __pyx_pybuffer_m;
3073   PyObject *__pyx_r = NULL;
3074   __Pyx_RefNannyDeclarations
3075   PyObject *__pyx_t_1 = NULL;
3076   PyObject *__pyx_t_2 = NULL;
3077   PyObject *__pyx_t_3 = NULL;
3078   PyObject *__pyx_t_4 = NULL;
3079   PyObject *__pyx_t_5 = NULL;
3080   int __pyx_t_6;
3081   PyObject *__pyx_t_7 = NULL;
3082   int __pyx_lineno = 0;
3083   const char *__pyx_filename = NULL;
3084   int __pyx_clineno = 0;
3085   __Pyx_RefNannySetupContext("Ak", 0);
3086   __pyx_pybuffer_m.pybuffer.buf = NULL;
3087   __pyx_pybuffer_m.refcount = 0;
3088   __pyx_pybuffernd_m.data = NULL;
3089   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
3090   __pyx_pybuffer_P.pybuffer.buf = NULL;
3091   __pyx_pybuffer_P.refcount = 0;
3092   __pyx_pybuffernd_P.data = NULL;
3093   __pyx_pybuffernd_P.rcbuffer = &__pyx_pybuffer_P;
3094   {
3095     __Pyx_BufFmt_StackElem __pyx_stack[1];
3096     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error)
3097   }
3098   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
3099   {
3100     __Pyx_BufFmt_StackElem __pyx_stack[1];
3101     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P.rcbuffer->pybuffer, (PyObject*)__pyx_v_P, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error)
3102   }
3103   __pyx_pybuffernd_P.diminfo[0].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P.diminfo[0].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P.diminfo[1].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P.diminfo[1].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[1];
3104   /* Check if called by wrapper */
3105   if (unlikely(__pyx_skip_dispatch)) ;
3106   /* Check if overridden in Python */
3107   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3108     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3109     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3110     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3111       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3112       #endif
3113       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Ak); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3114       __Pyx_GOTREF(__pyx_t_1);
3115       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak)) {
3116         __Pyx_XDECREF(__pyx_r);
3117         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
3118         __Pyx_GOTREF(__pyx_t_3);
3119         __Pyx_INCREF(__pyx_t_1);
3120         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
3121         __pyx_t_6 = 0;
3122         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3123           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3124           if (likely(__pyx_t_5)) {
3125             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3126             __Pyx_INCREF(__pyx_t_5);
3127             __Pyx_INCREF(function);
3128             __Pyx_DECREF_SET(__pyx_t_4, function);
3129             __pyx_t_6 = 1;
3130           }
3131         }
3132         #if CYTHON_FAST_PYCALL
3133         if (PyFunction_Check(__pyx_t_4)) {
3134           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_P)};
3135           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3136           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3137           __Pyx_GOTREF(__pyx_t_2);
3138           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3139         } else
3140         #endif
3141         #if CYTHON_FAST_PYCCALL
3142         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3143           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_P)};
3144           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3145           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3146           __Pyx_GOTREF(__pyx_t_2);
3147           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3148         } else
3149         #endif
3150         {
3151           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L1_error)
3152           __Pyx_GOTREF(__pyx_t_7);
3153           if (__pyx_t_5) {
3154             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3155           }
3156           __Pyx_GIVEREF(__pyx_t_3);
3157           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
3158           __Pyx_INCREF(((PyObject *)__pyx_v_m));
3159           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
3160           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
3161           __Pyx_INCREF(((PyObject *)__pyx_v_P));
3162           __Pyx_GIVEREF(((PyObject *)__pyx_v_P));
3163           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_P));
3164           __pyx_t_3 = 0;
3165           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
3166           __Pyx_GOTREF(__pyx_t_2);
3167           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3168         }
3169         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3170         __pyx_r = __pyx_t_2;
3171         __pyx_t_2 = 0;
3172         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3173         goto __pyx_L0;
3174       }
3175       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3176       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3177       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3178       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
3179         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3180       }
3181       #endif
3182       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3183       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3184     }
3185     #endif
3186   }
3187 
3188   /* "GPy/models/state_space_cython.pyx":26
3189  *
3190  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix
3191  *         raise NotImplemented("(cython) Ak is not implemented!")             # <<<<<<<<<<<<<<
3192  *
3193  *     cpdef Qk(self, int k):
3194  */
3195   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
3196   __Pyx_GOTREF(__pyx_t_1);
3197   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3198   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3199   __PYX_ERR(0, 26, __pyx_L1_error)
3200 
3201   /* "GPy/models/state_space_cython.pyx":25
3202  *         raise NotImplemented("(cython) f_a is not implemented!")
3203  *
3204  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix             # <<<<<<<<<<<<<<
3205  *         raise NotImplemented("(cython) Ak is not implemented!")
3206  *
3207  */
3208 
3209   /* function exit code */
3210   __pyx_L1_error:;
3211   __Pyx_XDECREF(__pyx_t_1);
3212   __Pyx_XDECREF(__pyx_t_2);
3213   __Pyx_XDECREF(__pyx_t_3);
3214   __Pyx_XDECREF(__pyx_t_4);
3215   __Pyx_XDECREF(__pyx_t_5);
3216   __Pyx_XDECREF(__pyx_t_7);
3217   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3218     __Pyx_PyThreadState_declare
3219     __Pyx_PyThreadState_assign
3220     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3221     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
3222     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3223   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3224   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
3225   __pyx_r = 0;
3226   goto __pyx_L2;
3227   __pyx_L0:;
3228   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
3229   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3230   __pyx_L2:;
3231   __Pyx_XGIVEREF(__pyx_r);
3232   __Pyx_RefNannyFinishContext();
3233   return __pyx_r;
3234 }
3235 
3236 /* Python wrapper */
3237 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3238 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3239   int __pyx_v_k;
3240   PyArrayObject *__pyx_v_m = 0;
3241   PyArrayObject *__pyx_v_P = 0;
3242   int __pyx_lineno = 0;
3243   const char *__pyx_filename = NULL;
3244   int __pyx_clineno = 0;
3245   PyObject *__pyx_r = 0;
3246   __Pyx_RefNannyDeclarations
3247   __Pyx_RefNannySetupContext("Ak (wrapper)", 0);
3248   {
3249     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_P,0};
3250     PyObject* values[3] = {0,0,0};
3251     if (unlikely(__pyx_kwds)) {
3252       Py_ssize_t kw_args;
3253       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3254       switch (pos_args) {
3255         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3256         CYTHON_FALLTHROUGH;
3257         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3258         CYTHON_FALLTHROUGH;
3259         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3260         CYTHON_FALLTHROUGH;
3261         case  0: break;
3262         default: goto __pyx_L5_argtuple_error;
3263       }
3264       kw_args = PyDict_Size(__pyx_kwds);
3265       switch (pos_args) {
3266         case  0:
3267         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
3268         else goto __pyx_L5_argtuple_error;
3269         CYTHON_FALLTHROUGH;
3270         case  1:
3271         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
3272         else {
3273           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 1); __PYX_ERR(0, 25, __pyx_L3_error)
3274         }
3275         CYTHON_FALLTHROUGH;
3276         case  2:
3277         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
3278         else {
3279           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 2); __PYX_ERR(0, 25, __pyx_L3_error)
3280         }
3281       }
3282       if (unlikely(kw_args > 0)) {
3283         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Ak") < 0)) __PYX_ERR(0, 25, __pyx_L3_error)
3284       }
3285     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
3286       goto __pyx_L5_argtuple_error;
3287     } else {
3288       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3289       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3290       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3291     }
3292     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 25, __pyx_L3_error)
3293     __pyx_v_m = ((PyArrayObject *)values[1]);
3294     __pyx_v_P = ((PyArrayObject *)values[2]);
3295   }
3296   goto __pyx_L4_argument_unpacking_done;
3297   __pyx_L5_argtuple_error:;
3298   __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 25, __pyx_L3_error)
3299   __pyx_L3_error:;
3300   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
3301   __Pyx_RefNannyFinishContext();
3302   return NULL;
3303   __pyx_L4_argument_unpacking_done:;
3304   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 25, __pyx_L1_error)
3305   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_5numpy_ndarray, 1, "P", 0))) __PYX_ERR(0, 25, __pyx_L1_error)
3306   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_2Ak(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_P);
3307 
3308   /* function exit code */
3309   goto __pyx_L0;
3310   __pyx_L1_error:;
3311   __pyx_r = NULL;
3312   __pyx_L0:;
3313   __Pyx_RefNannyFinishContext();
3314   return __pyx_r;
3315 }
3316 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_2Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_P)3317 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_2Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_P) {
3318   __Pyx_LocalBuf_ND __pyx_pybuffernd_P;
3319   __Pyx_Buffer __pyx_pybuffer_P;
3320   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
3321   __Pyx_Buffer __pyx_pybuffer_m;
3322   PyObject *__pyx_r = NULL;
3323   __Pyx_RefNannyDeclarations
3324   PyObject *__pyx_t_1 = NULL;
3325   int __pyx_lineno = 0;
3326   const char *__pyx_filename = NULL;
3327   int __pyx_clineno = 0;
3328   __Pyx_RefNannySetupContext("Ak", 0);
3329   __pyx_pybuffer_m.pybuffer.buf = NULL;
3330   __pyx_pybuffer_m.refcount = 0;
3331   __pyx_pybuffernd_m.data = NULL;
3332   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
3333   __pyx_pybuffer_P.pybuffer.buf = NULL;
3334   __pyx_pybuffer_P.refcount = 0;
3335   __pyx_pybuffernd_P.data = NULL;
3336   __pyx_pybuffernd_P.rcbuffer = &__pyx_pybuffer_P;
3337   {
3338     __Pyx_BufFmt_StackElem __pyx_stack[1];
3339     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error)
3340   }
3341   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
3342   {
3343     __Pyx_BufFmt_StackElem __pyx_stack[1];
3344     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P.rcbuffer->pybuffer, (PyObject*)__pyx_v_P, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 25, __pyx_L1_error)
3345   }
3346   __pyx_pybuffernd_P.diminfo[0].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P.diminfo[0].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P.diminfo[1].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P.diminfo[1].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[1];
3347   __Pyx_XDECREF(__pyx_r);
3348   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Ak(__pyx_v_self, __pyx_v_k, __pyx_v_m, __pyx_v_P, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
3349   __Pyx_GOTREF(__pyx_t_1);
3350   __pyx_r = __pyx_t_1;
3351   __pyx_t_1 = 0;
3352   goto __pyx_L0;
3353 
3354   /* function exit code */
3355   __pyx_L1_error:;
3356   __Pyx_XDECREF(__pyx_t_1);
3357   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3358     __Pyx_PyThreadState_declare
3359     __Pyx_PyThreadState_assign
3360     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3361     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
3362     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3363   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3364   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
3365   __pyx_r = NULL;
3366   goto __pyx_L2;
3367   __pyx_L0:;
3368   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
3369   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
3370   __pyx_L2:;
3371   __Pyx_XGIVEREF(__pyx_r);
3372   __Pyx_RefNannyFinishContext();
3373   return __pyx_r;
3374 }
3375 
3376 /* "GPy/models/state_space_cython.pyx":28
3377  *         raise NotImplemented("(cython) Ak is not implemented!")
3378  *
3379  *     cpdef Qk(self, int k):             # <<<<<<<<<<<<<<
3380  *         raise NotImplemented("(cython) Qk is not implemented!")
3381  *
3382  */
3383 
3384 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Qk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)3385 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Qk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
3386   PyObject *__pyx_r = NULL;
3387   __Pyx_RefNannyDeclarations
3388   PyObject *__pyx_t_1 = NULL;
3389   PyObject *__pyx_t_2 = NULL;
3390   PyObject *__pyx_t_3 = NULL;
3391   PyObject *__pyx_t_4 = NULL;
3392   PyObject *__pyx_t_5 = NULL;
3393   int __pyx_lineno = 0;
3394   const char *__pyx_filename = NULL;
3395   int __pyx_clineno = 0;
3396   __Pyx_RefNannySetupContext("Qk", 0);
3397   /* Check if called by wrapper */
3398   if (unlikely(__pyx_skip_dispatch)) ;
3399   /* Check if overridden in Python */
3400   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3401     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3402     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3403     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3404       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3405       #endif
3406       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Qk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3407       __Pyx_GOTREF(__pyx_t_1);
3408       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk)) {
3409         __Pyx_XDECREF(__pyx_r);
3410         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
3411         __Pyx_GOTREF(__pyx_t_3);
3412         __Pyx_INCREF(__pyx_t_1);
3413         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
3414         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3415           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3416           if (likely(__pyx_t_5)) {
3417             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3418             __Pyx_INCREF(__pyx_t_5);
3419             __Pyx_INCREF(function);
3420             __Pyx_DECREF_SET(__pyx_t_4, function);
3421           }
3422         }
3423         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
3424         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3425         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3426         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
3427         __Pyx_GOTREF(__pyx_t_2);
3428         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3429         __pyx_r = __pyx_t_2;
3430         __pyx_t_2 = 0;
3431         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3432         goto __pyx_L0;
3433       }
3434       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3435       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3436       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3437       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
3438         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3439       }
3440       #endif
3441       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3442       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3443     }
3444     #endif
3445   }
3446 
3447   /* "GPy/models/state_space_cython.pyx":29
3448  *
3449  *     cpdef Qk(self, int k):
3450  *         raise NotImplemented("(cython) Qk is not implemented!")             # <<<<<<<<<<<<<<
3451  *
3452  *     cpdef Q_srk(self, int k):
3453  */
3454   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L1_error)
3455   __Pyx_GOTREF(__pyx_t_1);
3456   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3457   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3458   __PYX_ERR(0, 29, __pyx_L1_error)
3459 
3460   /* "GPy/models/state_space_cython.pyx":28
3461  *         raise NotImplemented("(cython) Ak is not implemented!")
3462  *
3463  *     cpdef Qk(self, int k):             # <<<<<<<<<<<<<<
3464  *         raise NotImplemented("(cython) Qk is not implemented!")
3465  *
3466  */
3467 
3468   /* function exit code */
3469   __pyx_L1_error:;
3470   __Pyx_XDECREF(__pyx_t_1);
3471   __Pyx_XDECREF(__pyx_t_2);
3472   __Pyx_XDECREF(__pyx_t_3);
3473   __Pyx_XDECREF(__pyx_t_4);
3474   __Pyx_XDECREF(__pyx_t_5);
3475   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3476   __pyx_r = 0;
3477   __pyx_L0:;
3478   __Pyx_XGIVEREF(__pyx_r);
3479   __Pyx_RefNannyFinishContext();
3480   return __pyx_r;
3481 }
3482 
3483 /* Python wrapper */
3484 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)3485 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
3486   int __pyx_v_k;
3487   int __pyx_lineno = 0;
3488   const char *__pyx_filename = NULL;
3489   int __pyx_clineno = 0;
3490   PyObject *__pyx_r = 0;
3491   __Pyx_RefNannyDeclarations
3492   __Pyx_RefNannySetupContext("Qk (wrapper)", 0);
3493   assert(__pyx_arg_k); {
3494     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
3495   }
3496   goto __pyx_L4_argument_unpacking_done;
3497   __pyx_L3_error:;
3498   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3499   __Pyx_RefNannyFinishContext();
3500   return NULL;
3501   __pyx_L4_argument_unpacking_done:;
3502   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_4Qk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
3503 
3504   /* function exit code */
3505   __Pyx_RefNannyFinishContext();
3506   return __pyx_r;
3507 }
3508 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_4Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k)3509 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_4Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
3510   PyObject *__pyx_r = NULL;
3511   __Pyx_RefNannyDeclarations
3512   PyObject *__pyx_t_1 = NULL;
3513   int __pyx_lineno = 0;
3514   const char *__pyx_filename = NULL;
3515   int __pyx_clineno = 0;
3516   __Pyx_RefNannySetupContext("Qk", 0);
3517   __Pyx_XDECREF(__pyx_r);
3518   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Qk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
3519   __Pyx_GOTREF(__pyx_t_1);
3520   __pyx_r = __pyx_t_1;
3521   __pyx_t_1 = 0;
3522   goto __pyx_L0;
3523 
3524   /* function exit code */
3525   __pyx_L1_error:;
3526   __Pyx_XDECREF(__pyx_t_1);
3527   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3528   __pyx_r = NULL;
3529   __pyx_L0:;
3530   __Pyx_XGIVEREF(__pyx_r);
3531   __Pyx_RefNannyFinishContext();
3532   return __pyx_r;
3533 }
3534 
3535 /* "GPy/models/state_space_cython.pyx":31
3536  *         raise NotImplemented("(cython) Qk is not implemented!")
3537  *
3538  *     cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
3539  *         raise NotImplemented("(cython) Q_srk is not implemented!")
3540  *
3541  */
3542 
3543 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Q_srk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)3544 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Q_srk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
3545   PyObject *__pyx_r = NULL;
3546   __Pyx_RefNannyDeclarations
3547   PyObject *__pyx_t_1 = NULL;
3548   PyObject *__pyx_t_2 = NULL;
3549   PyObject *__pyx_t_3 = NULL;
3550   PyObject *__pyx_t_4 = NULL;
3551   PyObject *__pyx_t_5 = NULL;
3552   int __pyx_lineno = 0;
3553   const char *__pyx_filename = NULL;
3554   int __pyx_clineno = 0;
3555   __Pyx_RefNannySetupContext("Q_srk", 0);
3556   /* Check if called by wrapper */
3557   if (unlikely(__pyx_skip_dispatch)) ;
3558   /* Check if overridden in Python */
3559   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3560     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3561     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3562     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3563       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3564       #endif
3565       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_srk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3566       __Pyx_GOTREF(__pyx_t_1);
3567       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk)) {
3568         __Pyx_XDECREF(__pyx_r);
3569         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 31, __pyx_L1_error)
3570         __Pyx_GOTREF(__pyx_t_3);
3571         __Pyx_INCREF(__pyx_t_1);
3572         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
3573         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3574           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3575           if (likely(__pyx_t_5)) {
3576             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3577             __Pyx_INCREF(__pyx_t_5);
3578             __Pyx_INCREF(function);
3579             __Pyx_DECREF_SET(__pyx_t_4, function);
3580           }
3581         }
3582         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
3583         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3584         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3585         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
3586         __Pyx_GOTREF(__pyx_t_2);
3587         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3588         __pyx_r = __pyx_t_2;
3589         __pyx_t_2 = 0;
3590         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3591         goto __pyx_L0;
3592       }
3593       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3594       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3595       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3596       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
3597         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3598       }
3599       #endif
3600       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3601       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3602     }
3603     #endif
3604   }
3605 
3606   /* "GPy/models/state_space_cython.pyx":32
3607  *
3608  *     cpdef Q_srk(self, int k):
3609  *         raise NotImplemented("(cython) Q_srk is not implemented!")             # <<<<<<<<<<<<<<
3610  *
3611  *     cpdef dAk(self, int k):
3612  */
3613   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
3614   __Pyx_GOTREF(__pyx_t_1);
3615   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3616   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3617   __PYX_ERR(0, 32, __pyx_L1_error)
3618 
3619   /* "GPy/models/state_space_cython.pyx":31
3620  *         raise NotImplemented("(cython) Qk is not implemented!")
3621  *
3622  *     cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
3623  *         raise NotImplemented("(cython) Q_srk is not implemented!")
3624  *
3625  */
3626 
3627   /* function exit code */
3628   __pyx_L1_error:;
3629   __Pyx_XDECREF(__pyx_t_1);
3630   __Pyx_XDECREF(__pyx_t_2);
3631   __Pyx_XDECREF(__pyx_t_3);
3632   __Pyx_XDECREF(__pyx_t_4);
3633   __Pyx_XDECREF(__pyx_t_5);
3634   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3635   __pyx_r = 0;
3636   __pyx_L0:;
3637   __Pyx_XGIVEREF(__pyx_r);
3638   __Pyx_RefNannyFinishContext();
3639   return __pyx_r;
3640 }
3641 
3642 /* Python wrapper */
3643 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)3644 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
3645   int __pyx_v_k;
3646   int __pyx_lineno = 0;
3647   const char *__pyx_filename = NULL;
3648   int __pyx_clineno = 0;
3649   PyObject *__pyx_r = 0;
3650   __Pyx_RefNannyDeclarations
3651   __Pyx_RefNannySetupContext("Q_srk (wrapper)", 0);
3652   assert(__pyx_arg_k); {
3653     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
3654   }
3655   goto __pyx_L4_argument_unpacking_done;
3656   __pyx_L3_error:;
3657   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3658   __Pyx_RefNannyFinishContext();
3659   return NULL;
3660   __pyx_L4_argument_unpacking_done:;
3661   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_6Q_srk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
3662 
3663   /* function exit code */
3664   __Pyx_RefNannyFinishContext();
3665   return __pyx_r;
3666 }
3667 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k)3668 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
3669   PyObject *__pyx_r = NULL;
3670   __Pyx_RefNannyDeclarations
3671   PyObject *__pyx_t_1 = NULL;
3672   int __pyx_lineno = 0;
3673   const char *__pyx_filename = NULL;
3674   int __pyx_clineno = 0;
3675   __Pyx_RefNannySetupContext("Q_srk", 0);
3676   __Pyx_XDECREF(__pyx_r);
3677   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Q_srk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
3678   __Pyx_GOTREF(__pyx_t_1);
3679   __pyx_r = __pyx_t_1;
3680   __pyx_t_1 = 0;
3681   goto __pyx_L0;
3682 
3683   /* function exit code */
3684   __pyx_L1_error:;
3685   __Pyx_XDECREF(__pyx_t_1);
3686   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3687   __pyx_r = NULL;
3688   __pyx_L0:;
3689   __Pyx_XGIVEREF(__pyx_r);
3690   __Pyx_RefNannyFinishContext();
3691   return __pyx_r;
3692 }
3693 
3694 /* "GPy/models/state_space_cython.pyx":34
3695  *         raise NotImplemented("(cython) Q_srk is not implemented!")
3696  *
3697  *     cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
3698  *         raise NotImplemented("(cython) dAk is not implemented!")
3699  *
3700  */
3701 
3702 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dAk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)3703 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dAk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
3704   PyObject *__pyx_r = NULL;
3705   __Pyx_RefNannyDeclarations
3706   PyObject *__pyx_t_1 = NULL;
3707   PyObject *__pyx_t_2 = NULL;
3708   PyObject *__pyx_t_3 = NULL;
3709   PyObject *__pyx_t_4 = NULL;
3710   PyObject *__pyx_t_5 = NULL;
3711   int __pyx_lineno = 0;
3712   const char *__pyx_filename = NULL;
3713   int __pyx_clineno = 0;
3714   __Pyx_RefNannySetupContext("dAk", 0);
3715   /* Check if called by wrapper */
3716   if (unlikely(__pyx_skip_dispatch)) ;
3717   /* Check if overridden in Python */
3718   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3719     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3720     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3721     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3722       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3723       #endif
3724       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dAk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3725       __Pyx_GOTREF(__pyx_t_1);
3726       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk)) {
3727         __Pyx_XDECREF(__pyx_r);
3728         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
3729         __Pyx_GOTREF(__pyx_t_3);
3730         __Pyx_INCREF(__pyx_t_1);
3731         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
3732         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3733           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3734           if (likely(__pyx_t_5)) {
3735             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3736             __Pyx_INCREF(__pyx_t_5);
3737             __Pyx_INCREF(function);
3738             __Pyx_DECREF_SET(__pyx_t_4, function);
3739           }
3740         }
3741         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
3742         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3743         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3744         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
3745         __Pyx_GOTREF(__pyx_t_2);
3746         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3747         __pyx_r = __pyx_t_2;
3748         __pyx_t_2 = 0;
3749         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3750         goto __pyx_L0;
3751       }
3752       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3753       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3754       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3755       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
3756         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3757       }
3758       #endif
3759       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3760       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3761     }
3762     #endif
3763   }
3764 
3765   /* "GPy/models/state_space_cython.pyx":35
3766  *
3767  *     cpdef dAk(self, int k):
3768  *         raise NotImplemented("(cython) dAk is not implemented!")             # <<<<<<<<<<<<<<
3769  *
3770  *     cpdef dQk(self, int k):
3771  */
3772   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
3773   __Pyx_GOTREF(__pyx_t_1);
3774   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3775   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3776   __PYX_ERR(0, 35, __pyx_L1_error)
3777 
3778   /* "GPy/models/state_space_cython.pyx":34
3779  *         raise NotImplemented("(cython) Q_srk is not implemented!")
3780  *
3781  *     cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
3782  *         raise NotImplemented("(cython) dAk is not implemented!")
3783  *
3784  */
3785 
3786   /* function exit code */
3787   __pyx_L1_error:;
3788   __Pyx_XDECREF(__pyx_t_1);
3789   __Pyx_XDECREF(__pyx_t_2);
3790   __Pyx_XDECREF(__pyx_t_3);
3791   __Pyx_XDECREF(__pyx_t_4);
3792   __Pyx_XDECREF(__pyx_t_5);
3793   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3794   __pyx_r = 0;
3795   __pyx_L0:;
3796   __Pyx_XGIVEREF(__pyx_r);
3797   __Pyx_RefNannyFinishContext();
3798   return __pyx_r;
3799 }
3800 
3801 /* Python wrapper */
3802 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)3803 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
3804   int __pyx_v_k;
3805   int __pyx_lineno = 0;
3806   const char *__pyx_filename = NULL;
3807   int __pyx_clineno = 0;
3808   PyObject *__pyx_r = 0;
3809   __Pyx_RefNannyDeclarations
3810   __Pyx_RefNannySetupContext("dAk (wrapper)", 0);
3811   assert(__pyx_arg_k); {
3812     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 34, __pyx_L3_error)
3813   }
3814   goto __pyx_L4_argument_unpacking_done;
3815   __pyx_L3_error:;
3816   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3817   __Pyx_RefNannyFinishContext();
3818   return NULL;
3819   __pyx_L4_argument_unpacking_done:;
3820   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_8dAk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
3821 
3822   /* function exit code */
3823   __Pyx_RefNannyFinishContext();
3824   return __pyx_r;
3825 }
3826 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_8dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k)3827 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_8dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
3828   PyObject *__pyx_r = NULL;
3829   __Pyx_RefNannyDeclarations
3830   PyObject *__pyx_t_1 = NULL;
3831   int __pyx_lineno = 0;
3832   const char *__pyx_filename = NULL;
3833   int __pyx_clineno = 0;
3834   __Pyx_RefNannySetupContext("dAk", 0);
3835   __Pyx_XDECREF(__pyx_r);
3836   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dAk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
3837   __Pyx_GOTREF(__pyx_t_1);
3838   __pyx_r = __pyx_t_1;
3839   __pyx_t_1 = 0;
3840   goto __pyx_L0;
3841 
3842   /* function exit code */
3843   __pyx_L1_error:;
3844   __Pyx_XDECREF(__pyx_t_1);
3845   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3846   __pyx_r = NULL;
3847   __pyx_L0:;
3848   __Pyx_XGIVEREF(__pyx_r);
3849   __Pyx_RefNannyFinishContext();
3850   return __pyx_r;
3851 }
3852 
3853 /* "GPy/models/state_space_cython.pyx":37
3854  *         raise NotImplemented("(cython) dAk is not implemented!")
3855  *
3856  *     cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
3857  *         raise NotImplemented("(cython) dQk is not implemented!")
3858  *
3859  */
3860 
3861 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dQk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)3862 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dQk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
3863   PyObject *__pyx_r = NULL;
3864   __Pyx_RefNannyDeclarations
3865   PyObject *__pyx_t_1 = NULL;
3866   PyObject *__pyx_t_2 = NULL;
3867   PyObject *__pyx_t_3 = NULL;
3868   PyObject *__pyx_t_4 = NULL;
3869   PyObject *__pyx_t_5 = NULL;
3870   int __pyx_lineno = 0;
3871   const char *__pyx_filename = NULL;
3872   int __pyx_clineno = 0;
3873   __Pyx_RefNannySetupContext("dQk", 0);
3874   /* Check if called by wrapper */
3875   if (unlikely(__pyx_skip_dispatch)) ;
3876   /* Check if overridden in Python */
3877   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3878     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3879     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3880     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3881       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3882       #endif
3883       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dQk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
3884       __Pyx_GOTREF(__pyx_t_1);
3885       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk)) {
3886         __Pyx_XDECREF(__pyx_r);
3887         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
3888         __Pyx_GOTREF(__pyx_t_3);
3889         __Pyx_INCREF(__pyx_t_1);
3890         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
3891         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3892           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3893           if (likely(__pyx_t_5)) {
3894             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3895             __Pyx_INCREF(__pyx_t_5);
3896             __Pyx_INCREF(function);
3897             __Pyx_DECREF_SET(__pyx_t_4, function);
3898           }
3899         }
3900         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
3901         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3902         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3903         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
3904         __Pyx_GOTREF(__pyx_t_2);
3905         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3906         __pyx_r = __pyx_t_2;
3907         __pyx_t_2 = 0;
3908         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3909         goto __pyx_L0;
3910       }
3911       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3912       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3913       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3914       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
3915         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3916       }
3917       #endif
3918       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3919       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3920     }
3921     #endif
3922   }
3923 
3924   /* "GPy/models/state_space_cython.pyx":38
3925  *
3926  *     cpdef dQk(self, int k):
3927  *         raise NotImplemented("(cython) dQk is not implemented!")             # <<<<<<<<<<<<<<
3928  *
3929  *     cpdef reset(self, bint compute_derivatives = False):
3930  */
3931   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
3932   __Pyx_GOTREF(__pyx_t_1);
3933   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3934   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3935   __PYX_ERR(0, 38, __pyx_L1_error)
3936 
3937   /* "GPy/models/state_space_cython.pyx":37
3938  *         raise NotImplemented("(cython) dAk is not implemented!")
3939  *
3940  *     cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
3941  *         raise NotImplemented("(cython) dQk is not implemented!")
3942  *
3943  */
3944 
3945   /* function exit code */
3946   __pyx_L1_error:;
3947   __Pyx_XDECREF(__pyx_t_1);
3948   __Pyx_XDECREF(__pyx_t_2);
3949   __Pyx_XDECREF(__pyx_t_3);
3950   __Pyx_XDECREF(__pyx_t_4);
3951   __Pyx_XDECREF(__pyx_t_5);
3952   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3953   __pyx_r = 0;
3954   __pyx_L0:;
3955   __Pyx_XGIVEREF(__pyx_r);
3956   __Pyx_RefNannyFinishContext();
3957   return __pyx_r;
3958 }
3959 
3960 /* Python wrapper */
3961 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)3962 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
3963   int __pyx_v_k;
3964   int __pyx_lineno = 0;
3965   const char *__pyx_filename = NULL;
3966   int __pyx_clineno = 0;
3967   PyObject *__pyx_r = 0;
3968   __Pyx_RefNannyDeclarations
3969   __Pyx_RefNannySetupContext("dQk (wrapper)", 0);
3970   assert(__pyx_arg_k); {
3971     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L3_error)
3972   }
3973   goto __pyx_L4_argument_unpacking_done;
3974   __pyx_L3_error:;
3975   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
3976   __Pyx_RefNannyFinishContext();
3977   return NULL;
3978   __pyx_L4_argument_unpacking_done:;
3979   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_10dQk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
3980 
3981   /* function exit code */
3982   __Pyx_RefNannyFinishContext();
3983   return __pyx_r;
3984 }
3985 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_10dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k)3986 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_10dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
3987   PyObject *__pyx_r = NULL;
3988   __Pyx_RefNannyDeclarations
3989   PyObject *__pyx_t_1 = NULL;
3990   int __pyx_lineno = 0;
3991   const char *__pyx_filename = NULL;
3992   int __pyx_clineno = 0;
3993   __Pyx_RefNannySetupContext("dQk", 0);
3994   __Pyx_XDECREF(__pyx_r);
3995   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dQk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
3996   __Pyx_GOTREF(__pyx_t_1);
3997   __pyx_r = __pyx_t_1;
3998   __pyx_t_1 = 0;
3999   goto __pyx_L0;
4000 
4001   /* function exit code */
4002   __pyx_L1_error:;
4003   __Pyx_XDECREF(__pyx_t_1);
4004   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
4005   __pyx_r = NULL;
4006   __pyx_L0:;
4007   __Pyx_XGIVEREF(__pyx_r);
4008   __Pyx_RefNannyFinishContext();
4009   return __pyx_r;
4010 }
4011 
4012 /* "GPy/models/state_space_cython.pyx":40
4013  *         raise NotImplemented("(cython) dQk is not implemented!")
4014  *
4015  *     cpdef reset(self, bint compute_derivatives = False):             # <<<<<<<<<<<<<<
4016  *         raise NotImplemented("(cython) reset is not implemented!")
4017  *
4018  */
4019 
4020 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset * __pyx_optional_args)4021 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args) {
4022   int __pyx_v_compute_derivatives = ((int)0);
4023   PyObject *__pyx_r = NULL;
4024   __Pyx_RefNannyDeclarations
4025   PyObject *__pyx_t_1 = NULL;
4026   PyObject *__pyx_t_2 = NULL;
4027   PyObject *__pyx_t_3 = NULL;
4028   PyObject *__pyx_t_4 = NULL;
4029   PyObject *__pyx_t_5 = NULL;
4030   int __pyx_lineno = 0;
4031   const char *__pyx_filename = NULL;
4032   int __pyx_clineno = 0;
4033   __Pyx_RefNannySetupContext("reset", 0);
4034   if (__pyx_optional_args) {
4035     if (__pyx_optional_args->__pyx_n > 0) {
4036       __pyx_v_compute_derivatives = __pyx_optional_args->compute_derivatives;
4037     }
4038   }
4039   /* Check if called by wrapper */
4040   if (unlikely(__pyx_skip_dispatch)) ;
4041   /* Check if overridden in Python */
4042   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4043     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4044     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4045     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4046       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4047       #endif
4048       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
4049       __Pyx_GOTREF(__pyx_t_1);
4050       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset)) {
4051         __Pyx_XDECREF(__pyx_r);
4052         __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_compute_derivatives); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 40, __pyx_L1_error)
4053         __Pyx_GOTREF(__pyx_t_3);
4054         __Pyx_INCREF(__pyx_t_1);
4055         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
4056         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4057           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4058           if (likely(__pyx_t_5)) {
4059             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4060             __Pyx_INCREF(__pyx_t_5);
4061             __Pyx_INCREF(function);
4062             __Pyx_DECREF_SET(__pyx_t_4, function);
4063           }
4064         }
4065         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
4066         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4067         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4068         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
4069         __Pyx_GOTREF(__pyx_t_2);
4070         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4071         __pyx_r = __pyx_t_2;
4072         __pyx_t_2 = 0;
4073         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4074         goto __pyx_L0;
4075       }
4076       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4077       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4078       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4079       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4080         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4081       }
4082       #endif
4083       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4084       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4085     }
4086     #endif
4087   }
4088 
4089   /* "GPy/models/state_space_cython.pyx":41
4090  *
4091  *     cpdef reset(self, bint compute_derivatives = False):
4092  *         raise NotImplemented("(cython) reset is not implemented!")             # <<<<<<<<<<<<<<
4093  *
4094  * # Template class for measurement callables
4095  */
4096   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
4097   __Pyx_GOTREF(__pyx_t_1);
4098   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4099   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4100   __PYX_ERR(0, 41, __pyx_L1_error)
4101 
4102   /* "GPy/models/state_space_cython.pyx":40
4103  *         raise NotImplemented("(cython) dQk is not implemented!")
4104  *
4105  *     cpdef reset(self, bint compute_derivatives = False):             # <<<<<<<<<<<<<<
4106  *         raise NotImplemented("(cython) reset is not implemented!")
4107  *
4108  */
4109 
4110   /* function exit code */
4111   __pyx_L1_error:;
4112   __Pyx_XDECREF(__pyx_t_1);
4113   __Pyx_XDECREF(__pyx_t_2);
4114   __Pyx_XDECREF(__pyx_t_3);
4115   __Pyx_XDECREF(__pyx_t_4);
4116   __Pyx_XDECREF(__pyx_t_5);
4117   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
4118   __pyx_r = 0;
4119   __pyx_L0:;
4120   __Pyx_XGIVEREF(__pyx_r);
4121   __Pyx_RefNannyFinishContext();
4122   return __pyx_r;
4123 }
4124 
4125 /* Python wrapper */
4126 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4127 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4128   int __pyx_v_compute_derivatives;
4129   int __pyx_lineno = 0;
4130   const char *__pyx_filename = NULL;
4131   int __pyx_clineno = 0;
4132   PyObject *__pyx_r = 0;
4133   __Pyx_RefNannyDeclarations
4134   __Pyx_RefNannySetupContext("reset (wrapper)", 0);
4135   {
4136     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_compute_derivatives,0};
4137     PyObject* values[1] = {0};
4138     if (unlikely(__pyx_kwds)) {
4139       Py_ssize_t kw_args;
4140       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4141       switch (pos_args) {
4142         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4143         CYTHON_FALLTHROUGH;
4144         case  0: break;
4145         default: goto __pyx_L5_argtuple_error;
4146       }
4147       kw_args = PyDict_Size(__pyx_kwds);
4148       switch (pos_args) {
4149         case  0:
4150         if (kw_args > 0) {
4151           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_derivatives);
4152           if (value) { values[0] = value; kw_args--; }
4153         }
4154       }
4155       if (unlikely(kw_args > 0)) {
4156         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset") < 0)) __PYX_ERR(0, 40, __pyx_L3_error)
4157       }
4158     } else {
4159       switch (PyTuple_GET_SIZE(__pyx_args)) {
4160         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4161         CYTHON_FALLTHROUGH;
4162         case  0: break;
4163         default: goto __pyx_L5_argtuple_error;
4164       }
4165     }
4166     if (values[0]) {
4167       __pyx_v_compute_derivatives = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_compute_derivatives == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 40, __pyx_L3_error)
4168     } else {
4169       __pyx_v_compute_derivatives = ((int)0);
4170     }
4171   }
4172   goto __pyx_L4_argument_unpacking_done;
4173   __pyx_L5_argtuple_error:;
4174   __Pyx_RaiseArgtupleInvalid("reset", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 40, __pyx_L3_error)
4175   __pyx_L3_error:;
4176   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
4177   __Pyx_RefNannyFinishContext();
4178   return NULL;
4179   __pyx_L4_argument_unpacking_done:;
4180   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_12reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_compute_derivatives);
4181 
4182   /* function exit code */
4183   __Pyx_RefNannyFinishContext();
4184   return __pyx_r;
4185 }
4186 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_compute_derivatives)4187 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_compute_derivatives) {
4188   PyObject *__pyx_r = NULL;
4189   __Pyx_RefNannyDeclarations
4190   PyObject *__pyx_t_1 = NULL;
4191   struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset __pyx_t_2;
4192   int __pyx_lineno = 0;
4193   const char *__pyx_filename = NULL;
4194   int __pyx_clineno = 0;
4195   __Pyx_RefNannySetupContext("reset", 0);
4196   __Pyx_XDECREF(__pyx_r);
4197   __pyx_t_2.__pyx_n = 1;
4198   __pyx_t_2.compute_derivatives = __pyx_v_compute_derivatives;
4199   __pyx_t_1 = __pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython->reset(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
4200   __Pyx_GOTREF(__pyx_t_1);
4201   __pyx_r = __pyx_t_1;
4202   __pyx_t_1 = 0;
4203   goto __pyx_L0;
4204 
4205   /* function exit code */
4206   __pyx_L1_error:;
4207   __Pyx_XDECREF(__pyx_t_1);
4208   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
4209   __pyx_r = NULL;
4210   __pyx_L0:;
4211   __Pyx_XGIVEREF(__pyx_r);
4212   __Pyx_RefNannyFinishContext();
4213   return __pyx_r;
4214 }
4215 
4216 /* "(tree fragment)":1
4217  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4218  *     cdef tuple state
4219  *     cdef object _dict
4220  */
4221 
4222 /* Python wrapper */
4223 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_15__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4224 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4225   PyObject *__pyx_r = 0;
4226   __Pyx_RefNannyDeclarations
4227   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4228   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_14__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self));
4229 
4230   /* function exit code */
4231   __Pyx_RefNannyFinishContext();
4232   return __pyx_r;
4233 }
4234 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self)4235 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self) {
4236   PyObject *__pyx_v_state = 0;
4237   PyObject *__pyx_v__dict = 0;
4238   int __pyx_v_use_setstate;
4239   PyObject *__pyx_r = NULL;
4240   __Pyx_RefNannyDeclarations
4241   PyObject *__pyx_t_1 = NULL;
4242   int __pyx_t_2;
4243   int __pyx_t_3;
4244   PyObject *__pyx_t_4 = NULL;
4245   PyObject *__pyx_t_5 = NULL;
4246   int __pyx_lineno = 0;
4247   const char *__pyx_filename = NULL;
4248   int __pyx_clineno = 0;
4249   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4250 
4251   /* "(tree fragment)":5
4252  *     cdef object _dict
4253  *     cdef bint use_setstate
4254  *     state = ()             # <<<<<<<<<<<<<<
4255  *     _dict = getattr(self, '__dict__', None)
4256  *     if _dict is not None:
4257  */
4258   __Pyx_INCREF(__pyx_empty_tuple);
4259   __pyx_v_state = __pyx_empty_tuple;
4260 
4261   /* "(tree fragment)":6
4262  *     cdef bint use_setstate
4263  *     state = ()
4264  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
4265  *     if _dict is not None:
4266  *         state += (_dict,)
4267  */
4268   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
4269   __Pyx_GOTREF(__pyx_t_1);
4270   __pyx_v__dict = __pyx_t_1;
4271   __pyx_t_1 = 0;
4272 
4273   /* "(tree fragment)":7
4274  *     state = ()
4275  *     _dict = getattr(self, '__dict__', None)
4276  *     if _dict is not None:             # <<<<<<<<<<<<<<
4277  *         state += (_dict,)
4278  *         use_setstate = True
4279  */
4280   __pyx_t_2 = (__pyx_v__dict != Py_None);
4281   __pyx_t_3 = (__pyx_t_2 != 0);
4282   if (__pyx_t_3) {
4283 
4284     /* "(tree fragment)":8
4285  *     _dict = getattr(self, '__dict__', None)
4286  *     if _dict is not None:
4287  *         state += (_dict,)             # <<<<<<<<<<<<<<
4288  *         use_setstate = True
4289  *     else:
4290  */
4291     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
4292     __Pyx_GOTREF(__pyx_t_1);
4293     __Pyx_INCREF(__pyx_v__dict);
4294     __Pyx_GIVEREF(__pyx_v__dict);
4295     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
4296     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
4297     __Pyx_GOTREF(__pyx_t_4);
4298     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4299     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
4300     __pyx_t_4 = 0;
4301 
4302     /* "(tree fragment)":9
4303  *     if _dict is not None:
4304  *         state += (_dict,)
4305  *         use_setstate = True             # <<<<<<<<<<<<<<
4306  *     else:
4307  *         use_setstate = False
4308  */
4309     __pyx_v_use_setstate = 1;
4310 
4311     /* "(tree fragment)":7
4312  *     state = ()
4313  *     _dict = getattr(self, '__dict__', None)
4314  *     if _dict is not None:             # <<<<<<<<<<<<<<
4315  *         state += (_dict,)
4316  *         use_setstate = True
4317  */
4318     goto __pyx_L3;
4319   }
4320 
4321   /* "(tree fragment)":11
4322  *         use_setstate = True
4323  *     else:
4324  *         use_setstate = False             # <<<<<<<<<<<<<<
4325  *     if use_setstate:
4326  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, None), state
4327  */
4328   /*else*/ {
4329     __pyx_v_use_setstate = 0;
4330   }
4331   __pyx_L3:;
4332 
4333   /* "(tree fragment)":12
4334  *     else:
4335  *         use_setstate = False
4336  *     if use_setstate:             # <<<<<<<<<<<<<<
4337  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, None), state
4338  *     else:
4339  */
4340   __pyx_t_3 = (__pyx_v_use_setstate != 0);
4341   if (__pyx_t_3) {
4342 
4343     /* "(tree fragment)":13
4344  *         use_setstate = False
4345  *     if use_setstate:
4346  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
4347  *     else:
4348  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, state)
4349  */
4350     __Pyx_XDECREF(__pyx_r);
4351     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Dynamic_Callables); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
4352     __Pyx_GOTREF(__pyx_t_4);
4353     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
4354     __Pyx_GOTREF(__pyx_t_1);
4355     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4356     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4357     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4358     __Pyx_INCREF(__pyx_int_222419149);
4359     __Pyx_GIVEREF(__pyx_int_222419149);
4360     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
4361     __Pyx_INCREF(Py_None);
4362     __Pyx_GIVEREF(Py_None);
4363     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
4364     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
4365     __Pyx_GOTREF(__pyx_t_5);
4366     __Pyx_GIVEREF(__pyx_t_4);
4367     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
4368     __Pyx_GIVEREF(__pyx_t_1);
4369     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
4370     __Pyx_INCREF(__pyx_v_state);
4371     __Pyx_GIVEREF(__pyx_v_state);
4372     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
4373     __pyx_t_4 = 0;
4374     __pyx_t_1 = 0;
4375     __pyx_r = __pyx_t_5;
4376     __pyx_t_5 = 0;
4377     goto __pyx_L0;
4378 
4379     /* "(tree fragment)":12
4380  *     else:
4381  *         use_setstate = False
4382  *     if use_setstate:             # <<<<<<<<<<<<<<
4383  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, None), state
4384  *     else:
4385  */
4386   }
4387 
4388   /* "(tree fragment)":15
4389  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, None), state
4390  *     else:
4391  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
4392  * def __setstate_cython__(self, __pyx_state):
4393  *     __pyx_unpickle_Dynamic_Callables_Cython__set_state(self, __pyx_state)
4394  */
4395   /*else*/ {
4396     __Pyx_XDECREF(__pyx_r);
4397     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Dynamic_Callables); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
4398     __Pyx_GOTREF(__pyx_t_5);
4399     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
4400     __Pyx_GOTREF(__pyx_t_1);
4401     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4402     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4403     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
4404     __Pyx_INCREF(__pyx_int_222419149);
4405     __Pyx_GIVEREF(__pyx_int_222419149);
4406     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
4407     __Pyx_INCREF(__pyx_v_state);
4408     __Pyx_GIVEREF(__pyx_v_state);
4409     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
4410     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
4411     __Pyx_GOTREF(__pyx_t_4);
4412     __Pyx_GIVEREF(__pyx_t_5);
4413     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
4414     __Pyx_GIVEREF(__pyx_t_1);
4415     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
4416     __pyx_t_5 = 0;
4417     __pyx_t_1 = 0;
4418     __pyx_r = __pyx_t_4;
4419     __pyx_t_4 = 0;
4420     goto __pyx_L0;
4421   }
4422 
4423   /* "(tree fragment)":1
4424  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
4425  *     cdef tuple state
4426  *     cdef object _dict
4427  */
4428 
4429   /* function exit code */
4430   __pyx_L1_error:;
4431   __Pyx_XDECREF(__pyx_t_1);
4432   __Pyx_XDECREF(__pyx_t_4);
4433   __Pyx_XDECREF(__pyx_t_5);
4434   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4435   __pyx_r = NULL;
4436   __pyx_L0:;
4437   __Pyx_XDECREF(__pyx_v_state);
4438   __Pyx_XDECREF(__pyx_v__dict);
4439   __Pyx_XGIVEREF(__pyx_r);
4440   __Pyx_RefNannyFinishContext();
4441   return __pyx_r;
4442 }
4443 
4444 /* "(tree fragment)":16
4445  *     else:
4446  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, state)
4447  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4448  *     __pyx_unpickle_Dynamic_Callables_Cython__set_state(self, __pyx_state)
4449  */
4450 
4451 /* Python wrapper */
4452 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_17__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)4453 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4454   PyObject *__pyx_r = 0;
4455   __Pyx_RefNannyDeclarations
4456   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4457   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_16__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4458 
4459   /* function exit code */
4460   __Pyx_RefNannyFinishContext();
4461   return __pyx_r;
4462 }
4463 
__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)4464 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4465   PyObject *__pyx_r = NULL;
4466   __Pyx_RefNannyDeclarations
4467   PyObject *__pyx_t_1 = NULL;
4468   int __pyx_lineno = 0;
4469   const char *__pyx_filename = NULL;
4470   int __pyx_clineno = 0;
4471   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4472 
4473   /* "(tree fragment)":17
4474  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, state)
4475  * def __setstate_cython__(self, __pyx_state):
4476  *     __pyx_unpickle_Dynamic_Callables_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
4477  */
4478   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
4479   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Dynamic_Callables_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
4480   __Pyx_GOTREF(__pyx_t_1);
4481   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4482 
4483   /* "(tree fragment)":16
4484  *     else:
4485  *         return __pyx_unpickle_Dynamic_Callables_Cython, (type(self), 0xd41d8cd, state)
4486  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
4487  *     __pyx_unpickle_Dynamic_Callables_Cython__set_state(self, __pyx_state)
4488  */
4489 
4490   /* function exit code */
4491   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4492   goto __pyx_L0;
4493   __pyx_L1_error:;
4494   __Pyx_XDECREF(__pyx_t_1);
4495   __Pyx_AddTraceback("GPy.models.state_space_cython.Dynamic_Callables_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4496   __pyx_r = NULL;
4497   __pyx_L0:;
4498   __Pyx_XGIVEREF(__pyx_r);
4499   __Pyx_RefNannyFinishContext();
4500   return __pyx_r;
4501 }
4502 
4503 /* "GPy/models/state_space_cython.pyx":45
4504  * # Template class for measurement callables
4505  * cdef class Measurement_Callables_Cython:
4506  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] Hk):             # <<<<<<<<<<<<<<
4507  *         raise NotImplemented("(cython) f_a is not implemented!")
4508  *
4509  */
4510 
4511 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m_pred,CYTHON_UNUSED PyArrayObject * __pyx_v_Hk,int __pyx_skip_dispatch)4512 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_Hk, int __pyx_skip_dispatch) {
4513   __Pyx_LocalBuf_ND __pyx_pybuffernd_Hk;
4514   __Pyx_Buffer __pyx_pybuffer_Hk;
4515   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
4516   __Pyx_Buffer __pyx_pybuffer_m_pred;
4517   PyObject *__pyx_r = NULL;
4518   __Pyx_RefNannyDeclarations
4519   PyObject *__pyx_t_1 = NULL;
4520   PyObject *__pyx_t_2 = NULL;
4521   PyObject *__pyx_t_3 = NULL;
4522   PyObject *__pyx_t_4 = NULL;
4523   PyObject *__pyx_t_5 = NULL;
4524   int __pyx_t_6;
4525   PyObject *__pyx_t_7 = NULL;
4526   int __pyx_lineno = 0;
4527   const char *__pyx_filename = NULL;
4528   int __pyx_clineno = 0;
4529   __Pyx_RefNannySetupContext("f_h", 0);
4530   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
4531   __pyx_pybuffer_m_pred.refcount = 0;
4532   __pyx_pybuffernd_m_pred.data = NULL;
4533   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
4534   __pyx_pybuffer_Hk.pybuffer.buf = NULL;
4535   __pyx_pybuffer_Hk.refcount = 0;
4536   __pyx_pybuffernd_Hk.data = NULL;
4537   __pyx_pybuffernd_Hk.rcbuffer = &__pyx_pybuffer_Hk;
4538   {
4539     __Pyx_BufFmt_StackElem __pyx_stack[1];
4540     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 45, __pyx_L1_error)
4541   }
4542   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
4543   {
4544     __Pyx_BufFmt_StackElem __pyx_stack[1];
4545     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hk, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 45, __pyx_L1_error)
4546   }
4547   __pyx_pybuffernd_Hk.diminfo[0].strides = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hk.diminfo[0].shape = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Hk.diminfo[1].strides = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Hk.diminfo[1].shape = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.shape[1];
4548   /* Check if called by wrapper */
4549   if (unlikely(__pyx_skip_dispatch)) ;
4550   /* Check if overridden in Python */
4551   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4552     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4553     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4554     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4555       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4556       #endif
4557       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
4558       __Pyx_GOTREF(__pyx_t_1);
4559       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h)) {
4560         __Pyx_XDECREF(__pyx_r);
4561         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
4562         __Pyx_GOTREF(__pyx_t_3);
4563         __Pyx_INCREF(__pyx_t_1);
4564         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
4565         __pyx_t_6 = 0;
4566         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4567           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4568           if (likely(__pyx_t_5)) {
4569             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4570             __Pyx_INCREF(__pyx_t_5);
4571             __Pyx_INCREF(function);
4572             __Pyx_DECREF_SET(__pyx_t_4, function);
4573             __pyx_t_6 = 1;
4574           }
4575         }
4576         #if CYTHON_FAST_PYCALL
4577         if (PyFunction_Check(__pyx_t_4)) {
4578           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_Hk)};
4579           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4580           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4581           __Pyx_GOTREF(__pyx_t_2);
4582           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4583         } else
4584         #endif
4585         #if CYTHON_FAST_PYCCALL
4586         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4587           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_Hk)};
4588           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4589           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4590           __Pyx_GOTREF(__pyx_t_2);
4591           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4592         } else
4593         #endif
4594         {
4595           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 45, __pyx_L1_error)
4596           __Pyx_GOTREF(__pyx_t_7);
4597           if (__pyx_t_5) {
4598             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4599           }
4600           __Pyx_GIVEREF(__pyx_t_3);
4601           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
4602           __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
4603           __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
4604           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m_pred));
4605           __Pyx_INCREF(((PyObject *)__pyx_v_Hk));
4606           __Pyx_GIVEREF(((PyObject *)__pyx_v_Hk));
4607           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_Hk));
4608           __pyx_t_3 = 0;
4609           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 45, __pyx_L1_error)
4610           __Pyx_GOTREF(__pyx_t_2);
4611           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4612         }
4613         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4614         __pyx_r = __pyx_t_2;
4615         __pyx_t_2 = 0;
4616         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4617         goto __pyx_L0;
4618       }
4619       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4620       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4621       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4622       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4623         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4624       }
4625       #endif
4626       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4627       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4628     }
4629     #endif
4630   }
4631 
4632   /* "GPy/models/state_space_cython.pyx":46
4633  * cdef class Measurement_Callables_Cython:
4634  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] Hk):
4635  *         raise NotImplemented("(cython) f_a is not implemented!")             # <<<<<<<<<<<<<<
4636  *
4637  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix
4638  */
4639   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
4640   __Pyx_GOTREF(__pyx_t_1);
4641   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4642   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4643   __PYX_ERR(0, 46, __pyx_L1_error)
4644 
4645   /* "GPy/models/state_space_cython.pyx":45
4646  * # Template class for measurement callables
4647  * cdef class Measurement_Callables_Cython:
4648  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] Hk):             # <<<<<<<<<<<<<<
4649  *         raise NotImplemented("(cython) f_a is not implemented!")
4650  *
4651  */
4652 
4653   /* function exit code */
4654   __pyx_L1_error:;
4655   __Pyx_XDECREF(__pyx_t_1);
4656   __Pyx_XDECREF(__pyx_t_2);
4657   __Pyx_XDECREF(__pyx_t_3);
4658   __Pyx_XDECREF(__pyx_t_4);
4659   __Pyx_XDECREF(__pyx_t_5);
4660   __Pyx_XDECREF(__pyx_t_7);
4661   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4662     __Pyx_PyThreadState_declare
4663     __Pyx_PyThreadState_assign
4664     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4665     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer);
4666     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4667   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4668   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
4669   __pyx_r = 0;
4670   goto __pyx_L2;
4671   __pyx_L0:;
4672   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer);
4673   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4674   __pyx_L2:;
4675   __Pyx_XGIVEREF(__pyx_r);
4676   __Pyx_RefNannyFinishContext();
4677   return __pyx_r;
4678 }
4679 
4680 /* Python wrapper */
4681 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4682 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4683   int __pyx_v_k;
4684   PyArrayObject *__pyx_v_m_pred = 0;
4685   PyArrayObject *__pyx_v_Hk = 0;
4686   int __pyx_lineno = 0;
4687   const char *__pyx_filename = NULL;
4688   int __pyx_clineno = 0;
4689   PyObject *__pyx_r = 0;
4690   __Pyx_RefNannyDeclarations
4691   __Pyx_RefNannySetupContext("f_h (wrapper)", 0);
4692   {
4693     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m_pred,&__pyx_n_s_Hk,0};
4694     PyObject* values[3] = {0,0,0};
4695     if (unlikely(__pyx_kwds)) {
4696       Py_ssize_t kw_args;
4697       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4698       switch (pos_args) {
4699         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4700         CYTHON_FALLTHROUGH;
4701         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4702         CYTHON_FALLTHROUGH;
4703         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4704         CYTHON_FALLTHROUGH;
4705         case  0: break;
4706         default: goto __pyx_L5_argtuple_error;
4707       }
4708       kw_args = PyDict_Size(__pyx_kwds);
4709       switch (pos_args) {
4710         case  0:
4711         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
4712         else goto __pyx_L5_argtuple_error;
4713         CYTHON_FALLTHROUGH;
4714         case  1:
4715         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m_pred)) != 0)) kw_args--;
4716         else {
4717           __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, 1); __PYX_ERR(0, 45, __pyx_L3_error)
4718         }
4719         CYTHON_FALLTHROUGH;
4720         case  2:
4721         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Hk)) != 0)) kw_args--;
4722         else {
4723           __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, 2); __PYX_ERR(0, 45, __pyx_L3_error)
4724         }
4725       }
4726       if (unlikely(kw_args > 0)) {
4727         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f_h") < 0)) __PYX_ERR(0, 45, __pyx_L3_error)
4728       }
4729     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4730       goto __pyx_L5_argtuple_error;
4731     } else {
4732       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4733       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4734       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4735     }
4736     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 45, __pyx_L3_error)
4737     __pyx_v_m_pred = ((PyArrayObject *)values[1]);
4738     __pyx_v_Hk = ((PyArrayObject *)values[2]);
4739   }
4740   goto __pyx_L4_argument_unpacking_done;
4741   __pyx_L5_argtuple_error:;
4742   __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 45, __pyx_L3_error)
4743   __pyx_L3_error:;
4744   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
4745   __Pyx_RefNannyFinishContext();
4746   return NULL;
4747   __pyx_L4_argument_unpacking_done:;
4748   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m_pred), __pyx_ptype_5numpy_ndarray, 1, "m_pred", 0))) __PYX_ERR(0, 45, __pyx_L1_error)
4749   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Hk), __pyx_ptype_5numpy_ndarray, 1, "Hk", 0))) __PYX_ERR(0, 45, __pyx_L1_error)
4750   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m_pred, __pyx_v_Hk);
4751 
4752   /* function exit code */
4753   goto __pyx_L0;
4754   __pyx_L1_error:;
4755   __pyx_r = NULL;
4756   __pyx_L0:;
4757   __Pyx_RefNannyFinishContext();
4758   return __pyx_r;
4759 }
4760 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m_pred,PyArrayObject * __pyx_v_Hk)4761 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_Hk) {
4762   __Pyx_LocalBuf_ND __pyx_pybuffernd_Hk;
4763   __Pyx_Buffer __pyx_pybuffer_Hk;
4764   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
4765   __Pyx_Buffer __pyx_pybuffer_m_pred;
4766   PyObject *__pyx_r = NULL;
4767   __Pyx_RefNannyDeclarations
4768   PyObject *__pyx_t_1 = NULL;
4769   int __pyx_lineno = 0;
4770   const char *__pyx_filename = NULL;
4771   int __pyx_clineno = 0;
4772   __Pyx_RefNannySetupContext("f_h", 0);
4773   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
4774   __pyx_pybuffer_m_pred.refcount = 0;
4775   __pyx_pybuffernd_m_pred.data = NULL;
4776   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
4777   __pyx_pybuffer_Hk.pybuffer.buf = NULL;
4778   __pyx_pybuffer_Hk.refcount = 0;
4779   __pyx_pybuffernd_Hk.data = NULL;
4780   __pyx_pybuffernd_Hk.rcbuffer = &__pyx_pybuffer_Hk;
4781   {
4782     __Pyx_BufFmt_StackElem __pyx_stack[1];
4783     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 45, __pyx_L1_error)
4784   }
4785   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
4786   {
4787     __Pyx_BufFmt_StackElem __pyx_stack[1];
4788     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer, (PyObject*)__pyx_v_Hk, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 45, __pyx_L1_error)
4789   }
4790   __pyx_pybuffernd_Hk.diminfo[0].strides = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Hk.diminfo[0].shape = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Hk.diminfo[1].strides = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Hk.diminfo[1].shape = __pyx_pybuffernd_Hk.rcbuffer->pybuffer.shape[1];
4791   __Pyx_XDECREF(__pyx_r);
4792   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h(__pyx_v_self, __pyx_v_k, __pyx_v_m_pred, __pyx_v_Hk, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 45, __pyx_L1_error)
4793   __Pyx_GOTREF(__pyx_t_1);
4794   __pyx_r = __pyx_t_1;
4795   __pyx_t_1 = 0;
4796   goto __pyx_L0;
4797 
4798   /* function exit code */
4799   __pyx_L1_error:;
4800   __Pyx_XDECREF(__pyx_t_1);
4801   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4802     __Pyx_PyThreadState_declare
4803     __Pyx_PyThreadState_assign
4804     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4805     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer);
4806     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4807   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4808   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
4809   __pyx_r = NULL;
4810   goto __pyx_L2;
4811   __pyx_L0:;
4812   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Hk.rcbuffer->pybuffer);
4813   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4814   __pyx_L2:;
4815   __Pyx_XGIVEREF(__pyx_r);
4816   __Pyx_RefNannyFinishContext();
4817   return __pyx_r;
4818 }
4819 
4820 /* "GPy/models/state_space_cython.pyx":48
4821  *         raise NotImplemented("(cython) f_a is not implemented!")
4822  *
4823  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
4824  *         raise NotImplemented("(cython) Hk is not implemented!")
4825  *
4826  */
4827 
4828 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Hk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m_pred,CYTHON_UNUSED PyArrayObject * __pyx_v_P_pred,int __pyx_skip_dispatch)4829 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Hk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch) {
4830   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
4831   __Pyx_Buffer __pyx_pybuffer_P_pred;
4832   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
4833   __Pyx_Buffer __pyx_pybuffer_m_pred;
4834   PyObject *__pyx_r = NULL;
4835   __Pyx_RefNannyDeclarations
4836   PyObject *__pyx_t_1 = NULL;
4837   PyObject *__pyx_t_2 = NULL;
4838   PyObject *__pyx_t_3 = NULL;
4839   PyObject *__pyx_t_4 = NULL;
4840   PyObject *__pyx_t_5 = NULL;
4841   int __pyx_t_6;
4842   PyObject *__pyx_t_7 = NULL;
4843   int __pyx_lineno = 0;
4844   const char *__pyx_filename = NULL;
4845   int __pyx_clineno = 0;
4846   __Pyx_RefNannySetupContext("Hk", 0);
4847   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
4848   __pyx_pybuffer_m_pred.refcount = 0;
4849   __pyx_pybuffernd_m_pred.data = NULL;
4850   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
4851   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
4852   __pyx_pybuffer_P_pred.refcount = 0;
4853   __pyx_pybuffernd_P_pred.data = NULL;
4854   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
4855   {
4856     __Pyx_BufFmt_StackElem __pyx_stack[1];
4857     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error)
4858   }
4859   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
4860   {
4861     __Pyx_BufFmt_StackElem __pyx_stack[1];
4862     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error)
4863   }
4864   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
4865   /* Check if called by wrapper */
4866   if (unlikely(__pyx_skip_dispatch)) ;
4867   /* Check if overridden in Python */
4868   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
4869     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4870     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4871     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
4872       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4873       #endif
4874       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Hk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
4875       __Pyx_GOTREF(__pyx_t_1);
4876       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk)) {
4877         __Pyx_XDECREF(__pyx_r);
4878         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 48, __pyx_L1_error)
4879         __Pyx_GOTREF(__pyx_t_3);
4880         __Pyx_INCREF(__pyx_t_1);
4881         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
4882         __pyx_t_6 = 0;
4883         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4884           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4885           if (likely(__pyx_t_5)) {
4886             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4887             __Pyx_INCREF(__pyx_t_5);
4888             __Pyx_INCREF(function);
4889             __Pyx_DECREF_SET(__pyx_t_4, function);
4890             __pyx_t_6 = 1;
4891           }
4892         }
4893         #if CYTHON_FAST_PYCALL
4894         if (PyFunction_Check(__pyx_t_4)) {
4895           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
4896           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
4897           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4898           __Pyx_GOTREF(__pyx_t_2);
4899           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4900         } else
4901         #endif
4902         #if CYTHON_FAST_PYCCALL
4903         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4904           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
4905           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
4906           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4907           __Pyx_GOTREF(__pyx_t_2);
4908           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4909         } else
4910         #endif
4911         {
4912           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 48, __pyx_L1_error)
4913           __Pyx_GOTREF(__pyx_t_7);
4914           if (__pyx_t_5) {
4915             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
4916           }
4917           __Pyx_GIVEREF(__pyx_t_3);
4918           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
4919           __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
4920           __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
4921           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m_pred));
4922           __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
4923           __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
4924           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_P_pred));
4925           __pyx_t_3 = 0;
4926           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 48, __pyx_L1_error)
4927           __Pyx_GOTREF(__pyx_t_2);
4928           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4929         }
4930         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4931         __pyx_r = __pyx_t_2;
4932         __pyx_t_2 = 0;
4933         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4934         goto __pyx_L0;
4935       }
4936       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4937       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
4938       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
4939       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
4940         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
4941       }
4942       #endif
4943       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4944       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
4945     }
4946     #endif
4947   }
4948 
4949   /* "GPy/models/state_space_cython.pyx":49
4950  *
4951  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix
4952  *         raise NotImplemented("(cython) Hk is not implemented!")             # <<<<<<<<<<<<<<
4953  *
4954  *     cpdef Rk(self, int k):
4955  */
4956   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
4957   __Pyx_GOTREF(__pyx_t_1);
4958   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4959   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4960   __PYX_ERR(0, 49, __pyx_L1_error)
4961 
4962   /* "GPy/models/state_space_cython.pyx":48
4963  *         raise NotImplemented("(cython) f_a is not implemented!")
4964  *
4965  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
4966  *         raise NotImplemented("(cython) Hk is not implemented!")
4967  *
4968  */
4969 
4970   /* function exit code */
4971   __pyx_L1_error:;
4972   __Pyx_XDECREF(__pyx_t_1);
4973   __Pyx_XDECREF(__pyx_t_2);
4974   __Pyx_XDECREF(__pyx_t_3);
4975   __Pyx_XDECREF(__pyx_t_4);
4976   __Pyx_XDECREF(__pyx_t_5);
4977   __Pyx_XDECREF(__pyx_t_7);
4978   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4979     __Pyx_PyThreadState_declare
4980     __Pyx_PyThreadState_assign
4981     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4982     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
4983     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4984   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4985   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
4986   __pyx_r = 0;
4987   goto __pyx_L2;
4988   __pyx_L0:;
4989   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
4990   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
4991   __pyx_L2:;
4992   __Pyx_XGIVEREF(__pyx_r);
4993   __Pyx_RefNannyFinishContext();
4994   return __pyx_r;
4995 }
4996 
4997 /* Python wrapper */
4998 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)4999 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5000   int __pyx_v_k;
5001   PyArrayObject *__pyx_v_m_pred = 0;
5002   PyArrayObject *__pyx_v_P_pred = 0;
5003   int __pyx_lineno = 0;
5004   const char *__pyx_filename = NULL;
5005   int __pyx_clineno = 0;
5006   PyObject *__pyx_r = 0;
5007   __Pyx_RefNannyDeclarations
5008   __Pyx_RefNannySetupContext("Hk (wrapper)", 0);
5009   {
5010     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m_pred,&__pyx_n_s_P_pred,0};
5011     PyObject* values[3] = {0,0,0};
5012     if (unlikely(__pyx_kwds)) {
5013       Py_ssize_t kw_args;
5014       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5015       switch (pos_args) {
5016         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5017         CYTHON_FALLTHROUGH;
5018         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5019         CYTHON_FALLTHROUGH;
5020         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5021         CYTHON_FALLTHROUGH;
5022         case  0: break;
5023         default: goto __pyx_L5_argtuple_error;
5024       }
5025       kw_args = PyDict_Size(__pyx_kwds);
5026       switch (pos_args) {
5027         case  0:
5028         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
5029         else goto __pyx_L5_argtuple_error;
5030         CYTHON_FALLTHROUGH;
5031         case  1:
5032         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m_pred)) != 0)) kw_args--;
5033         else {
5034           __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, 1); __PYX_ERR(0, 48, __pyx_L3_error)
5035         }
5036         CYTHON_FALLTHROUGH;
5037         case  2:
5038         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P_pred)) != 0)) kw_args--;
5039         else {
5040           __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, 2); __PYX_ERR(0, 48, __pyx_L3_error)
5041         }
5042       }
5043       if (unlikely(kw_args > 0)) {
5044         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Hk") < 0)) __PYX_ERR(0, 48, __pyx_L3_error)
5045       }
5046     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
5047       goto __pyx_L5_argtuple_error;
5048     } else {
5049       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5050       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5051       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5052     }
5053     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
5054     __pyx_v_m_pred = ((PyArrayObject *)values[1]);
5055     __pyx_v_P_pred = ((PyArrayObject *)values[2]);
5056   }
5057   goto __pyx_L4_argument_unpacking_done;
5058   __pyx_L5_argtuple_error:;
5059   __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 48, __pyx_L3_error)
5060   __pyx_L3_error:;
5061   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5062   __Pyx_RefNannyFinishContext();
5063   return NULL;
5064   __pyx_L4_argument_unpacking_done:;
5065   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m_pred), __pyx_ptype_5numpy_ndarray, 1, "m_pred", 0))) __PYX_ERR(0, 48, __pyx_L1_error)
5066   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P_pred), __pyx_ptype_5numpy_ndarray, 1, "P_pred", 0))) __PYX_ERR(0, 48, __pyx_L1_error)
5067   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_2Hk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m_pred, __pyx_v_P_pred);
5068 
5069   /* function exit code */
5070   goto __pyx_L0;
5071   __pyx_L1_error:;
5072   __pyx_r = NULL;
5073   __pyx_L0:;
5074   __Pyx_RefNannyFinishContext();
5075   return __pyx_r;
5076 }
5077 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_2Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m_pred,PyArrayObject * __pyx_v_P_pred)5078 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_2Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred) {
5079   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
5080   __Pyx_Buffer __pyx_pybuffer_P_pred;
5081   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
5082   __Pyx_Buffer __pyx_pybuffer_m_pred;
5083   PyObject *__pyx_r = NULL;
5084   __Pyx_RefNannyDeclarations
5085   PyObject *__pyx_t_1 = NULL;
5086   int __pyx_lineno = 0;
5087   const char *__pyx_filename = NULL;
5088   int __pyx_clineno = 0;
5089   __Pyx_RefNannySetupContext("Hk", 0);
5090   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
5091   __pyx_pybuffer_m_pred.refcount = 0;
5092   __pyx_pybuffernd_m_pred.data = NULL;
5093   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
5094   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
5095   __pyx_pybuffer_P_pred.refcount = 0;
5096   __pyx_pybuffernd_P_pred.data = NULL;
5097   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
5098   {
5099     __Pyx_BufFmt_StackElem __pyx_stack[1];
5100     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error)
5101   }
5102   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
5103   {
5104     __Pyx_BufFmt_StackElem __pyx_stack[1];
5105     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 48, __pyx_L1_error)
5106   }
5107   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
5108   __Pyx_XDECREF(__pyx_r);
5109   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Hk(__pyx_v_self, __pyx_v_k, __pyx_v_m_pred, __pyx_v_P_pred, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
5110   __Pyx_GOTREF(__pyx_t_1);
5111   __pyx_r = __pyx_t_1;
5112   __pyx_t_1 = 0;
5113   goto __pyx_L0;
5114 
5115   /* function exit code */
5116   __pyx_L1_error:;
5117   __Pyx_XDECREF(__pyx_t_1);
5118   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5119     __Pyx_PyThreadState_declare
5120     __Pyx_PyThreadState_assign
5121     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5122     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
5123     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
5124   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5125   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5126   __pyx_r = NULL;
5127   goto __pyx_L2;
5128   __pyx_L0:;
5129   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
5130   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
5131   __pyx_L2:;
5132   __Pyx_XGIVEREF(__pyx_r);
5133   __Pyx_RefNannyFinishContext();
5134   return __pyx_r;
5135 }
5136 
5137 /* "GPy/models/state_space_cython.pyx":51
5138  *         raise NotImplemented("(cython) Hk is not implemented!")
5139  *
5140  *     cpdef Rk(self, int k):             # <<<<<<<<<<<<<<
5141  *         raise NotImplemented("(cython) Rk is not implemented!")
5142  *
5143  */
5144 
5145 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Rk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)5146 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Rk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
5147   PyObject *__pyx_r = NULL;
5148   __Pyx_RefNannyDeclarations
5149   PyObject *__pyx_t_1 = NULL;
5150   PyObject *__pyx_t_2 = NULL;
5151   PyObject *__pyx_t_3 = NULL;
5152   PyObject *__pyx_t_4 = NULL;
5153   PyObject *__pyx_t_5 = NULL;
5154   int __pyx_lineno = 0;
5155   const char *__pyx_filename = NULL;
5156   int __pyx_clineno = 0;
5157   __Pyx_RefNannySetupContext("Rk", 0);
5158   /* Check if called by wrapper */
5159   if (unlikely(__pyx_skip_dispatch)) ;
5160   /* Check if overridden in Python */
5161   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5162     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5163     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5164     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5165       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5166       #endif
5167       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Rk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
5168       __Pyx_GOTREF(__pyx_t_1);
5169       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk)) {
5170         __Pyx_XDECREF(__pyx_r);
5171         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 51, __pyx_L1_error)
5172         __Pyx_GOTREF(__pyx_t_3);
5173         __Pyx_INCREF(__pyx_t_1);
5174         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
5175         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5176           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5177           if (likely(__pyx_t_5)) {
5178             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5179             __Pyx_INCREF(__pyx_t_5);
5180             __Pyx_INCREF(function);
5181             __Pyx_DECREF_SET(__pyx_t_4, function);
5182           }
5183         }
5184         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5185         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5186         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5187         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 51, __pyx_L1_error)
5188         __Pyx_GOTREF(__pyx_t_2);
5189         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5190         __pyx_r = __pyx_t_2;
5191         __pyx_t_2 = 0;
5192         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5193         goto __pyx_L0;
5194       }
5195       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5196       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5197       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5198       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5199         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5200       }
5201       #endif
5202       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5203       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5204     }
5205     #endif
5206   }
5207 
5208   /* "GPy/models/state_space_cython.pyx":52
5209  *
5210  *     cpdef Rk(self, int k):
5211  *         raise NotImplemented("(cython) Rk is not implemented!")             # <<<<<<<<<<<<<<
5212  *
5213  *     cpdef R_isrk(self, int k):
5214  */
5215   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
5216   __Pyx_GOTREF(__pyx_t_1);
5217   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5218   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5219   __PYX_ERR(0, 52, __pyx_L1_error)
5220 
5221   /* "GPy/models/state_space_cython.pyx":51
5222  *         raise NotImplemented("(cython) Hk is not implemented!")
5223  *
5224  *     cpdef Rk(self, int k):             # <<<<<<<<<<<<<<
5225  *         raise NotImplemented("(cython) Rk is not implemented!")
5226  *
5227  */
5228 
5229   /* function exit code */
5230   __pyx_L1_error:;
5231   __Pyx_XDECREF(__pyx_t_1);
5232   __Pyx_XDECREF(__pyx_t_2);
5233   __Pyx_XDECREF(__pyx_t_3);
5234   __Pyx_XDECREF(__pyx_t_4);
5235   __Pyx_XDECREF(__pyx_t_5);
5236   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5237   __pyx_r = 0;
5238   __pyx_L0:;
5239   __Pyx_XGIVEREF(__pyx_r);
5240   __Pyx_RefNannyFinishContext();
5241   return __pyx_r;
5242 }
5243 
5244 /* Python wrapper */
5245 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)5246 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
5247   int __pyx_v_k;
5248   int __pyx_lineno = 0;
5249   const char *__pyx_filename = NULL;
5250   int __pyx_clineno = 0;
5251   PyObject *__pyx_r = 0;
5252   __Pyx_RefNannyDeclarations
5253   __Pyx_RefNannySetupContext("Rk (wrapper)", 0);
5254   assert(__pyx_arg_k); {
5255     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L3_error)
5256   }
5257   goto __pyx_L4_argument_unpacking_done;
5258   __pyx_L3_error:;
5259   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5260   __Pyx_RefNannyFinishContext();
5261   return NULL;
5262   __pyx_L4_argument_unpacking_done:;
5263   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_4Rk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
5264 
5265   /* function exit code */
5266   __Pyx_RefNannyFinishContext();
5267   return __pyx_r;
5268 }
5269 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_4Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k)5270 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_4Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
5271   PyObject *__pyx_r = NULL;
5272   __Pyx_RefNannyDeclarations
5273   PyObject *__pyx_t_1 = NULL;
5274   int __pyx_lineno = 0;
5275   const char *__pyx_filename = NULL;
5276   int __pyx_clineno = 0;
5277   __Pyx_RefNannySetupContext("Rk", 0);
5278   __Pyx_XDECREF(__pyx_r);
5279   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Rk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
5280   __Pyx_GOTREF(__pyx_t_1);
5281   __pyx_r = __pyx_t_1;
5282   __pyx_t_1 = 0;
5283   goto __pyx_L0;
5284 
5285   /* function exit code */
5286   __pyx_L1_error:;
5287   __Pyx_XDECREF(__pyx_t_1);
5288   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5289   __pyx_r = NULL;
5290   __pyx_L0:;
5291   __Pyx_XGIVEREF(__pyx_r);
5292   __Pyx_RefNannyFinishContext();
5293   return __pyx_r;
5294 }
5295 
5296 /* "GPy/models/state_space_cython.pyx":54
5297  *         raise NotImplemented("(cython) Rk is not implemented!")
5298  *
5299  *     cpdef R_isrk(self, int k):             # <<<<<<<<<<<<<<
5300  *         raise NotImplemented("(cython) Q_srk is not implemented!")
5301  *
5302  */
5303 
5304 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_R_isrk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)5305 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_R_isrk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
5306   PyObject *__pyx_r = NULL;
5307   __Pyx_RefNannyDeclarations
5308   PyObject *__pyx_t_1 = NULL;
5309   PyObject *__pyx_t_2 = NULL;
5310   PyObject *__pyx_t_3 = NULL;
5311   PyObject *__pyx_t_4 = NULL;
5312   PyObject *__pyx_t_5 = NULL;
5313   int __pyx_lineno = 0;
5314   const char *__pyx_filename = NULL;
5315   int __pyx_clineno = 0;
5316   __Pyx_RefNannySetupContext("R_isrk", 0);
5317   /* Check if called by wrapper */
5318   if (unlikely(__pyx_skip_dispatch)) ;
5319   /* Check if overridden in Python */
5320   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5321     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5322     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5323     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5324       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5325       #endif
5326       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_R_isrk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
5327       __Pyx_GOTREF(__pyx_t_1);
5328       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk)) {
5329         __Pyx_XDECREF(__pyx_r);
5330         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
5331         __Pyx_GOTREF(__pyx_t_3);
5332         __Pyx_INCREF(__pyx_t_1);
5333         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
5334         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5335           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5336           if (likely(__pyx_t_5)) {
5337             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5338             __Pyx_INCREF(__pyx_t_5);
5339             __Pyx_INCREF(function);
5340             __Pyx_DECREF_SET(__pyx_t_4, function);
5341           }
5342         }
5343         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5344         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5345         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5346         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 54, __pyx_L1_error)
5347         __Pyx_GOTREF(__pyx_t_2);
5348         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5349         __pyx_r = __pyx_t_2;
5350         __pyx_t_2 = 0;
5351         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5352         goto __pyx_L0;
5353       }
5354       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5355       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5356       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5357       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5358         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5359       }
5360       #endif
5361       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5362       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5363     }
5364     #endif
5365   }
5366 
5367   /* "GPy/models/state_space_cython.pyx":55
5368  *
5369  *     cpdef R_isrk(self, int k):
5370  *         raise NotImplemented("(cython) Q_srk is not implemented!")             # <<<<<<<<<<<<<<
5371  *
5372  *     cpdef dHk(self, int k):
5373  */
5374   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
5375   __Pyx_GOTREF(__pyx_t_1);
5376   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5377   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5378   __PYX_ERR(0, 55, __pyx_L1_error)
5379 
5380   /* "GPy/models/state_space_cython.pyx":54
5381  *         raise NotImplemented("(cython) Rk is not implemented!")
5382  *
5383  *     cpdef R_isrk(self, int k):             # <<<<<<<<<<<<<<
5384  *         raise NotImplemented("(cython) Q_srk is not implemented!")
5385  *
5386  */
5387 
5388   /* function exit code */
5389   __pyx_L1_error:;
5390   __Pyx_XDECREF(__pyx_t_1);
5391   __Pyx_XDECREF(__pyx_t_2);
5392   __Pyx_XDECREF(__pyx_t_3);
5393   __Pyx_XDECREF(__pyx_t_4);
5394   __Pyx_XDECREF(__pyx_t_5);
5395   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5396   __pyx_r = 0;
5397   __pyx_L0:;
5398   __Pyx_XGIVEREF(__pyx_r);
5399   __Pyx_RefNannyFinishContext();
5400   return __pyx_r;
5401 }
5402 
5403 /* Python wrapper */
5404 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)5405 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
5406   int __pyx_v_k;
5407   int __pyx_lineno = 0;
5408   const char *__pyx_filename = NULL;
5409   int __pyx_clineno = 0;
5410   PyObject *__pyx_r = 0;
5411   __Pyx_RefNannyDeclarations
5412   __Pyx_RefNannySetupContext("R_isrk (wrapper)", 0);
5413   assert(__pyx_arg_k); {
5414     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L3_error)
5415   }
5416   goto __pyx_L4_argument_unpacking_done;
5417   __pyx_L3_error:;
5418   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5419   __Pyx_RefNannyFinishContext();
5420   return NULL;
5421   __pyx_L4_argument_unpacking_done:;
5422   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_6R_isrk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
5423 
5424   /* function exit code */
5425   __Pyx_RefNannyFinishContext();
5426   return __pyx_r;
5427 }
5428 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k)5429 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
5430   PyObject *__pyx_r = NULL;
5431   __Pyx_RefNannyDeclarations
5432   PyObject *__pyx_t_1 = NULL;
5433   int __pyx_lineno = 0;
5434   const char *__pyx_filename = NULL;
5435   int __pyx_clineno = 0;
5436   __Pyx_RefNannySetupContext("R_isrk", 0);
5437   __Pyx_XDECREF(__pyx_r);
5438   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_R_isrk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
5439   __Pyx_GOTREF(__pyx_t_1);
5440   __pyx_r = __pyx_t_1;
5441   __pyx_t_1 = 0;
5442   goto __pyx_L0;
5443 
5444   /* function exit code */
5445   __pyx_L1_error:;
5446   __Pyx_XDECREF(__pyx_t_1);
5447   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5448   __pyx_r = NULL;
5449   __pyx_L0:;
5450   __Pyx_XGIVEREF(__pyx_r);
5451   __Pyx_RefNannyFinishContext();
5452   return __pyx_r;
5453 }
5454 
5455 /* "GPy/models/state_space_cython.pyx":57
5456  *         raise NotImplemented("(cython) Q_srk is not implemented!")
5457  *
5458  *     cpdef dHk(self, int k):             # <<<<<<<<<<<<<<
5459  *         raise NotImplemented("(cython) dAk is not implemented!")
5460  *
5461  */
5462 
5463 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dHk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)5464 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dHk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
5465   PyObject *__pyx_r = NULL;
5466   __Pyx_RefNannyDeclarations
5467   PyObject *__pyx_t_1 = NULL;
5468   PyObject *__pyx_t_2 = NULL;
5469   PyObject *__pyx_t_3 = NULL;
5470   PyObject *__pyx_t_4 = NULL;
5471   PyObject *__pyx_t_5 = NULL;
5472   int __pyx_lineno = 0;
5473   const char *__pyx_filename = NULL;
5474   int __pyx_clineno = 0;
5475   __Pyx_RefNannySetupContext("dHk", 0);
5476   /* Check if called by wrapper */
5477   if (unlikely(__pyx_skip_dispatch)) ;
5478   /* Check if overridden in Python */
5479   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5480     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5481     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5482     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5483       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5484       #endif
5485       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dHk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
5486       __Pyx_GOTREF(__pyx_t_1);
5487       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk)) {
5488         __Pyx_XDECREF(__pyx_r);
5489         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
5490         __Pyx_GOTREF(__pyx_t_3);
5491         __Pyx_INCREF(__pyx_t_1);
5492         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
5493         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5494           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5495           if (likely(__pyx_t_5)) {
5496             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5497             __Pyx_INCREF(__pyx_t_5);
5498             __Pyx_INCREF(function);
5499             __Pyx_DECREF_SET(__pyx_t_4, function);
5500           }
5501         }
5502         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5503         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5504         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5505         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
5506         __Pyx_GOTREF(__pyx_t_2);
5507         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5508         __pyx_r = __pyx_t_2;
5509         __pyx_t_2 = 0;
5510         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5511         goto __pyx_L0;
5512       }
5513       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5514       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5515       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5516       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5517         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5518       }
5519       #endif
5520       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5521       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5522     }
5523     #endif
5524   }
5525 
5526   /* "GPy/models/state_space_cython.pyx":58
5527  *
5528  *     cpdef dHk(self, int k):
5529  *         raise NotImplemented("(cython) dAk is not implemented!")             # <<<<<<<<<<<<<<
5530  *
5531  *     cpdef dRk(self, int k):
5532  */
5533   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
5534   __Pyx_GOTREF(__pyx_t_1);
5535   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5536   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5537   __PYX_ERR(0, 58, __pyx_L1_error)
5538 
5539   /* "GPy/models/state_space_cython.pyx":57
5540  *         raise NotImplemented("(cython) Q_srk is not implemented!")
5541  *
5542  *     cpdef dHk(self, int k):             # <<<<<<<<<<<<<<
5543  *         raise NotImplemented("(cython) dAk is not implemented!")
5544  *
5545  */
5546 
5547   /* function exit code */
5548   __pyx_L1_error:;
5549   __Pyx_XDECREF(__pyx_t_1);
5550   __Pyx_XDECREF(__pyx_t_2);
5551   __Pyx_XDECREF(__pyx_t_3);
5552   __Pyx_XDECREF(__pyx_t_4);
5553   __Pyx_XDECREF(__pyx_t_5);
5554   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5555   __pyx_r = 0;
5556   __pyx_L0:;
5557   __Pyx_XGIVEREF(__pyx_r);
5558   __Pyx_RefNannyFinishContext();
5559   return __pyx_r;
5560 }
5561 
5562 /* Python wrapper */
5563 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)5564 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
5565   int __pyx_v_k;
5566   int __pyx_lineno = 0;
5567   const char *__pyx_filename = NULL;
5568   int __pyx_clineno = 0;
5569   PyObject *__pyx_r = 0;
5570   __Pyx_RefNannyDeclarations
5571   __Pyx_RefNannySetupContext("dHk (wrapper)", 0);
5572   assert(__pyx_arg_k); {
5573     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L3_error)
5574   }
5575   goto __pyx_L4_argument_unpacking_done;
5576   __pyx_L3_error:;
5577   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5578   __Pyx_RefNannyFinishContext();
5579   return NULL;
5580   __pyx_L4_argument_unpacking_done:;
5581   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_8dHk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
5582 
5583   /* function exit code */
5584   __Pyx_RefNannyFinishContext();
5585   return __pyx_r;
5586 }
5587 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_8dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k)5588 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_8dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
5589   PyObject *__pyx_r = NULL;
5590   __Pyx_RefNannyDeclarations
5591   PyObject *__pyx_t_1 = NULL;
5592   int __pyx_lineno = 0;
5593   const char *__pyx_filename = NULL;
5594   int __pyx_clineno = 0;
5595   __Pyx_RefNannySetupContext("dHk", 0);
5596   __Pyx_XDECREF(__pyx_r);
5597   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dHk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
5598   __Pyx_GOTREF(__pyx_t_1);
5599   __pyx_r = __pyx_t_1;
5600   __pyx_t_1 = 0;
5601   goto __pyx_L0;
5602 
5603   /* function exit code */
5604   __pyx_L1_error:;
5605   __Pyx_XDECREF(__pyx_t_1);
5606   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5607   __pyx_r = NULL;
5608   __pyx_L0:;
5609   __Pyx_XGIVEREF(__pyx_r);
5610   __Pyx_RefNannyFinishContext();
5611   return __pyx_r;
5612 }
5613 
5614 /* "GPy/models/state_space_cython.pyx":60
5615  *         raise NotImplemented("(cython) dAk is not implemented!")
5616  *
5617  *     cpdef dRk(self, int k):             # <<<<<<<<<<<<<<
5618  *         raise NotImplemented("(cython) dQk is not implemented!")
5619  *
5620  */
5621 
5622 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dRk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)5623 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dRk(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
5624   PyObject *__pyx_r = NULL;
5625   __Pyx_RefNannyDeclarations
5626   PyObject *__pyx_t_1 = NULL;
5627   PyObject *__pyx_t_2 = NULL;
5628   PyObject *__pyx_t_3 = NULL;
5629   PyObject *__pyx_t_4 = NULL;
5630   PyObject *__pyx_t_5 = NULL;
5631   int __pyx_lineno = 0;
5632   const char *__pyx_filename = NULL;
5633   int __pyx_clineno = 0;
5634   __Pyx_RefNannySetupContext("dRk", 0);
5635   /* Check if called by wrapper */
5636   if (unlikely(__pyx_skip_dispatch)) ;
5637   /* Check if overridden in Python */
5638   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5639     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5640     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5641     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5642       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5643       #endif
5644       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dRk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
5645       __Pyx_GOTREF(__pyx_t_1);
5646       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk)) {
5647         __Pyx_XDECREF(__pyx_r);
5648         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 60, __pyx_L1_error)
5649         __Pyx_GOTREF(__pyx_t_3);
5650         __Pyx_INCREF(__pyx_t_1);
5651         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
5652         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5653           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
5654           if (likely(__pyx_t_5)) {
5655             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5656             __Pyx_INCREF(__pyx_t_5);
5657             __Pyx_INCREF(function);
5658             __Pyx_DECREF_SET(__pyx_t_4, function);
5659           }
5660         }
5661         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
5662         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5663         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5664         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 60, __pyx_L1_error)
5665         __Pyx_GOTREF(__pyx_t_2);
5666         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5667         __pyx_r = __pyx_t_2;
5668         __pyx_t_2 = 0;
5669         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5670         goto __pyx_L0;
5671       }
5672       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5673       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5674       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5675       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5676         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5677       }
5678       #endif
5679       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5680       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5681     }
5682     #endif
5683   }
5684 
5685   /* "GPy/models/state_space_cython.pyx":61
5686  *
5687  *     cpdef dRk(self, int k):
5688  *         raise NotImplemented("(cython) dQk is not implemented!")             # <<<<<<<<<<<<<<
5689  *
5690  *     cpdef reset(self,compute_derivatives = False):
5691  */
5692   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
5693   __Pyx_GOTREF(__pyx_t_1);
5694   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5695   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5696   __PYX_ERR(0, 61, __pyx_L1_error)
5697 
5698   /* "GPy/models/state_space_cython.pyx":60
5699  *         raise NotImplemented("(cython) dAk is not implemented!")
5700  *
5701  *     cpdef dRk(self, int k):             # <<<<<<<<<<<<<<
5702  *         raise NotImplemented("(cython) dQk is not implemented!")
5703  *
5704  */
5705 
5706   /* function exit code */
5707   __pyx_L1_error:;
5708   __Pyx_XDECREF(__pyx_t_1);
5709   __Pyx_XDECREF(__pyx_t_2);
5710   __Pyx_XDECREF(__pyx_t_3);
5711   __Pyx_XDECREF(__pyx_t_4);
5712   __Pyx_XDECREF(__pyx_t_5);
5713   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5714   __pyx_r = 0;
5715   __pyx_L0:;
5716   __Pyx_XGIVEREF(__pyx_r);
5717   __Pyx_RefNannyFinishContext();
5718   return __pyx_r;
5719 }
5720 
5721 /* Python wrapper */
5722 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)5723 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
5724   int __pyx_v_k;
5725   int __pyx_lineno = 0;
5726   const char *__pyx_filename = NULL;
5727   int __pyx_clineno = 0;
5728   PyObject *__pyx_r = 0;
5729   __Pyx_RefNannyDeclarations
5730   __Pyx_RefNannySetupContext("dRk (wrapper)", 0);
5731   assert(__pyx_arg_k); {
5732     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L3_error)
5733   }
5734   goto __pyx_L4_argument_unpacking_done;
5735   __pyx_L3_error:;
5736   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5737   __Pyx_RefNannyFinishContext();
5738   return NULL;
5739   __pyx_L4_argument_unpacking_done:;
5740   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_10dRk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
5741 
5742   /* function exit code */
5743   __Pyx_RefNannyFinishContext();
5744   return __pyx_r;
5745 }
5746 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_10dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k)5747 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_10dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
5748   PyObject *__pyx_r = NULL;
5749   __Pyx_RefNannyDeclarations
5750   PyObject *__pyx_t_1 = NULL;
5751   int __pyx_lineno = 0;
5752   const char *__pyx_filename = NULL;
5753   int __pyx_clineno = 0;
5754   __Pyx_RefNannySetupContext("dRk", 0);
5755   __Pyx_XDECREF(__pyx_r);
5756   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dRk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
5757   __Pyx_GOTREF(__pyx_t_1);
5758   __pyx_r = __pyx_t_1;
5759   __pyx_t_1 = 0;
5760   goto __pyx_L0;
5761 
5762   /* function exit code */
5763   __pyx_L1_error:;
5764   __Pyx_XDECREF(__pyx_t_1);
5765   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
5766   __pyx_r = NULL;
5767   __pyx_L0:;
5768   __Pyx_XGIVEREF(__pyx_r);
5769   __Pyx_RefNannyFinishContext();
5770   return __pyx_r;
5771 }
5772 
5773 /* "GPy/models/state_space_cython.pyx":63
5774  *         raise NotImplemented("(cython) dQk is not implemented!")
5775  *
5776  *     cpdef reset(self,compute_derivatives = False):             # <<<<<<<<<<<<<<
5777  *         raise NotImplemented("(cython) reset is not implemented!")
5778  *
5779  */
5780 
5781 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset * __pyx_optional_args)5782 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset *__pyx_optional_args) {
5783   PyObject *__pyx_v_compute_derivatives = ((PyObject *)Py_False);
5784   PyObject *__pyx_r = NULL;
5785   __Pyx_RefNannyDeclarations
5786   PyObject *__pyx_t_1 = NULL;
5787   PyObject *__pyx_t_2 = NULL;
5788   PyObject *__pyx_t_3 = NULL;
5789   PyObject *__pyx_t_4 = NULL;
5790   int __pyx_lineno = 0;
5791   const char *__pyx_filename = NULL;
5792   int __pyx_clineno = 0;
5793   __Pyx_RefNannySetupContext("reset", 0);
5794   if (__pyx_optional_args) {
5795     if (__pyx_optional_args->__pyx_n > 0) {
5796       __pyx_v_compute_derivatives = __pyx_optional_args->compute_derivatives;
5797     }
5798   }
5799   /* Check if called by wrapper */
5800   if (unlikely(__pyx_skip_dispatch)) ;
5801   /* Check if overridden in Python */
5802   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5803     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5804     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5805     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5806       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5807       #endif
5808       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
5809       __Pyx_GOTREF(__pyx_t_1);
5810       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset)) {
5811         __Pyx_XDECREF(__pyx_r);
5812         __Pyx_INCREF(__pyx_t_1);
5813         __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
5814         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5815           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5816           if (likely(__pyx_t_4)) {
5817             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5818             __Pyx_INCREF(__pyx_t_4);
5819             __Pyx_INCREF(function);
5820             __Pyx_DECREF_SET(__pyx_t_3, function);
5821           }
5822         }
5823         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_compute_derivatives) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_compute_derivatives);
5824         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5825         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
5826         __Pyx_GOTREF(__pyx_t_2);
5827         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5828         __pyx_r = __pyx_t_2;
5829         __pyx_t_2 = 0;
5830         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5831         goto __pyx_L0;
5832       }
5833       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5834       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5835       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5836       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
5837         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5838       }
5839       #endif
5840       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5841       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5842     }
5843     #endif
5844   }
5845 
5846   /* "GPy/models/state_space_cython.pyx":64
5847  *
5848  *     cpdef reset(self,compute_derivatives = False):
5849  *         raise NotImplemented("(cython) reset is not implemented!")             # <<<<<<<<<<<<<<
5850  *
5851  * cdef class R_handling_Cython(Measurement_Callables_Cython):
5852  */
5853   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_NotImplemented, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
5854   __Pyx_GOTREF(__pyx_t_1);
5855   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5856   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5857   __PYX_ERR(0, 64, __pyx_L1_error)
5858 
5859   /* "GPy/models/state_space_cython.pyx":63
5860  *         raise NotImplemented("(cython) dQk is not implemented!")
5861  *
5862  *     cpdef reset(self,compute_derivatives = False):             # <<<<<<<<<<<<<<
5863  *         raise NotImplemented("(cython) reset is not implemented!")
5864  *
5865  */
5866 
5867   /* function exit code */
5868   __pyx_L1_error:;
5869   __Pyx_XDECREF(__pyx_t_1);
5870   __Pyx_XDECREF(__pyx_t_2);
5871   __Pyx_XDECREF(__pyx_t_3);
5872   __Pyx_XDECREF(__pyx_t_4);
5873   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
5874   __pyx_r = 0;
5875   __pyx_L0:;
5876   __Pyx_XGIVEREF(__pyx_r);
5877   __Pyx_RefNannyFinishContext();
5878   return __pyx_r;
5879 }
5880 
5881 /* Python wrapper */
5882 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5883 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5884   PyObject *__pyx_v_compute_derivatives = 0;
5885   int __pyx_lineno = 0;
5886   const char *__pyx_filename = NULL;
5887   int __pyx_clineno = 0;
5888   PyObject *__pyx_r = 0;
5889   __Pyx_RefNannyDeclarations
5890   __Pyx_RefNannySetupContext("reset (wrapper)", 0);
5891   {
5892     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_compute_derivatives,0};
5893     PyObject* values[1] = {0};
5894     values[0] = ((PyObject *)Py_False);
5895     if (unlikely(__pyx_kwds)) {
5896       Py_ssize_t kw_args;
5897       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5898       switch (pos_args) {
5899         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5900         CYTHON_FALLTHROUGH;
5901         case  0: break;
5902         default: goto __pyx_L5_argtuple_error;
5903       }
5904       kw_args = PyDict_Size(__pyx_kwds);
5905       switch (pos_args) {
5906         case  0:
5907         if (kw_args > 0) {
5908           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_derivatives);
5909           if (value) { values[0] = value; kw_args--; }
5910         }
5911       }
5912       if (unlikely(kw_args > 0)) {
5913         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset") < 0)) __PYX_ERR(0, 63, __pyx_L3_error)
5914       }
5915     } else {
5916       switch (PyTuple_GET_SIZE(__pyx_args)) {
5917         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5918         CYTHON_FALLTHROUGH;
5919         case  0: break;
5920         default: goto __pyx_L5_argtuple_error;
5921       }
5922     }
5923     __pyx_v_compute_derivatives = values[0];
5924   }
5925   goto __pyx_L4_argument_unpacking_done;
5926   __pyx_L5_argtuple_error:;
5927   __Pyx_RaiseArgtupleInvalid("reset", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 63, __pyx_L3_error)
5928   __pyx_L3_error:;
5929   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
5930   __Pyx_RefNannyFinishContext();
5931   return NULL;
5932   __pyx_L4_argument_unpacking_done:;
5933   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_12reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_compute_derivatives);
5934 
5935   /* function exit code */
5936   __Pyx_RefNannyFinishContext();
5937   return __pyx_r;
5938 }
5939 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,PyObject * __pyx_v_compute_derivatives)5940 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_12reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v_compute_derivatives) {
5941   PyObject *__pyx_r = NULL;
5942   __Pyx_RefNannyDeclarations
5943   PyObject *__pyx_t_1 = NULL;
5944   struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset __pyx_t_2;
5945   int __pyx_lineno = 0;
5946   const char *__pyx_filename = NULL;
5947   int __pyx_clineno = 0;
5948   __Pyx_RefNannySetupContext("reset", 0);
5949   __Pyx_XDECREF(__pyx_r);
5950   __pyx_t_2.__pyx_n = 1;
5951   __pyx_t_2.compute_derivatives = __pyx_v_compute_derivatives;
5952   __pyx_t_1 = __pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython->reset(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
5953   __Pyx_GOTREF(__pyx_t_1);
5954   __pyx_r = __pyx_t_1;
5955   __pyx_t_1 = 0;
5956   goto __pyx_L0;
5957 
5958   /* function exit code */
5959   __pyx_L1_error:;
5960   __Pyx_XDECREF(__pyx_t_1);
5961   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
5962   __pyx_r = NULL;
5963   __pyx_L0:;
5964   __Pyx_XGIVEREF(__pyx_r);
5965   __Pyx_RefNannyFinishContext();
5966   return __pyx_r;
5967 }
5968 
5969 /* "(tree fragment)":1
5970  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
5971  *     cdef tuple state
5972  *     cdef object _dict
5973  */
5974 
5975 /* Python wrapper */
5976 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_15__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5977 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5978   PyObject *__pyx_r = 0;
5979   __Pyx_RefNannyDeclarations
5980   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5981   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_14__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self));
5982 
5983   /* function exit code */
5984   __Pyx_RefNannyFinishContext();
5985   return __pyx_r;
5986 }
5987 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self)5988 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_14__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self) {
5989   PyObject *__pyx_v_state = 0;
5990   PyObject *__pyx_v__dict = 0;
5991   int __pyx_v_use_setstate;
5992   PyObject *__pyx_r = NULL;
5993   __Pyx_RefNannyDeclarations
5994   PyObject *__pyx_t_1 = NULL;
5995   int __pyx_t_2;
5996   int __pyx_t_3;
5997   PyObject *__pyx_t_4 = NULL;
5998   PyObject *__pyx_t_5 = NULL;
5999   int __pyx_lineno = 0;
6000   const char *__pyx_filename = NULL;
6001   int __pyx_clineno = 0;
6002   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6003 
6004   /* "(tree fragment)":5
6005  *     cdef object _dict
6006  *     cdef bint use_setstate
6007  *     state = ()             # <<<<<<<<<<<<<<
6008  *     _dict = getattr(self, '__dict__', None)
6009  *     if _dict is not None:
6010  */
6011   __Pyx_INCREF(__pyx_empty_tuple);
6012   __pyx_v_state = __pyx_empty_tuple;
6013 
6014   /* "(tree fragment)":6
6015  *     cdef bint use_setstate
6016  *     state = ()
6017  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
6018  *     if _dict is not None:
6019  *         state += (_dict,)
6020  */
6021   __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
6022   __Pyx_GOTREF(__pyx_t_1);
6023   __pyx_v__dict = __pyx_t_1;
6024   __pyx_t_1 = 0;
6025 
6026   /* "(tree fragment)":7
6027  *     state = ()
6028  *     _dict = getattr(self, '__dict__', None)
6029  *     if _dict is not None:             # <<<<<<<<<<<<<<
6030  *         state += (_dict,)
6031  *         use_setstate = True
6032  */
6033   __pyx_t_2 = (__pyx_v__dict != Py_None);
6034   __pyx_t_3 = (__pyx_t_2 != 0);
6035   if (__pyx_t_3) {
6036 
6037     /* "(tree fragment)":8
6038  *     _dict = getattr(self, '__dict__', None)
6039  *     if _dict is not None:
6040  *         state += (_dict,)             # <<<<<<<<<<<<<<
6041  *         use_setstate = True
6042  *     else:
6043  */
6044     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
6045     __Pyx_GOTREF(__pyx_t_1);
6046     __Pyx_INCREF(__pyx_v__dict);
6047     __Pyx_GIVEREF(__pyx_v__dict);
6048     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
6049     __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
6050     __Pyx_GOTREF(__pyx_t_4);
6051     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6052     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
6053     __pyx_t_4 = 0;
6054 
6055     /* "(tree fragment)":9
6056  *     if _dict is not None:
6057  *         state += (_dict,)
6058  *         use_setstate = True             # <<<<<<<<<<<<<<
6059  *     else:
6060  *         use_setstate = False
6061  */
6062     __pyx_v_use_setstate = 1;
6063 
6064     /* "(tree fragment)":7
6065  *     state = ()
6066  *     _dict = getattr(self, '__dict__', None)
6067  *     if _dict is not None:             # <<<<<<<<<<<<<<
6068  *         state += (_dict,)
6069  *         use_setstate = True
6070  */
6071     goto __pyx_L3;
6072   }
6073 
6074   /* "(tree fragment)":11
6075  *         use_setstate = True
6076  *     else:
6077  *         use_setstate = False             # <<<<<<<<<<<<<<
6078  *     if use_setstate:
6079  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, None), state
6080  */
6081   /*else*/ {
6082     __pyx_v_use_setstate = 0;
6083   }
6084   __pyx_L3:;
6085 
6086   /* "(tree fragment)":12
6087  *     else:
6088  *         use_setstate = False
6089  *     if use_setstate:             # <<<<<<<<<<<<<<
6090  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, None), state
6091  *     else:
6092  */
6093   __pyx_t_3 = (__pyx_v_use_setstate != 0);
6094   if (__pyx_t_3) {
6095 
6096     /* "(tree fragment)":13
6097  *         use_setstate = False
6098  *     if use_setstate:
6099  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, None), state             # <<<<<<<<<<<<<<
6100  *     else:
6101  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, state)
6102  */
6103     __Pyx_XDECREF(__pyx_r);
6104     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Measurement_Calla); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
6105     __Pyx_GOTREF(__pyx_t_4);
6106     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
6107     __Pyx_GOTREF(__pyx_t_1);
6108     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6109     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6110     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6111     __Pyx_INCREF(__pyx_int_222419149);
6112     __Pyx_GIVEREF(__pyx_int_222419149);
6113     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
6114     __Pyx_INCREF(Py_None);
6115     __Pyx_GIVEREF(Py_None);
6116     PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
6117     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
6118     __Pyx_GOTREF(__pyx_t_5);
6119     __Pyx_GIVEREF(__pyx_t_4);
6120     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
6121     __Pyx_GIVEREF(__pyx_t_1);
6122     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
6123     __Pyx_INCREF(__pyx_v_state);
6124     __Pyx_GIVEREF(__pyx_v_state);
6125     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
6126     __pyx_t_4 = 0;
6127     __pyx_t_1 = 0;
6128     __pyx_r = __pyx_t_5;
6129     __pyx_t_5 = 0;
6130     goto __pyx_L0;
6131 
6132     /* "(tree fragment)":12
6133  *     else:
6134  *         use_setstate = False
6135  *     if use_setstate:             # <<<<<<<<<<<<<<
6136  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, None), state
6137  *     else:
6138  */
6139   }
6140 
6141   /* "(tree fragment)":15
6142  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, None), state
6143  *     else:
6144  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, state)             # <<<<<<<<<<<<<<
6145  * def __setstate_cython__(self, __pyx_state):
6146  *     __pyx_unpickle_Measurement_Callables_Cython__set_state(self, __pyx_state)
6147  */
6148   /*else*/ {
6149     __Pyx_XDECREF(__pyx_r);
6150     __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Measurement_Calla); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
6151     __Pyx_GOTREF(__pyx_t_5);
6152     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
6153     __Pyx_GOTREF(__pyx_t_1);
6154     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6155     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6156     PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
6157     __Pyx_INCREF(__pyx_int_222419149);
6158     __Pyx_GIVEREF(__pyx_int_222419149);
6159     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_222419149);
6160     __Pyx_INCREF(__pyx_v_state);
6161     __Pyx_GIVEREF(__pyx_v_state);
6162     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
6163     __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
6164     __Pyx_GOTREF(__pyx_t_4);
6165     __Pyx_GIVEREF(__pyx_t_5);
6166     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6167     __Pyx_GIVEREF(__pyx_t_1);
6168     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
6169     __pyx_t_5 = 0;
6170     __pyx_t_1 = 0;
6171     __pyx_r = __pyx_t_4;
6172     __pyx_t_4 = 0;
6173     goto __pyx_L0;
6174   }
6175 
6176   /* "(tree fragment)":1
6177  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
6178  *     cdef tuple state
6179  *     cdef object _dict
6180  */
6181 
6182   /* function exit code */
6183   __pyx_L1_error:;
6184   __Pyx_XDECREF(__pyx_t_1);
6185   __Pyx_XDECREF(__pyx_t_4);
6186   __Pyx_XDECREF(__pyx_t_5);
6187   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6188   __pyx_r = NULL;
6189   __pyx_L0:;
6190   __Pyx_XDECREF(__pyx_v_state);
6191   __Pyx_XDECREF(__pyx_v__dict);
6192   __Pyx_XGIVEREF(__pyx_r);
6193   __Pyx_RefNannyFinishContext();
6194   return __pyx_r;
6195 }
6196 
6197 /* "(tree fragment)":16
6198  *     else:
6199  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, state)
6200  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6201  *     __pyx_unpickle_Measurement_Callables_Cython__set_state(self, __pyx_state)
6202  */
6203 
6204 /* Python wrapper */
6205 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_17__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)6206 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6207   PyObject *__pyx_r = 0;
6208   __Pyx_RefNannyDeclarations
6209   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6210   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_16__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6211 
6212   /* function exit code */
6213   __Pyx_RefNannyFinishContext();
6214   return __pyx_r;
6215 }
6216 
__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)6217 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_16__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6218   PyObject *__pyx_r = NULL;
6219   __Pyx_RefNannyDeclarations
6220   PyObject *__pyx_t_1 = NULL;
6221   int __pyx_lineno = 0;
6222   const char *__pyx_filename = NULL;
6223   int __pyx_clineno = 0;
6224   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6225 
6226   /* "(tree fragment)":17
6227  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, state)
6228  * def __setstate_cython__(self, __pyx_state):
6229  *     __pyx_unpickle_Measurement_Callables_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
6230  */
6231   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
6232   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Measurement_Callables_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
6233   __Pyx_GOTREF(__pyx_t_1);
6234   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6235 
6236   /* "(tree fragment)":16
6237  *     else:
6238  *         return __pyx_unpickle_Measurement_Callables_Cython, (type(self), 0xd41d8cd, state)
6239  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
6240  *     __pyx_unpickle_Measurement_Callables_Cython__set_state(self, __pyx_state)
6241  */
6242 
6243   /* function exit code */
6244   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6245   goto __pyx_L0;
6246   __pyx_L1_error:;
6247   __Pyx_XDECREF(__pyx_t_1);
6248   __Pyx_AddTraceback("GPy.models.state_space_cython.Measurement_Callables_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6249   __pyx_r = NULL;
6250   __pyx_L0:;
6251   __Pyx_XGIVEREF(__pyx_r);
6252   __Pyx_RefNannyFinishContext();
6253   return __pyx_r;
6254 }
6255 
6256 /* "GPy/models/state_space_cython.pyx":78
6257  *         dict R_square_root
6258  *
6259  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
6260  *                    int R_time_var_index, int p_unique_R_number, np.ndarray[DTYPE_t, ndim=3] dR = None):
6261  *         """
6262  */
6263 
6264 /* Python wrapper */
6265 static int __pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6266 static char __pyx_doc_3GPy_6models_18state_space_cython_17R_handling_Cython___init__[] = "\n        Input:        \n        ---------------\n        R - array with noise on various steps. The result of preprocessing\n            the noise input.\n        \n        index - for each step of Kalman filter contains the corresponding index\n                in the array.\n        \n        R_time_var_index - another index in the array R. Computed earlier and passed here.\n        \n        unique_R_number - number of unique noise matrices below which square roots\n            are cached and above which they are computed each time.\n        \n        dR: 3D array[:, :, param_num]\n            derivative of R. Derivative is supported only when R do not change over time\n             \n        Output:\n        --------------\n        Object which has two necessary functions:\n            f_R(k)\n            inv_R_square_root(k)\n        ";
6267 #if CYTHON_COMPILING_IN_CPYTHON
6268 struct wrapperbase __pyx_wrapperbase_3GPy_6models_18state_space_cython_17R_handling_Cython___init__;
6269 #endif
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6270 static int __pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6271   PyArrayObject *__pyx_v_R = 0;
6272   PyArrayObject *__pyx_v_index = 0;
6273   int __pyx_v_R_time_var_index;
6274   int __pyx_v_p_unique_R_number;
6275   PyArrayObject *__pyx_v_dR = 0;
6276   int __pyx_lineno = 0;
6277   const char *__pyx_filename = NULL;
6278   int __pyx_clineno = 0;
6279   int __pyx_r;
6280   __Pyx_RefNannyDeclarations
6281   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
6282   {
6283     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_index,&__pyx_n_s_R_time_var_index,&__pyx_n_s_p_unique_R_number,&__pyx_n_s_dR,0};
6284     PyObject* values[5] = {0,0,0,0,0};
6285 
6286     /* "GPy/models/state_space_cython.pyx":79
6287  *
6288  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index,
6289  *                    int R_time_var_index, int p_unique_R_number, np.ndarray[DTYPE_t, ndim=3] dR = None):             # <<<<<<<<<<<<<<
6290  *         """
6291  *         Input:
6292  */
6293     values[4] = (PyObject *)((PyArrayObject *)Py_None);
6294     if (unlikely(__pyx_kwds)) {
6295       Py_ssize_t kw_args;
6296       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6297       switch (pos_args) {
6298         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6299         CYTHON_FALLTHROUGH;
6300         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6301         CYTHON_FALLTHROUGH;
6302         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6303         CYTHON_FALLTHROUGH;
6304         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6305         CYTHON_FALLTHROUGH;
6306         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6307         CYTHON_FALLTHROUGH;
6308         case  0: break;
6309         default: goto __pyx_L5_argtuple_error;
6310       }
6311       kw_args = PyDict_Size(__pyx_kwds);
6312       switch (pos_args) {
6313         case  0:
6314         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
6315         else goto __pyx_L5_argtuple_error;
6316         CYTHON_FALLTHROUGH;
6317         case  1:
6318         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
6319         else {
6320           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 78, __pyx_L3_error)
6321         }
6322         CYTHON_FALLTHROUGH;
6323         case  2:
6324         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R_time_var_index)) != 0)) kw_args--;
6325         else {
6326           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 78, __pyx_L3_error)
6327         }
6328         CYTHON_FALLTHROUGH;
6329         case  3:
6330         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_unique_R_number)) != 0)) kw_args--;
6331         else {
6332           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 78, __pyx_L3_error)
6333         }
6334         CYTHON_FALLTHROUGH;
6335         case  4:
6336         if (kw_args > 0) {
6337           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dR);
6338           if (value) { values[4] = value; kw_args--; }
6339         }
6340       }
6341       if (unlikely(kw_args > 0)) {
6342         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 78, __pyx_L3_error)
6343       }
6344     } else {
6345       switch (PyTuple_GET_SIZE(__pyx_args)) {
6346         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6347         CYTHON_FALLTHROUGH;
6348         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6349         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6350         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6351         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6352         break;
6353         default: goto __pyx_L5_argtuple_error;
6354       }
6355     }
6356     __pyx_v_R = ((PyArrayObject *)values[0]);
6357     __pyx_v_index = ((PyArrayObject *)values[1]);
6358     __pyx_v_R_time_var_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_R_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
6359     __pyx_v_p_unique_R_number = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_p_unique_R_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 79, __pyx_L3_error)
6360     __pyx_v_dR = ((PyArrayObject *)values[4]);
6361   }
6362   goto __pyx_L4_argument_unpacking_done;
6363   __pyx_L5_argtuple_error:;
6364   __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 78, __pyx_L3_error)
6365   __pyx_L3_error:;
6366   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6367   __Pyx_RefNannyFinishContext();
6368   return -1;
6369   __pyx_L4_argument_unpacking_done:;
6370   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_5numpy_ndarray, 1, "R", 0))) __PYX_ERR(0, 78, __pyx_L1_error)
6371   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 78, __pyx_L1_error)
6372   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dR), __pyx_ptype_5numpy_ndarray, 1, "dR", 0))) __PYX_ERR(0, 79, __pyx_L1_error)
6373   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython___init__(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self), __pyx_v_R, __pyx_v_index, __pyx_v_R_time_var_index, __pyx_v_p_unique_R_number, __pyx_v_dR);
6374 
6375   /* "GPy/models/state_space_cython.pyx":78
6376  *         dict R_square_root
6377  *
6378  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
6379  *                    int R_time_var_index, int p_unique_R_number, np.ndarray[DTYPE_t, ndim=3] dR = None):
6380  *         """
6381  */
6382 
6383   /* function exit code */
6384   goto __pyx_L0;
6385   __pyx_L1_error:;
6386   __pyx_r = -1;
6387   __pyx_L0:;
6388   __Pyx_RefNannyFinishContext();
6389   return __pyx_r;
6390 }
6391 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,PyArrayObject * __pyx_v_R,PyArrayObject * __pyx_v_index,int __pyx_v_R_time_var_index,int __pyx_v_p_unique_R_number,PyArrayObject * __pyx_v_dR)6392 static int __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, PyArrayObject *__pyx_v_R, PyArrayObject *__pyx_v_index, int __pyx_v_R_time_var_index, int __pyx_v_p_unique_R_number, PyArrayObject *__pyx_v_dR) {
6393   int __pyx_v_unique_len;
6394   __Pyx_LocalBuf_ND __pyx_pybuffernd_R;
6395   __Pyx_Buffer __pyx_pybuffer_R;
6396   __Pyx_LocalBuf_ND __pyx_pybuffernd_dR;
6397   __Pyx_Buffer __pyx_pybuffer_dR;
6398   __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
6399   __Pyx_Buffer __pyx_pybuffer_index;
6400   int __pyx_r;
6401   __Pyx_RefNannyDeclarations
6402   PyObject *__pyx_t_1 = NULL;
6403   PyObject *__pyx_t_2 = NULL;
6404   PyObject *__pyx_t_3 = NULL;
6405   Py_ssize_t __pyx_t_4;
6406   int __pyx_t_5;
6407   int __pyx_lineno = 0;
6408   const char *__pyx_filename = NULL;
6409   int __pyx_clineno = 0;
6410   __Pyx_RefNannySetupContext("__init__", 0);
6411   __pyx_pybuffer_R.pybuffer.buf = NULL;
6412   __pyx_pybuffer_R.refcount = 0;
6413   __pyx_pybuffernd_R.data = NULL;
6414   __pyx_pybuffernd_R.rcbuffer = &__pyx_pybuffer_R;
6415   __pyx_pybuffer_index.pybuffer.buf = NULL;
6416   __pyx_pybuffer_index.refcount = 0;
6417   __pyx_pybuffernd_index.data = NULL;
6418   __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
6419   __pyx_pybuffer_dR.pybuffer.buf = NULL;
6420   __pyx_pybuffer_dR.refcount = 0;
6421   __pyx_pybuffernd_dR.data = NULL;
6422   __pyx_pybuffernd_dR.rcbuffer = &__pyx_pybuffer_dR;
6423   {
6424     __Pyx_BufFmt_StackElem __pyx_stack[1];
6425     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_v_R, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error)
6426   }
6427   __pyx_pybuffernd_R.diminfo[0].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R.diminfo[0].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R.diminfo[1].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R.diminfo[1].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_R.diminfo[2].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_R.diminfo[2].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[2];
6428   {
6429     __Pyx_BufFmt_StackElem __pyx_stack[1];
6430     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error)
6431   }
6432   __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_index.diminfo[1].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_index.diminfo[1].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[1];
6433   {
6434     __Pyx_BufFmt_StackElem __pyx_stack[1];
6435     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR.rcbuffer->pybuffer, (PyObject*)__pyx_v_dR, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 78, __pyx_L1_error)
6436   }
6437   __pyx_pybuffernd_dR.diminfo[0].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dR.diminfo[0].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dR.diminfo[1].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dR.diminfo[1].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dR.diminfo[2].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dR.diminfo[2].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[2];
6438 
6439   /* "GPy/models/state_space_cython.pyx":104
6440  *         """
6441  *
6442  *         self.R = R             # <<<<<<<<<<<<<<
6443  *         self.index = index
6444  *         self.R_time_var_index = R_time_var_index
6445  */
6446   __Pyx_INCREF(((PyObject *)__pyx_v_R));
6447   __Pyx_GIVEREF(((PyObject *)__pyx_v_R));
6448   __Pyx_GOTREF(__pyx_v_self->R);
6449   __Pyx_DECREF(((PyObject *)__pyx_v_self->R));
6450   __pyx_v_self->R = ((PyArrayObject *)__pyx_v_R);
6451 
6452   /* "GPy/models/state_space_cython.pyx":105
6453  *
6454  *         self.R = R
6455  *         self.index = index             # <<<<<<<<<<<<<<
6456  *         self.R_time_var_index = R_time_var_index
6457  *         self.dR = dR
6458  */
6459   __Pyx_INCREF(((PyObject *)__pyx_v_index));
6460   __Pyx_GIVEREF(((PyObject *)__pyx_v_index));
6461   __Pyx_GOTREF(__pyx_v_self->index);
6462   __Pyx_DECREF(((PyObject *)__pyx_v_self->index));
6463   __pyx_v_self->index = ((PyArrayObject *)__pyx_v_index);
6464 
6465   /* "GPy/models/state_space_cython.pyx":106
6466  *         self.R = R
6467  *         self.index = index
6468  *         self.R_time_var_index = R_time_var_index             # <<<<<<<<<<<<<<
6469  *         self.dR = dR
6470  *
6471  */
6472   __pyx_v_self->R_time_var_index = __pyx_v_R_time_var_index;
6473 
6474   /* "GPy/models/state_space_cython.pyx":107
6475  *         self.index = index
6476  *         self.R_time_var_index = R_time_var_index
6477  *         self.dR = dR             # <<<<<<<<<<<<<<
6478  *
6479  *         cdef int unique_len = len(np.unique(index))
6480  */
6481   __Pyx_INCREF(((PyObject *)__pyx_v_dR));
6482   __Pyx_GIVEREF(((PyObject *)__pyx_v_dR));
6483   __Pyx_GOTREF(__pyx_v_self->dR);
6484   __Pyx_DECREF(((PyObject *)__pyx_v_self->dR));
6485   __pyx_v_self->dR = ((PyArrayObject *)__pyx_v_dR);
6486 
6487   /* "GPy/models/state_space_cython.pyx":109
6488  *         self.dR = dR
6489  *
6490  *         cdef int unique_len = len(np.unique(index))             # <<<<<<<<<<<<<<
6491  *
6492  *         if (unique_len > p_unique_R_number):
6493  */
6494   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error)
6495   __Pyx_GOTREF(__pyx_t_2);
6496   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
6497   __Pyx_GOTREF(__pyx_t_3);
6498   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6499   __pyx_t_2 = NULL;
6500   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6501     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
6502     if (likely(__pyx_t_2)) {
6503       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6504       __Pyx_INCREF(__pyx_t_2);
6505       __Pyx_INCREF(function);
6506       __Pyx_DECREF_SET(__pyx_t_3, function);
6507     }
6508   }
6509   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_index)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_index));
6510   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6511   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
6512   __Pyx_GOTREF(__pyx_t_1);
6513   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6514   __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 109, __pyx_L1_error)
6515   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6516   __pyx_v_unique_len = __pyx_t_4;
6517 
6518   /* "GPy/models/state_space_cython.pyx":111
6519  *         cdef int unique_len = len(np.unique(index))
6520  *
6521  *         if (unique_len > p_unique_R_number):             # <<<<<<<<<<<<<<
6522  *             self.svd_each_time = True
6523  *         else:
6524  */
6525   __pyx_t_5 = ((__pyx_v_unique_len > __pyx_v_p_unique_R_number) != 0);
6526   if (__pyx_t_5) {
6527 
6528     /* "GPy/models/state_space_cython.pyx":112
6529  *
6530  *         if (unique_len > p_unique_R_number):
6531  *             self.svd_each_time = True             # <<<<<<<<<<<<<<
6532  *         else:
6533  *             self.svd_each_time = False
6534  */
6535     __pyx_v_self->svd_each_time = 1;
6536 
6537     /* "GPy/models/state_space_cython.pyx":111
6538  *         cdef int unique_len = len(np.unique(index))
6539  *
6540  *         if (unique_len > p_unique_R_number):             # <<<<<<<<<<<<<<
6541  *             self.svd_each_time = True
6542  *         else:
6543  */
6544     goto __pyx_L3;
6545   }
6546 
6547   /* "GPy/models/state_space_cython.pyx":114
6548  *             self.svd_each_time = True
6549  *         else:
6550  *             self.svd_each_time = False             # <<<<<<<<<<<<<<
6551  *
6552  *         self.R_square_root = {}
6553  */
6554   /*else*/ {
6555     __pyx_v_self->svd_each_time = 0;
6556   }
6557   __pyx_L3:;
6558 
6559   /* "GPy/models/state_space_cython.pyx":116
6560  *             self.svd_each_time = False
6561  *
6562  *         self.R_square_root = {}             # <<<<<<<<<<<<<<
6563  *
6564  *     cpdef Rk(self, int k):
6565  */
6566   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
6567   __Pyx_GOTREF(__pyx_t_1);
6568   __Pyx_GIVEREF(__pyx_t_1);
6569   __Pyx_GOTREF(__pyx_v_self->R_square_root);
6570   __Pyx_DECREF(__pyx_v_self->R_square_root);
6571   __pyx_v_self->R_square_root = ((PyObject*)__pyx_t_1);
6572   __pyx_t_1 = 0;
6573 
6574   /* "GPy/models/state_space_cython.pyx":78
6575  *         dict R_square_root
6576  *
6577  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
6578  *                    int R_time_var_index, int p_unique_R_number, np.ndarray[DTYPE_t, ndim=3] dR = None):
6579  *         """
6580  */
6581 
6582   /* function exit code */
6583   __pyx_r = 0;
6584   goto __pyx_L0;
6585   __pyx_L1_error:;
6586   __Pyx_XDECREF(__pyx_t_1);
6587   __Pyx_XDECREF(__pyx_t_2);
6588   __Pyx_XDECREF(__pyx_t_3);
6589   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6590     __Pyx_PyThreadState_declare
6591     __Pyx_PyThreadState_assign
6592     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6593     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
6594     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
6595     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
6596   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6597   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6598   __pyx_r = -1;
6599   goto __pyx_L2;
6600   __pyx_L0:;
6601   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
6602   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
6603   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
6604   __pyx_L2:;
6605   __Pyx_RefNannyFinishContext();
6606   return __pyx_r;
6607 }
6608 
6609 /* "GPy/models/state_space_cython.pyx":118
6610  *         self.R_square_root = {}
6611  *
6612  *     cpdef Rk(self, int k):             # <<<<<<<<<<<<<<
6613  *         return self.R[:,:, <int>self.index[self.R_time_var_index, k]]
6614  *
6615  */
6616 
6617 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)6618 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
6619   PyObject *__pyx_r = NULL;
6620   __Pyx_RefNannyDeclarations
6621   PyObject *__pyx_t_1 = NULL;
6622   PyObject *__pyx_t_2 = NULL;
6623   PyObject *__pyx_t_3 = NULL;
6624   PyObject *__pyx_t_4 = NULL;
6625   PyObject *__pyx_t_5 = NULL;
6626   int __pyx_t_6;
6627   int __pyx_lineno = 0;
6628   const char *__pyx_filename = NULL;
6629   int __pyx_clineno = 0;
6630   __Pyx_RefNannySetupContext("Rk", 0);
6631   /* Check if called by wrapper */
6632   if (unlikely(__pyx_skip_dispatch)) ;
6633   /* Check if overridden in Python */
6634   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6635     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6636     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6637     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6638       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6639       #endif
6640       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Rk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
6641       __Pyx_GOTREF(__pyx_t_1);
6642       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk)) {
6643         __Pyx_XDECREF(__pyx_r);
6644         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 118, __pyx_L1_error)
6645         __Pyx_GOTREF(__pyx_t_3);
6646         __Pyx_INCREF(__pyx_t_1);
6647         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
6648         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6649           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
6650           if (likely(__pyx_t_5)) {
6651             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6652             __Pyx_INCREF(__pyx_t_5);
6653             __Pyx_INCREF(function);
6654             __Pyx_DECREF_SET(__pyx_t_4, function);
6655           }
6656         }
6657         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
6658         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6659         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6660         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
6661         __Pyx_GOTREF(__pyx_t_2);
6662         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6663         __pyx_r = __pyx_t_2;
6664         __pyx_t_2 = 0;
6665         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6666         goto __pyx_L0;
6667       }
6668       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6669       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6670       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6671       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6672         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6673       }
6674       #endif
6675       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6676       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6677     }
6678     #endif
6679   }
6680 
6681   /* "GPy/models/state_space_cython.pyx":119
6682  *
6683  *     cpdef Rk(self, int k):
6684  *         return self.R[:,:, <int>self.index[self.R_time_var_index, k]]             # <<<<<<<<<<<<<<
6685  *
6686  *
6687  */
6688   __Pyx_XDECREF(__pyx_r);
6689   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->R_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
6690   __Pyx_GOTREF(__pyx_t_1);
6691   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
6692   __Pyx_GOTREF(__pyx_t_2);
6693   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
6694   __Pyx_GOTREF(__pyx_t_4);
6695   __Pyx_GIVEREF(__pyx_t_1);
6696   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6697   __Pyx_GIVEREF(__pyx_t_2);
6698   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
6699   __pyx_t_1 = 0;
6700   __pyx_t_2 = 0;
6701   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
6702   __Pyx_GOTREF(__pyx_t_2);
6703   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6704   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 119, __pyx_L1_error)
6705   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6706   __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
6707   __Pyx_GOTREF(__pyx_t_2);
6708   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 119, __pyx_L1_error)
6709   __Pyx_GOTREF(__pyx_t_4);
6710   __Pyx_INCREF(__pyx_slice__10);
6711   __Pyx_GIVEREF(__pyx_slice__10);
6712   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
6713   __Pyx_INCREF(__pyx_slice__10);
6714   __Pyx_GIVEREF(__pyx_slice__10);
6715   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
6716   __Pyx_GIVEREF(__pyx_t_2);
6717   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
6718   __pyx_t_2 = 0;
6719   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->R), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
6720   __Pyx_GOTREF(__pyx_t_2);
6721   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6722   __pyx_r = __pyx_t_2;
6723   __pyx_t_2 = 0;
6724   goto __pyx_L0;
6725 
6726   /* "GPy/models/state_space_cython.pyx":118
6727  *         self.R_square_root = {}
6728  *
6729  *     cpdef Rk(self, int k):             # <<<<<<<<<<<<<<
6730  *         return self.R[:,:, <int>self.index[self.R_time_var_index, k]]
6731  *
6732  */
6733 
6734   /* function exit code */
6735   __pyx_L1_error:;
6736   __Pyx_XDECREF(__pyx_t_1);
6737   __Pyx_XDECREF(__pyx_t_2);
6738   __Pyx_XDECREF(__pyx_t_3);
6739   __Pyx_XDECREF(__pyx_t_4);
6740   __Pyx_XDECREF(__pyx_t_5);
6741   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6742   __pyx_r = 0;
6743   __pyx_L0:;
6744   __Pyx_XGIVEREF(__pyx_r);
6745   __Pyx_RefNannyFinishContext();
6746   return __pyx_r;
6747 }
6748 
6749 /* Python wrapper */
6750 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)6751 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
6752   int __pyx_v_k;
6753   int __pyx_lineno = 0;
6754   const char *__pyx_filename = NULL;
6755   int __pyx_clineno = 0;
6756   PyObject *__pyx_r = 0;
6757   __Pyx_RefNannyDeclarations
6758   __Pyx_RefNannySetupContext("Rk (wrapper)", 0);
6759   assert(__pyx_arg_k); {
6760     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 118, __pyx_L3_error)
6761   }
6762   goto __pyx_L4_argument_unpacking_done;
6763   __pyx_L3_error:;
6764   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6765   __Pyx_RefNannyFinishContext();
6766   return NULL;
6767   __pyx_L4_argument_unpacking_done:;
6768   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_2Rk(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
6769 
6770   /* function exit code */
6771   __Pyx_RefNannyFinishContext();
6772   return __pyx_r;
6773 }
6774 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_2Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,int __pyx_v_k)6775 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_2Rk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k) {
6776   PyObject *__pyx_r = NULL;
6777   __Pyx_RefNannyDeclarations
6778   PyObject *__pyx_t_1 = NULL;
6779   int __pyx_lineno = 0;
6780   const char *__pyx_filename = NULL;
6781   int __pyx_clineno = 0;
6782   __Pyx_RefNannySetupContext("Rk", 0);
6783   __Pyx_XDECREF(__pyx_r);
6784   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_Rk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
6785   __Pyx_GOTREF(__pyx_t_1);
6786   __pyx_r = __pyx_t_1;
6787   __pyx_t_1 = 0;
6788   goto __pyx_L0;
6789 
6790   /* function exit code */
6791   __pyx_L1_error:;
6792   __Pyx_XDECREF(__pyx_t_1);
6793   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.Rk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6794   __pyx_r = NULL;
6795   __pyx_L0:;
6796   __Pyx_XGIVEREF(__pyx_r);
6797   __Pyx_RefNannyFinishContext();
6798   return __pyx_r;
6799 }
6800 
6801 /* "GPy/models/state_space_cython.pyx":122
6802  *
6803  *
6804  *     cpdef dRk(self,int k):             # <<<<<<<<<<<<<<
6805  *         if self.dR is None:
6806  *             raise ValueError("dR derivative is None")
6807  */
6808 
6809 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)6810 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
6811   PyObject *__pyx_r = NULL;
6812   __Pyx_RefNannyDeclarations
6813   PyObject *__pyx_t_1 = NULL;
6814   PyObject *__pyx_t_2 = NULL;
6815   PyObject *__pyx_t_3 = NULL;
6816   PyObject *__pyx_t_4 = NULL;
6817   PyObject *__pyx_t_5 = NULL;
6818   int __pyx_t_6;
6819   int __pyx_t_7;
6820   int __pyx_lineno = 0;
6821   const char *__pyx_filename = NULL;
6822   int __pyx_clineno = 0;
6823   __Pyx_RefNannySetupContext("dRk", 0);
6824   /* Check if called by wrapper */
6825   if (unlikely(__pyx_skip_dispatch)) ;
6826   /* Check if overridden in Python */
6827   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
6828     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6829     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6830     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
6831       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6832       #endif
6833       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dRk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
6834       __Pyx_GOTREF(__pyx_t_1);
6835       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk)) {
6836         __Pyx_XDECREF(__pyx_r);
6837         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
6838         __Pyx_GOTREF(__pyx_t_3);
6839         __Pyx_INCREF(__pyx_t_1);
6840         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
6841         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6842           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
6843           if (likely(__pyx_t_5)) {
6844             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6845             __Pyx_INCREF(__pyx_t_5);
6846             __Pyx_INCREF(function);
6847             __Pyx_DECREF_SET(__pyx_t_4, function);
6848           }
6849         }
6850         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
6851         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6852         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6853         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
6854         __Pyx_GOTREF(__pyx_t_2);
6855         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6856         __pyx_r = __pyx_t_2;
6857         __pyx_t_2 = 0;
6858         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6859         goto __pyx_L0;
6860       }
6861       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6862       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
6863       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
6864       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
6865         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
6866       }
6867       #endif
6868       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6869       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
6870     }
6871     #endif
6872   }
6873 
6874   /* "GPy/models/state_space_cython.pyx":123
6875  *
6876  *     cpdef dRk(self,int k):
6877  *         if self.dR is None:             # <<<<<<<<<<<<<<
6878  *             raise ValueError("dR derivative is None")
6879  *
6880  */
6881   __pyx_t_6 = (((PyObject *)__pyx_v_self->dR) == Py_None);
6882   __pyx_t_7 = (__pyx_t_6 != 0);
6883   if (unlikely(__pyx_t_7)) {
6884 
6885     /* "GPy/models/state_space_cython.pyx":124
6886  *     cpdef dRk(self,int k):
6887  *         if self.dR is None:
6888  *             raise ValueError("dR derivative is None")             # <<<<<<<<<<<<<<
6889  *
6890  *         return self.dR # the same dirivative on each iteration
6891  */
6892     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
6893     __Pyx_GOTREF(__pyx_t_1);
6894     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6895     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6896     __PYX_ERR(0, 124, __pyx_L1_error)
6897 
6898     /* "GPy/models/state_space_cython.pyx":123
6899  *
6900  *     cpdef dRk(self,int k):
6901  *         if self.dR is None:             # <<<<<<<<<<<<<<
6902  *             raise ValueError("dR derivative is None")
6903  *
6904  */
6905   }
6906 
6907   /* "GPy/models/state_space_cython.pyx":126
6908  *             raise ValueError("dR derivative is None")
6909  *
6910  *         return self.dR # the same dirivative on each iteration             # <<<<<<<<<<<<<<
6911  *
6912  *     cpdef R_isrk(self, int k):
6913  */
6914   __Pyx_XDECREF(__pyx_r);
6915   __Pyx_INCREF(((PyObject *)__pyx_v_self->dR));
6916   __pyx_r = ((PyObject *)__pyx_v_self->dR);
6917   goto __pyx_L0;
6918 
6919   /* "GPy/models/state_space_cython.pyx":122
6920  *
6921  *
6922  *     cpdef dRk(self,int k):             # <<<<<<<<<<<<<<
6923  *         if self.dR is None:
6924  *             raise ValueError("dR derivative is None")
6925  */
6926 
6927   /* function exit code */
6928   __pyx_L1_error:;
6929   __Pyx_XDECREF(__pyx_t_1);
6930   __Pyx_XDECREF(__pyx_t_2);
6931   __Pyx_XDECREF(__pyx_t_3);
6932   __Pyx_XDECREF(__pyx_t_4);
6933   __Pyx_XDECREF(__pyx_t_5);
6934   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6935   __pyx_r = 0;
6936   __pyx_L0:;
6937   __Pyx_XGIVEREF(__pyx_r);
6938   __Pyx_RefNannyFinishContext();
6939   return __pyx_r;
6940 }
6941 
6942 /* Python wrapper */
6943 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)6944 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
6945   int __pyx_v_k;
6946   int __pyx_lineno = 0;
6947   const char *__pyx_filename = NULL;
6948   int __pyx_clineno = 0;
6949   PyObject *__pyx_r = 0;
6950   __Pyx_RefNannyDeclarations
6951   __Pyx_RefNannySetupContext("dRk (wrapper)", 0);
6952   assert(__pyx_arg_k); {
6953     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
6954   }
6955   goto __pyx_L4_argument_unpacking_done;
6956   __pyx_L3_error:;
6957   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6958   __Pyx_RefNannyFinishContext();
6959   return NULL;
6960   __pyx_L4_argument_unpacking_done:;
6961   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_4dRk(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
6962 
6963   /* function exit code */
6964   __Pyx_RefNannyFinishContext();
6965   return __pyx_r;
6966 }
6967 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_4dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,int __pyx_v_k)6968 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_4dRk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k) {
6969   PyObject *__pyx_r = NULL;
6970   __Pyx_RefNannyDeclarations
6971   PyObject *__pyx_t_1 = NULL;
6972   int __pyx_lineno = 0;
6973   const char *__pyx_filename = NULL;
6974   int __pyx_clineno = 0;
6975   __Pyx_RefNannySetupContext("dRk", 0);
6976   __Pyx_XDECREF(__pyx_r);
6977   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_dRk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
6978   __Pyx_GOTREF(__pyx_t_1);
6979   __pyx_r = __pyx_t_1;
6980   __pyx_t_1 = 0;
6981   goto __pyx_L0;
6982 
6983   /* function exit code */
6984   __pyx_L1_error:;
6985   __Pyx_XDECREF(__pyx_t_1);
6986   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.dRk", __pyx_clineno, __pyx_lineno, __pyx_filename);
6987   __pyx_r = NULL;
6988   __pyx_L0:;
6989   __Pyx_XGIVEREF(__pyx_r);
6990   __Pyx_RefNannyFinishContext();
6991   return __pyx_r;
6992 }
6993 
6994 /* "GPy/models/state_space_cython.pyx":128
6995  *         return self.dR # the same dirivative on each iteration
6996  *
6997  *     cpdef R_isrk(self, int k):             # <<<<<<<<<<<<<<
6998  *         """
6999  *         Function returns the inverse square root of R matrix on step k.
7000  */
7001 
7002 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)7003 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
7004   int __pyx_v_ind;
7005   PyArrayObject *__pyx_v_R = 0;
7006   PyArrayObject *__pyx_v_inv_square_root = 0;
7007   PyArrayObject *__pyx_v_U = 0;
7008   PyArrayObject *__pyx_v_S = 0;
7009   CYTHON_UNUSED PyArrayObject *__pyx_v_Vh = 0;
7010   __Pyx_LocalBuf_ND __pyx_pybuffernd_R;
7011   __Pyx_Buffer __pyx_pybuffer_R;
7012   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
7013   __Pyx_Buffer __pyx_pybuffer_S;
7014   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
7015   __Pyx_Buffer __pyx_pybuffer_U;
7016   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
7017   __Pyx_Buffer __pyx_pybuffer_Vh;
7018   __Pyx_LocalBuf_ND __pyx_pybuffernd_inv_square_root;
7019   __Pyx_Buffer __pyx_pybuffer_inv_square_root;
7020   PyObject *__pyx_r = NULL;
7021   __Pyx_RefNannyDeclarations
7022   PyObject *__pyx_t_1 = NULL;
7023   PyObject *__pyx_t_2 = NULL;
7024   PyObject *__pyx_t_3 = NULL;
7025   PyObject *__pyx_t_4 = NULL;
7026   PyObject *__pyx_t_5 = NULL;
7027   int __pyx_t_6;
7028   PyArrayObject *__pyx_t_7 = NULL;
7029   int __pyx_t_8;
7030   PyArrayObject *__pyx_t_9 = NULL;
7031   PyObject *__pyx_t_10 = NULL;
7032   PyObject *__pyx_t_11 = NULL;
7033   PyObject *__pyx_t_12 = NULL;
7034   PyObject *(*__pyx_t_13)(PyObject *);
7035   PyArrayObject *__pyx_t_14 = NULL;
7036   PyArrayObject *__pyx_t_15 = NULL;
7037   PyArrayObject *__pyx_t_16 = NULL;
7038   int __pyx_t_17;
7039   int __pyx_lineno = 0;
7040   const char *__pyx_filename = NULL;
7041   int __pyx_clineno = 0;
7042   __Pyx_RefNannySetupContext("R_isrk", 0);
7043   __pyx_pybuffer_R.pybuffer.buf = NULL;
7044   __pyx_pybuffer_R.refcount = 0;
7045   __pyx_pybuffernd_R.data = NULL;
7046   __pyx_pybuffernd_R.rcbuffer = &__pyx_pybuffer_R;
7047   __pyx_pybuffer_inv_square_root.pybuffer.buf = NULL;
7048   __pyx_pybuffer_inv_square_root.refcount = 0;
7049   __pyx_pybuffernd_inv_square_root.data = NULL;
7050   __pyx_pybuffernd_inv_square_root.rcbuffer = &__pyx_pybuffer_inv_square_root;
7051   __pyx_pybuffer_U.pybuffer.buf = NULL;
7052   __pyx_pybuffer_U.refcount = 0;
7053   __pyx_pybuffernd_U.data = NULL;
7054   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
7055   __pyx_pybuffer_S.pybuffer.buf = NULL;
7056   __pyx_pybuffer_S.refcount = 0;
7057   __pyx_pybuffernd_S.data = NULL;
7058   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
7059   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
7060   __pyx_pybuffer_Vh.refcount = 0;
7061   __pyx_pybuffernd_Vh.data = NULL;
7062   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
7063   /* Check if called by wrapper */
7064   if (unlikely(__pyx_skip_dispatch)) ;
7065   /* Check if overridden in Python */
7066   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
7067     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7068     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7069     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
7070       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7071       #endif
7072       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_R_isrk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
7073       __Pyx_GOTREF(__pyx_t_1);
7074       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk)) {
7075         __Pyx_XDECREF(__pyx_r);
7076         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
7077         __Pyx_GOTREF(__pyx_t_3);
7078         __Pyx_INCREF(__pyx_t_1);
7079         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
7080         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7081           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
7082           if (likely(__pyx_t_5)) {
7083             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7084             __Pyx_INCREF(__pyx_t_5);
7085             __Pyx_INCREF(function);
7086             __Pyx_DECREF_SET(__pyx_t_4, function);
7087           }
7088         }
7089         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
7090         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7091         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7092         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error)
7093         __Pyx_GOTREF(__pyx_t_2);
7094         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7095         __pyx_r = __pyx_t_2;
7096         __pyx_t_2 = 0;
7097         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7098         goto __pyx_L0;
7099       }
7100       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7101       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7102       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
7103       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
7104         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7105       }
7106       #endif
7107       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7108       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7109     }
7110     #endif
7111   }
7112 
7113   /* "GPy/models/state_space_cython.pyx":132
7114  *         Function returns the inverse square root of R matrix on step k.
7115  *         """
7116  *         cdef int ind = <int>self.index[self.R_time_var_index, k]             # <<<<<<<<<<<<<<
7117  *         cdef np.ndarray[DTYPE_t, ndim=2] R = self.R[:,:, ind ]
7118  *
7119  */
7120   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->R_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
7121   __Pyx_GOTREF(__pyx_t_1);
7122   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
7123   __Pyx_GOTREF(__pyx_t_2);
7124   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
7125   __Pyx_GOTREF(__pyx_t_4);
7126   __Pyx_GIVEREF(__pyx_t_1);
7127   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
7128   __Pyx_GIVEREF(__pyx_t_2);
7129   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
7130   __pyx_t_1 = 0;
7131   __pyx_t_2 = 0;
7132   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
7133   __Pyx_GOTREF(__pyx_t_2);
7134   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7135   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
7136   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7137   __pyx_v_ind = ((int)__pyx_t_6);
7138 
7139   /* "GPy/models/state_space_cython.pyx":133
7140  *         """
7141  *         cdef int ind = <int>self.index[self.R_time_var_index, k]
7142  *         cdef np.ndarray[DTYPE_t, ndim=2] R = self.R[:,:, ind ]             # <<<<<<<<<<<<<<
7143  *
7144  *         cdef np.ndarray[DTYPE_t, ndim=2] inv_square_root
7145  */
7146   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
7147   __Pyx_GOTREF(__pyx_t_2);
7148   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
7149   __Pyx_GOTREF(__pyx_t_4);
7150   __Pyx_INCREF(__pyx_slice__10);
7151   __Pyx_GIVEREF(__pyx_slice__10);
7152   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
7153   __Pyx_INCREF(__pyx_slice__10);
7154   __Pyx_GIVEREF(__pyx_slice__10);
7155   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
7156   __Pyx_GIVEREF(__pyx_t_2);
7157   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
7158   __pyx_t_2 = 0;
7159   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->R), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
7160   __Pyx_GOTREF(__pyx_t_2);
7161   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7162   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 133, __pyx_L1_error)
7163   __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
7164   {
7165     __Pyx_BufFmt_StackElem __pyx_stack[1];
7166     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7167       __pyx_v_R = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_R.rcbuffer->pybuffer.buf = NULL;
7168       __PYX_ERR(0, 133, __pyx_L1_error)
7169     } else {__pyx_pybuffernd_R.diminfo[0].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R.diminfo[0].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R.diminfo[1].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R.diminfo[1].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[1];
7170     }
7171   }
7172   __pyx_t_7 = 0;
7173   __pyx_v_R = ((PyArrayObject *)__pyx_t_2);
7174   __pyx_t_2 = 0;
7175 
7176   /* "GPy/models/state_space_cython.pyx":141
7177  *         cdef np.ndarray[DTYPE_t, ndim=2] Vh
7178  *
7179  *         if (R.shape[0] == 1): # 1-D case handle simplier. No storage             # <<<<<<<<<<<<<<
7180  *         # of the result, just compute it each time.
7181  *             inv_square_root = np.sqrt( 1.0/R )
7182  */
7183   __pyx_t_8 = (((__pyx_v_R->dimensions[0]) == 1) != 0);
7184   if (__pyx_t_8) {
7185 
7186     /* "GPy/models/state_space_cython.pyx":143
7187  *         if (R.shape[0] == 1): # 1-D case handle simplier. No storage
7188  *         # of the result, just compute it each time.
7189  *             inv_square_root = np.sqrt( 1.0/R )             # <<<<<<<<<<<<<<
7190  *         else:
7191  *             if self.svd_each_time:
7192  */
7193     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
7194     __Pyx_GOTREF(__pyx_t_4);
7195     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
7196     __Pyx_GOTREF(__pyx_t_1);
7197     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7198     __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_float_1_0, ((PyObject *)__pyx_v_R)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
7199     __Pyx_GOTREF(__pyx_t_4);
7200     __pyx_t_3 = NULL;
7201     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
7202       __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
7203       if (likely(__pyx_t_3)) {
7204         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7205         __Pyx_INCREF(__pyx_t_3);
7206         __Pyx_INCREF(function);
7207         __Pyx_DECREF_SET(__pyx_t_1, function);
7208       }
7209     }
7210     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
7211     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7212     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7213     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
7214     __Pyx_GOTREF(__pyx_t_2);
7215     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7216     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 143, __pyx_L1_error)
7217     __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
7218     {
7219       __Pyx_BufFmt_StackElem __pyx_stack[1];
7220       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7221       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7222       if (unlikely(__pyx_t_6 < 0)) {
7223         PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7224         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_inv_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7225           Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
7226           __Pyx_RaiseBufferFallbackError();
7227         } else {
7228           PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7229         }
7230         __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
7231       }
7232       __pyx_pybuffernd_inv_square_root.diminfo[0].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inv_square_root.diminfo[0].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inv_square_root.diminfo[1].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inv_square_root.diminfo[1].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[1];
7233       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
7234     }
7235     __pyx_t_9 = 0;
7236     __pyx_v_inv_square_root = ((PyArrayObject *)__pyx_t_2);
7237     __pyx_t_2 = 0;
7238 
7239     /* "GPy/models/state_space_cython.pyx":141
7240  *         cdef np.ndarray[DTYPE_t, ndim=2] Vh
7241  *
7242  *         if (R.shape[0] == 1): # 1-D case handle simplier. No storage             # <<<<<<<<<<<<<<
7243  *         # of the result, just compute it each time.
7244  *             inv_square_root = np.sqrt( 1.0/R )
7245  */
7246     goto __pyx_L3;
7247   }
7248 
7249   /* "GPy/models/state_space_cython.pyx":145
7250  *             inv_square_root = np.sqrt( 1.0/R )
7251  *         else:
7252  *             if self.svd_each_time:             # <<<<<<<<<<<<<<
7253  *
7254  *                 U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,
7255  */
7256   /*else*/ {
7257     __pyx_t_8 = (__pyx_v_self->svd_each_time != 0);
7258     if (__pyx_t_8) {
7259 
7260       /* "GPy/models/state_space_cython.pyx":147
7261  *             if self.svd_each_time:
7262  *
7263  *                 U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
7264  *                           overwrite_a=False,check_finite=True)
7265  *
7266  */
7267       __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
7268       __Pyx_GOTREF(__pyx_t_2);
7269       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linalg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
7270       __Pyx_GOTREF(__pyx_t_1);
7271       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7272       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_svd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
7273       __Pyx_GOTREF(__pyx_t_2);
7274       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7275       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
7276       __Pyx_GOTREF(__pyx_t_1);
7277       __Pyx_INCREF(((PyObject *)__pyx_v_R));
7278       __Pyx_GIVEREF(((PyObject *)__pyx_v_R));
7279       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_R));
7280       __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
7281       __Pyx_GOTREF(__pyx_t_4);
7282       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7283       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7284 
7285       /* "GPy/models/state_space_cython.pyx":148
7286  *
7287  *                 U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,
7288  *                           overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
7289  *
7290  *                 inv_square_root = U * 1.0/np.sqrt(S)
7291  */
7292       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7293       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7294 
7295       /* "GPy/models/state_space_cython.pyx":147
7296  *             if self.svd_each_time:
7297  *
7298  *                 U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
7299  *                           overwrite_a=False,check_finite=True)
7300  *
7301  */
7302       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
7303       __Pyx_GOTREF(__pyx_t_3);
7304       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7305       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7306       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7307       if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
7308         PyObject* sequence = __pyx_t_3;
7309         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7310         if (unlikely(size != 3)) {
7311           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
7312           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7313           __PYX_ERR(0, 147, __pyx_L1_error)
7314         }
7315         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7316         if (likely(PyTuple_CheckExact(sequence))) {
7317           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
7318           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
7319           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
7320         } else {
7321           __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
7322           __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
7323           __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
7324         }
7325         __Pyx_INCREF(__pyx_t_4);
7326         __Pyx_INCREF(__pyx_t_1);
7327         __Pyx_INCREF(__pyx_t_2);
7328         #else
7329         __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
7330         __Pyx_GOTREF(__pyx_t_4);
7331         __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
7332         __Pyx_GOTREF(__pyx_t_1);
7333         __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
7334         __Pyx_GOTREF(__pyx_t_2);
7335         #endif
7336         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7337       } else {
7338         Py_ssize_t index = -1;
7339         __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
7340         __Pyx_GOTREF(__pyx_t_5);
7341         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7342         __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
7343         index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
7344         __Pyx_GOTREF(__pyx_t_4);
7345         index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
7346         __Pyx_GOTREF(__pyx_t_1);
7347         index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
7348         __Pyx_GOTREF(__pyx_t_2);
7349         if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
7350         __pyx_t_13 = NULL;
7351         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7352         goto __pyx_L6_unpacking_done;
7353         __pyx_L5_unpacking_failed:;
7354         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7355         __pyx_t_13 = NULL;
7356         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7357         __PYX_ERR(0, 147, __pyx_L1_error)
7358         __pyx_L6_unpacking_done:;
7359       }
7360       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 147, __pyx_L1_error)
7361       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 147, __pyx_L1_error)
7362       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 147, __pyx_L1_error)
7363       __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
7364       {
7365         __Pyx_BufFmt_StackElem __pyx_stack[1];
7366         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
7367         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7368         if (unlikely(__pyx_t_6 < 0)) {
7369           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7370           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7371             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
7372             __Pyx_RaiseBufferFallbackError();
7373           } else {
7374             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7375           }
7376           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
7377         }
7378         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
7379         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
7380       }
7381       __pyx_t_14 = 0;
7382       __pyx_v_U = ((PyArrayObject *)__pyx_t_4);
7383       __pyx_t_4 = 0;
7384       __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
7385       {
7386         __Pyx_BufFmt_StackElem __pyx_stack[1];
7387         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
7388         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7389         if (unlikely(__pyx_t_6 < 0)) {
7390           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7391           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7392             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
7393             __Pyx_RaiseBufferFallbackError();
7394           } else {
7395             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7396           }
7397           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
7398         }
7399         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
7400         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
7401       }
7402       __pyx_t_15 = 0;
7403       __pyx_v_S = ((PyArrayObject *)__pyx_t_1);
7404       __pyx_t_1 = 0;
7405       __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
7406       {
7407         __Pyx_BufFmt_StackElem __pyx_stack[1];
7408         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
7409         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7410         if (unlikely(__pyx_t_6 < 0)) {
7411           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7412           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7413             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
7414             __Pyx_RaiseBufferFallbackError();
7415           } else {
7416             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7417           }
7418           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
7419         }
7420         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
7421         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
7422       }
7423       __pyx_t_16 = 0;
7424       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_2);
7425       __pyx_t_2 = 0;
7426 
7427       /* "GPy/models/state_space_cython.pyx":150
7428  *                           overwrite_a=False,check_finite=True)
7429  *
7430  *                 inv_square_root = U * 1.0/np.sqrt(S)             # <<<<<<<<<<<<<<
7431  *             else:
7432  *                 if ind in self.R_square_root:
7433  */
7434       __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_U), __pyx_float_1_0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
7435       __Pyx_GOTREF(__pyx_t_3);
7436       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
7437       __Pyx_GOTREF(__pyx_t_1);
7438       __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
7439       __Pyx_GOTREF(__pyx_t_4);
7440       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7441       __pyx_t_1 = NULL;
7442       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
7443         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
7444         if (likely(__pyx_t_1)) {
7445           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
7446           __Pyx_INCREF(__pyx_t_1);
7447           __Pyx_INCREF(function);
7448           __Pyx_DECREF_SET(__pyx_t_4, function);
7449         }
7450       }
7451       __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_S));
7452       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7453       if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
7454       __Pyx_GOTREF(__pyx_t_2);
7455       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7456       __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
7457       __Pyx_GOTREF(__pyx_t_4);
7458       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7459       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7460       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 150, __pyx_L1_error)
7461       __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
7462       {
7463         __Pyx_BufFmt_StackElem __pyx_stack[1];
7464         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7465         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7466         if (unlikely(__pyx_t_6 < 0)) {
7467           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7468           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_inv_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7469             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
7470             __Pyx_RaiseBufferFallbackError();
7471           } else {
7472             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7473           }
7474           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
7475         }
7476         __pyx_pybuffernd_inv_square_root.diminfo[0].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inv_square_root.diminfo[0].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inv_square_root.diminfo[1].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inv_square_root.diminfo[1].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[1];
7477         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
7478       }
7479       __pyx_t_9 = 0;
7480       __pyx_v_inv_square_root = ((PyArrayObject *)__pyx_t_4);
7481       __pyx_t_4 = 0;
7482 
7483       /* "GPy/models/state_space_cython.pyx":145
7484  *             inv_square_root = np.sqrt( 1.0/R )
7485  *         else:
7486  *             if self.svd_each_time:             # <<<<<<<<<<<<<<
7487  *
7488  *                 U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,
7489  */
7490       goto __pyx_L4;
7491     }
7492 
7493     /* "GPy/models/state_space_cython.pyx":152
7494  *                 inv_square_root = U * 1.0/np.sqrt(S)
7495  *             else:
7496  *                 if ind in self.R_square_root:             # <<<<<<<<<<<<<<
7497  *                     inv_square_root = self.R_square_root[ind]
7498  *                 else:
7499  */
7500     /*else*/ {
7501       __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
7502       __Pyx_GOTREF(__pyx_t_4);
7503       if (unlikely(__pyx_v_self->R_square_root == Py_None)) {
7504         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
7505         __PYX_ERR(0, 152, __pyx_L1_error)
7506       }
7507       __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_t_4, __pyx_v_self->R_square_root, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
7508       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7509       __pyx_t_17 = (__pyx_t_8 != 0);
7510       if (__pyx_t_17) {
7511 
7512         /* "GPy/models/state_space_cython.pyx":153
7513  *             else:
7514  *                 if ind in self.R_square_root:
7515  *                     inv_square_root = self.R_square_root[ind]             # <<<<<<<<<<<<<<
7516  *                 else:
7517  *                     U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,
7518  */
7519         if (unlikely(__pyx_v_self->R_square_root == Py_None)) {
7520           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7521           __PYX_ERR(0, 153, __pyx_L1_error)
7522         }
7523         __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
7524         __Pyx_GOTREF(__pyx_t_4);
7525         __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_self->R_square_root, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
7526         __Pyx_GOTREF(__pyx_t_2);
7527         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7528         if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 153, __pyx_L1_error)
7529         __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
7530         {
7531           __Pyx_BufFmt_StackElem __pyx_stack[1];
7532           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7533           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7534           if (unlikely(__pyx_t_6 < 0)) {
7535             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7536             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_inv_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7537               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
7538               __Pyx_RaiseBufferFallbackError();
7539             } else {
7540               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7541             }
7542             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
7543           }
7544           __pyx_pybuffernd_inv_square_root.diminfo[0].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inv_square_root.diminfo[0].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inv_square_root.diminfo[1].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inv_square_root.diminfo[1].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[1];
7545           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 153, __pyx_L1_error)
7546         }
7547         __pyx_t_9 = 0;
7548         __pyx_v_inv_square_root = ((PyArrayObject *)__pyx_t_2);
7549         __pyx_t_2 = 0;
7550 
7551         /* "GPy/models/state_space_cython.pyx":152
7552  *                 inv_square_root = U * 1.0/np.sqrt(S)
7553  *             else:
7554  *                 if ind in self.R_square_root:             # <<<<<<<<<<<<<<
7555  *                     inv_square_root = self.R_square_root[ind]
7556  *                 else:
7557  */
7558         goto __pyx_L7;
7559       }
7560 
7561       /* "GPy/models/state_space_cython.pyx":155
7562  *                     inv_square_root = self.R_square_root[ind]
7563  *                 else:
7564  *                     U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
7565  *                               overwrite_a=False,check_finite=True)
7566  *
7567  */
7568       /*else*/ {
7569         __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
7570         __Pyx_GOTREF(__pyx_t_2);
7571         __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linalg); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7572         __Pyx_GOTREF(__pyx_t_4);
7573         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7574         __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_svd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
7575         __Pyx_GOTREF(__pyx_t_2);
7576         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7577         __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7578         __Pyx_GOTREF(__pyx_t_4);
7579         __Pyx_INCREF(((PyObject *)__pyx_v_R));
7580         __Pyx_GIVEREF(((PyObject *)__pyx_v_R));
7581         PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_R));
7582         __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
7583         __Pyx_GOTREF(__pyx_t_3);
7584         if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7585         if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7586 
7587         /* "GPy/models/state_space_cython.pyx":156
7588  *                 else:
7589  *                     U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,
7590  *                               overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
7591  *
7592  *                     inv_square_root = U * 1.0/np.sqrt(S)
7593  */
7594         if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7595         if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7596 
7597         /* "GPy/models/state_space_cython.pyx":155
7598  *                     inv_square_root = self.R_square_root[ind]
7599  *                 else:
7600  *                     U,S,Vh = sp.linalg.svd( R,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
7601  *                               overwrite_a=False,check_finite=True)
7602  *
7603  */
7604         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
7605         __Pyx_GOTREF(__pyx_t_1);
7606         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7607         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7608         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7609         if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
7610           PyObject* sequence = __pyx_t_1;
7611           Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
7612           if (unlikely(size != 3)) {
7613             if (size > 3) __Pyx_RaiseTooManyValuesError(3);
7614             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
7615             __PYX_ERR(0, 155, __pyx_L1_error)
7616           }
7617           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7618           if (likely(PyTuple_CheckExact(sequence))) {
7619             __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
7620             __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
7621             __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
7622           } else {
7623             __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
7624             __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
7625             __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
7626           }
7627           __Pyx_INCREF(__pyx_t_3);
7628           __Pyx_INCREF(__pyx_t_4);
7629           __Pyx_INCREF(__pyx_t_2);
7630           #else
7631           __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
7632           __Pyx_GOTREF(__pyx_t_3);
7633           __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 155, __pyx_L1_error)
7634           __Pyx_GOTREF(__pyx_t_4);
7635           __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 155, __pyx_L1_error)
7636           __Pyx_GOTREF(__pyx_t_2);
7637           #endif
7638           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7639         } else {
7640           Py_ssize_t index = -1;
7641           __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 155, __pyx_L1_error)
7642           __Pyx_GOTREF(__pyx_t_5);
7643           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7644           __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
7645           index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
7646           __Pyx_GOTREF(__pyx_t_3);
7647           index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L8_unpacking_failed;
7648           __Pyx_GOTREF(__pyx_t_4);
7649           index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
7650           __Pyx_GOTREF(__pyx_t_2);
7651           if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
7652           __pyx_t_13 = NULL;
7653           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7654           goto __pyx_L9_unpacking_done;
7655           __pyx_L8_unpacking_failed:;
7656           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7657           __pyx_t_13 = NULL;
7658           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
7659           __PYX_ERR(0, 155, __pyx_L1_error)
7660           __pyx_L9_unpacking_done:;
7661         }
7662         if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 155, __pyx_L1_error)
7663         if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 155, __pyx_L1_error)
7664         if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 155, __pyx_L1_error)
7665         __pyx_t_14 = ((PyArrayObject *)__pyx_t_3);
7666         {
7667           __Pyx_BufFmt_StackElem __pyx_stack[1];
7668           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
7669           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7670           if (unlikely(__pyx_t_6 < 0)) {
7671             PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7672             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7673               Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
7674               __Pyx_RaiseBufferFallbackError();
7675             } else {
7676               PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7677             }
7678             __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
7679           }
7680           __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
7681           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 155, __pyx_L1_error)
7682         }
7683         __pyx_t_14 = 0;
7684         __pyx_v_U = ((PyArrayObject *)__pyx_t_3);
7685         __pyx_t_3 = 0;
7686         __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
7687         {
7688           __Pyx_BufFmt_StackElem __pyx_stack[1];
7689           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
7690           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
7691           if (unlikely(__pyx_t_6 < 0)) {
7692             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7693             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
7694               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
7695               __Pyx_RaiseBufferFallbackError();
7696             } else {
7697               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7698             }
7699             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
7700           }
7701           __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
7702           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 155, __pyx_L1_error)
7703         }
7704         __pyx_t_15 = 0;
7705         __pyx_v_S = ((PyArrayObject *)__pyx_t_4);
7706         __pyx_t_4 = 0;
7707         __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
7708         {
7709           __Pyx_BufFmt_StackElem __pyx_stack[1];
7710           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
7711           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7712           if (unlikely(__pyx_t_6 < 0)) {
7713             PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7714             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7715               Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
7716               __Pyx_RaiseBufferFallbackError();
7717             } else {
7718               PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7719             }
7720             __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
7721           }
7722           __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
7723           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 155, __pyx_L1_error)
7724         }
7725         __pyx_t_16 = 0;
7726         __pyx_v_Vh = ((PyArrayObject *)__pyx_t_2);
7727         __pyx_t_2 = 0;
7728 
7729         /* "GPy/models/state_space_cython.pyx":158
7730  *                               overwrite_a=False,check_finite=True)
7731  *
7732  *                     inv_square_root = U * 1.0/np.sqrt(S)             # <<<<<<<<<<<<<<
7733  *
7734  *                     self.R_square_root[ind] = inv_square_root
7735  */
7736         __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_U), __pyx_float_1_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
7737         __Pyx_GOTREF(__pyx_t_1);
7738         __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
7739         __Pyx_GOTREF(__pyx_t_4);
7740         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
7741         __Pyx_GOTREF(__pyx_t_3);
7742         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7743         __pyx_t_4 = NULL;
7744         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7745           __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7746           if (likely(__pyx_t_4)) {
7747             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7748             __Pyx_INCREF(__pyx_t_4);
7749             __Pyx_INCREF(function);
7750             __Pyx_DECREF_SET(__pyx_t_3, function);
7751           }
7752         }
7753         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_S));
7754         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7755         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
7756         __Pyx_GOTREF(__pyx_t_2);
7757         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7758         __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
7759         __Pyx_GOTREF(__pyx_t_3);
7760         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7761         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7762         if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 158, __pyx_L1_error)
7763         __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
7764         {
7765           __Pyx_BufFmt_StackElem __pyx_stack[1];
7766           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7767           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
7768           if (unlikely(__pyx_t_6 < 0)) {
7769             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
7770             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_inv_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
7771               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
7772               __Pyx_RaiseBufferFallbackError();
7773             } else {
7774               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
7775             }
7776             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
7777           }
7778           __pyx_pybuffernd_inv_square_root.diminfo[0].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_inv_square_root.diminfo[0].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_inv_square_root.diminfo[1].strides = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_inv_square_root.diminfo[1].shape = __pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer.shape[1];
7779           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
7780         }
7781         __pyx_t_9 = 0;
7782         __pyx_v_inv_square_root = ((PyArrayObject *)__pyx_t_3);
7783         __pyx_t_3 = 0;
7784 
7785         /* "GPy/models/state_space_cython.pyx":160
7786  *                     inv_square_root = U * 1.0/np.sqrt(S)
7787  *
7788  *                     self.R_square_root[ind] = inv_square_root             # <<<<<<<<<<<<<<
7789  *
7790  *         return inv_square_root
7791  */
7792         if (unlikely(__pyx_v_self->R_square_root == Py_None)) {
7793           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
7794           __PYX_ERR(0, 160, __pyx_L1_error)
7795         }
7796         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
7797         __Pyx_GOTREF(__pyx_t_3);
7798         if (unlikely(PyDict_SetItem(__pyx_v_self->R_square_root, __pyx_t_3, ((PyObject *)__pyx_v_inv_square_root)) < 0)) __PYX_ERR(0, 160, __pyx_L1_error)
7799         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7800       }
7801       __pyx_L7:;
7802     }
7803     __pyx_L4:;
7804   }
7805   __pyx_L3:;
7806 
7807   /* "GPy/models/state_space_cython.pyx":162
7808  *                     self.R_square_root[ind] = inv_square_root
7809  *
7810  *         return inv_square_root             # <<<<<<<<<<<<<<
7811  *
7812  *
7813  */
7814   __Pyx_XDECREF(__pyx_r);
7815   __Pyx_INCREF(((PyObject *)__pyx_v_inv_square_root));
7816   __pyx_r = ((PyObject *)__pyx_v_inv_square_root);
7817   goto __pyx_L0;
7818 
7819   /* "GPy/models/state_space_cython.pyx":128
7820  *         return self.dR # the same dirivative on each iteration
7821  *
7822  *     cpdef R_isrk(self, int k):             # <<<<<<<<<<<<<<
7823  *         """
7824  *         Function returns the inverse square root of R matrix on step k.
7825  */
7826 
7827   /* function exit code */
7828   __pyx_L1_error:;
7829   __Pyx_XDECREF(__pyx_t_1);
7830   __Pyx_XDECREF(__pyx_t_2);
7831   __Pyx_XDECREF(__pyx_t_3);
7832   __Pyx_XDECREF(__pyx_t_4);
7833   __Pyx_XDECREF(__pyx_t_5);
7834   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7835     __Pyx_PyThreadState_declare
7836     __Pyx_PyThreadState_assign
7837     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7838     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
7839     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
7840     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
7841     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
7842     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7843   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7844   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
7845   __pyx_r = 0;
7846   goto __pyx_L2;
7847   __pyx_L0:;
7848   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
7849   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
7850   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
7851   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
7852   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_inv_square_root.rcbuffer->pybuffer);
7853   __pyx_L2:;
7854   __Pyx_XDECREF((PyObject *)__pyx_v_R);
7855   __Pyx_XDECREF((PyObject *)__pyx_v_inv_square_root);
7856   __Pyx_XDECREF((PyObject *)__pyx_v_U);
7857   __Pyx_XDECREF((PyObject *)__pyx_v_S);
7858   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
7859   __Pyx_XGIVEREF(__pyx_r);
7860   __Pyx_RefNannyFinishContext();
7861   return __pyx_r;
7862 }
7863 
7864 /* Python wrapper */
7865 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
7866 static char __pyx_doc_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk[] = "\n        Function returns the inverse square root of R matrix on step k.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)7867 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
7868   int __pyx_v_k;
7869   int __pyx_lineno = 0;
7870   const char *__pyx_filename = NULL;
7871   int __pyx_clineno = 0;
7872   PyObject *__pyx_r = 0;
7873   __Pyx_RefNannyDeclarations
7874   __Pyx_RefNannySetupContext("R_isrk (wrapper)", 0);
7875   assert(__pyx_arg_k); {
7876     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 128, __pyx_L3_error)
7877   }
7878   goto __pyx_L4_argument_unpacking_done;
7879   __pyx_L3_error:;
7880   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
7881   __Pyx_RefNannyFinishContext();
7882   return NULL;
7883   __pyx_L4_argument_unpacking_done:;
7884   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
7885 
7886   /* function exit code */
7887   __Pyx_RefNannyFinishContext();
7888   return __pyx_r;
7889 }
7890 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,int __pyx_v_k)7891 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, int __pyx_v_k) {
7892   PyObject *__pyx_r = NULL;
7893   __Pyx_RefNannyDeclarations
7894   PyObject *__pyx_t_1 = NULL;
7895   int __pyx_lineno = 0;
7896   const char *__pyx_filename = NULL;
7897   int __pyx_clineno = 0;
7898   __Pyx_RefNannySetupContext("R_isrk", 0);
7899   __Pyx_XDECREF(__pyx_r);
7900   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_R_isrk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error)
7901   __Pyx_GOTREF(__pyx_t_1);
7902   __pyx_r = __pyx_t_1;
7903   __pyx_t_1 = 0;
7904   goto __pyx_L0;
7905 
7906   /* function exit code */
7907   __pyx_L1_error:;
7908   __Pyx_XDECREF(__pyx_t_1);
7909   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.R_isrk", __pyx_clineno, __pyx_lineno, __pyx_filename);
7910   __pyx_r = NULL;
7911   __pyx_L0:;
7912   __Pyx_XGIVEREF(__pyx_r);
7913   __Pyx_RefNannyFinishContext();
7914   return __pyx_r;
7915 }
7916 
7917 /* "(tree fragment)":1
7918  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
7919  *     cdef tuple state
7920  *     cdef object _dict
7921  */
7922 
7923 /* Python wrapper */
7924 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7925 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7926   PyObject *__pyx_r = 0;
7927   __Pyx_RefNannyDeclarations
7928   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
7929   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_8__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self));
7930 
7931   /* function exit code */
7932   __Pyx_RefNannyFinishContext();
7933   return __pyx_r;
7934 }
7935 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self)7936 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self) {
7937   PyObject *__pyx_v_state = 0;
7938   PyObject *__pyx_v__dict = 0;
7939   int __pyx_v_use_setstate;
7940   PyObject *__pyx_r = NULL;
7941   __Pyx_RefNannyDeclarations
7942   PyObject *__pyx_t_1 = NULL;
7943   PyObject *__pyx_t_2 = NULL;
7944   PyObject *__pyx_t_3 = NULL;
7945   int __pyx_t_4;
7946   int __pyx_t_5;
7947   int __pyx_t_6;
7948   int __pyx_lineno = 0;
7949   const char *__pyx_filename = NULL;
7950   int __pyx_clineno = 0;
7951   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
7952 
7953   /* "(tree fragment)":5
7954  *     cdef object _dict
7955  *     cdef bint use_setstate
7956  *     state = (self.R, self.R_square_root, self.R_time_var_index, self.dR, self.index, self.svd_each_time)             # <<<<<<<<<<<<<<
7957  *     _dict = getattr(self, '__dict__', None)
7958  *     if _dict is not None:
7959  */
7960   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->R_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
7961   __Pyx_GOTREF(__pyx_t_1);
7962   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->svd_each_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
7963   __Pyx_GOTREF(__pyx_t_2);
7964   __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
7965   __Pyx_GOTREF(__pyx_t_3);
7966   __Pyx_INCREF(((PyObject *)__pyx_v_self->R));
7967   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->R));
7968   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->R));
7969   __Pyx_INCREF(__pyx_v_self->R_square_root);
7970   __Pyx_GIVEREF(__pyx_v_self->R_square_root);
7971   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->R_square_root);
7972   __Pyx_GIVEREF(__pyx_t_1);
7973   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
7974   __Pyx_INCREF(((PyObject *)__pyx_v_self->dR));
7975   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dR));
7976   PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_self->dR));
7977   __Pyx_INCREF(((PyObject *)__pyx_v_self->index));
7978   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->index));
7979   PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_self->index));
7980   __Pyx_GIVEREF(__pyx_t_2);
7981   PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
7982   __pyx_t_1 = 0;
7983   __pyx_t_2 = 0;
7984   __pyx_v_state = ((PyObject*)__pyx_t_3);
7985   __pyx_t_3 = 0;
7986 
7987   /* "(tree fragment)":6
7988  *     cdef bint use_setstate
7989  *     state = (self.R, self.R_square_root, self.R_time_var_index, self.dR, self.index, self.svd_each_time)
7990  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
7991  *     if _dict is not None:
7992  *         state += (_dict,)
7993  */
7994   __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
7995   __Pyx_GOTREF(__pyx_t_3);
7996   __pyx_v__dict = __pyx_t_3;
7997   __pyx_t_3 = 0;
7998 
7999   /* "(tree fragment)":7
8000  *     state = (self.R, self.R_square_root, self.R_time_var_index, self.dR, self.index, self.svd_each_time)
8001  *     _dict = getattr(self, '__dict__', None)
8002  *     if _dict is not None:             # <<<<<<<<<<<<<<
8003  *         state += (_dict,)
8004  *         use_setstate = True
8005  */
8006   __pyx_t_4 = (__pyx_v__dict != Py_None);
8007   __pyx_t_5 = (__pyx_t_4 != 0);
8008   if (__pyx_t_5) {
8009 
8010     /* "(tree fragment)":8
8011  *     _dict = getattr(self, '__dict__', None)
8012  *     if _dict is not None:
8013  *         state += (_dict,)             # <<<<<<<<<<<<<<
8014  *         use_setstate = True
8015  *     else:
8016  */
8017     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
8018     __Pyx_GOTREF(__pyx_t_3);
8019     __Pyx_INCREF(__pyx_v__dict);
8020     __Pyx_GIVEREF(__pyx_v__dict);
8021     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
8022     __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
8023     __Pyx_GOTREF(__pyx_t_2);
8024     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8025     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
8026     __pyx_t_2 = 0;
8027 
8028     /* "(tree fragment)":9
8029  *     if _dict is not None:
8030  *         state += (_dict,)
8031  *         use_setstate = True             # <<<<<<<<<<<<<<
8032  *     else:
8033  *         use_setstate = self.R is not None or self.R_square_root is not None or self.dR is not None or self.index is not None
8034  */
8035     __pyx_v_use_setstate = 1;
8036 
8037     /* "(tree fragment)":7
8038  *     state = (self.R, self.R_square_root, self.R_time_var_index, self.dR, self.index, self.svd_each_time)
8039  *     _dict = getattr(self, '__dict__', None)
8040  *     if _dict is not None:             # <<<<<<<<<<<<<<
8041  *         state += (_dict,)
8042  *         use_setstate = True
8043  */
8044     goto __pyx_L3;
8045   }
8046 
8047   /* "(tree fragment)":11
8048  *         use_setstate = True
8049  *     else:
8050  *         use_setstate = self.R is not None or self.R_square_root is not None or self.dR is not None or self.index is not None             # <<<<<<<<<<<<<<
8051  *     if use_setstate:
8052  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, None), state
8053  */
8054   /*else*/ {
8055     __pyx_t_4 = (((PyObject *)__pyx_v_self->R) != Py_None);
8056     __pyx_t_6 = (__pyx_t_4 != 0);
8057     if (!__pyx_t_6) {
8058     } else {
8059       __pyx_t_5 = __pyx_t_6;
8060       goto __pyx_L4_bool_binop_done;
8061     }
8062     __pyx_t_6 = (__pyx_v_self->R_square_root != ((PyObject*)Py_None));
8063     __pyx_t_4 = (__pyx_t_6 != 0);
8064     if (!__pyx_t_4) {
8065     } else {
8066       __pyx_t_5 = __pyx_t_4;
8067       goto __pyx_L4_bool_binop_done;
8068     }
8069     __pyx_t_4 = (((PyObject *)__pyx_v_self->dR) != Py_None);
8070     __pyx_t_6 = (__pyx_t_4 != 0);
8071     if (!__pyx_t_6) {
8072     } else {
8073       __pyx_t_5 = __pyx_t_6;
8074       goto __pyx_L4_bool_binop_done;
8075     }
8076     __pyx_t_6 = (((PyObject *)__pyx_v_self->index) != Py_None);
8077     __pyx_t_4 = (__pyx_t_6 != 0);
8078     __pyx_t_5 = __pyx_t_4;
8079     __pyx_L4_bool_binop_done:;
8080     __pyx_v_use_setstate = __pyx_t_5;
8081   }
8082   __pyx_L3:;
8083 
8084   /* "(tree fragment)":12
8085  *     else:
8086  *         use_setstate = self.R is not None or self.R_square_root is not None or self.dR is not None or self.index is not None
8087  *     if use_setstate:             # <<<<<<<<<<<<<<
8088  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, None), state
8089  *     else:
8090  */
8091   __pyx_t_5 = (__pyx_v_use_setstate != 0);
8092   if (__pyx_t_5) {
8093 
8094     /* "(tree fragment)":13
8095  *         use_setstate = self.R is not None or self.R_square_root is not None or self.dR is not None or self.index is not None
8096  *     if use_setstate:
8097  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, None), state             # <<<<<<<<<<<<<<
8098  *     else:
8099  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, state)
8100  */
8101     __Pyx_XDECREF(__pyx_r);
8102     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_R_handling_Cython); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
8103     __Pyx_GOTREF(__pyx_t_2);
8104     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
8105     __Pyx_GOTREF(__pyx_t_3);
8106     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8107     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8108     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8109     __Pyx_INCREF(__pyx_int_166296743);
8110     __Pyx_GIVEREF(__pyx_int_166296743);
8111     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_166296743);
8112     __Pyx_INCREF(Py_None);
8113     __Pyx_GIVEREF(Py_None);
8114     PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
8115     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
8116     __Pyx_GOTREF(__pyx_t_1);
8117     __Pyx_GIVEREF(__pyx_t_2);
8118     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
8119     __Pyx_GIVEREF(__pyx_t_3);
8120     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
8121     __Pyx_INCREF(__pyx_v_state);
8122     __Pyx_GIVEREF(__pyx_v_state);
8123     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
8124     __pyx_t_2 = 0;
8125     __pyx_t_3 = 0;
8126     __pyx_r = __pyx_t_1;
8127     __pyx_t_1 = 0;
8128     goto __pyx_L0;
8129 
8130     /* "(tree fragment)":12
8131  *     else:
8132  *         use_setstate = self.R is not None or self.R_square_root is not None or self.dR is not None or self.index is not None
8133  *     if use_setstate:             # <<<<<<<<<<<<<<
8134  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, None), state
8135  *     else:
8136  */
8137   }
8138 
8139   /* "(tree fragment)":15
8140  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, None), state
8141  *     else:
8142  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, state)             # <<<<<<<<<<<<<<
8143  * def __setstate_cython__(self, __pyx_state):
8144  *     __pyx_unpickle_R_handling_Cython__set_state(self, __pyx_state)
8145  */
8146   /*else*/ {
8147     __Pyx_XDECREF(__pyx_r);
8148     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_R_handling_Cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
8149     __Pyx_GOTREF(__pyx_t_1);
8150     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
8151     __Pyx_GOTREF(__pyx_t_3);
8152     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8153     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8154     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
8155     __Pyx_INCREF(__pyx_int_166296743);
8156     __Pyx_GIVEREF(__pyx_int_166296743);
8157     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_166296743);
8158     __Pyx_INCREF(__pyx_v_state);
8159     __Pyx_GIVEREF(__pyx_v_state);
8160     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
8161     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
8162     __Pyx_GOTREF(__pyx_t_2);
8163     __Pyx_GIVEREF(__pyx_t_1);
8164     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
8165     __Pyx_GIVEREF(__pyx_t_3);
8166     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
8167     __pyx_t_1 = 0;
8168     __pyx_t_3 = 0;
8169     __pyx_r = __pyx_t_2;
8170     __pyx_t_2 = 0;
8171     goto __pyx_L0;
8172   }
8173 
8174   /* "(tree fragment)":1
8175  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
8176  *     cdef tuple state
8177  *     cdef object _dict
8178  */
8179 
8180   /* function exit code */
8181   __pyx_L1_error:;
8182   __Pyx_XDECREF(__pyx_t_1);
8183   __Pyx_XDECREF(__pyx_t_2);
8184   __Pyx_XDECREF(__pyx_t_3);
8185   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8186   __pyx_r = NULL;
8187   __pyx_L0:;
8188   __Pyx_XDECREF(__pyx_v_state);
8189   __Pyx_XDECREF(__pyx_v__dict);
8190   __Pyx_XGIVEREF(__pyx_r);
8191   __Pyx_RefNannyFinishContext();
8192   return __pyx_r;
8193 }
8194 
8195 /* "(tree fragment)":16
8196  *     else:
8197  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, state)
8198  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8199  *     __pyx_unpickle_R_handling_Cython__set_state(self, __pyx_state)
8200  */
8201 
8202 /* Python wrapper */
8203 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)8204 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8205   PyObject *__pyx_r = 0;
8206   __Pyx_RefNannyDeclarations
8207   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8208   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_10__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8209 
8210   /* function exit code */
8211   __Pyx_RefNannyFinishContext();
8212   return __pyx_r;
8213 }
8214 
__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)8215 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17R_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8216   PyObject *__pyx_r = NULL;
8217   __Pyx_RefNannyDeclarations
8218   PyObject *__pyx_t_1 = NULL;
8219   int __pyx_lineno = 0;
8220   const char *__pyx_filename = NULL;
8221   int __pyx_clineno = 0;
8222   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8223 
8224   /* "(tree fragment)":17
8225  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, state)
8226  * def __setstate_cython__(self, __pyx_state):
8227  *     __pyx_unpickle_R_handling_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
8228  */
8229   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
8230   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_R_handling_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
8231   __Pyx_GOTREF(__pyx_t_1);
8232   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8233 
8234   /* "(tree fragment)":16
8235  *     else:
8236  *         return __pyx_unpickle_R_handling_Cython, (type(self), 0x9e97ca7, state)
8237  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
8238  *     __pyx_unpickle_R_handling_Cython__set_state(self, __pyx_state)
8239  */
8240 
8241   /* function exit code */
8242   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8243   goto __pyx_L0;
8244   __pyx_L1_error:;
8245   __Pyx_XDECREF(__pyx_t_1);
8246   __Pyx_AddTraceback("GPy.models.state_space_cython.R_handling_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8247   __pyx_r = NULL;
8248   __pyx_L0:;
8249   __Pyx_XGIVEREF(__pyx_r);
8250   __Pyx_RefNannyFinishContext();
8251   return __pyx_r;
8252 }
8253 
8254 /* "GPy/models/state_space_cython.pyx":172
8255  *         np.ndarray dH
8256  *
8257  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] H, int H_time_var_index,             # <<<<<<<<<<<<<<
8258  *                  np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index, int R_time_var_index,
8259  *                  int unique_R_number, np.ndarray[DTYPE_t, ndim=3] dH = None,
8260  */
8261 
8262 /* Python wrapper */
8263 static int __pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8264 static int __pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8265   PyArrayObject *__pyx_v_H = 0;
8266   int __pyx_v_H_time_var_index;
8267   PyArrayObject *__pyx_v_R = 0;
8268   PyArrayObject *__pyx_v_index = 0;
8269   int __pyx_v_R_time_var_index;
8270   int __pyx_v_unique_R_number;
8271   PyArrayObject *__pyx_v_dH = 0;
8272   PyArrayObject *__pyx_v_dR = 0;
8273   int __pyx_lineno = 0;
8274   const char *__pyx_filename = NULL;
8275   int __pyx_clineno = 0;
8276   int __pyx_r;
8277   __Pyx_RefNannyDeclarations
8278   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8279   {
8280     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_H,&__pyx_n_s_H_time_var_index,&__pyx_n_s_R,&__pyx_n_s_index,&__pyx_n_s_R_time_var_index,&__pyx_n_s_unique_R_number,&__pyx_n_s_dH,&__pyx_n_s_dR,0};
8281     PyObject* values[8] = {0,0,0,0,0,0,0,0};
8282 
8283     /* "GPy/models/state_space_cython.pyx":174
8284  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] H, int H_time_var_index,
8285  *                  np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index, int R_time_var_index,
8286  *                  int unique_R_number, np.ndarray[DTYPE_t, ndim=3] dH = None,             # <<<<<<<<<<<<<<
8287  *                  np.ndarray[DTYPE_t, ndim=3] dR=None):
8288  *
8289  */
8290     values[6] = (PyObject *)((PyArrayObject *)Py_None);
8291 
8292     /* "GPy/models/state_space_cython.pyx":175
8293  *                  np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index, int R_time_var_index,
8294  *                  int unique_R_number, np.ndarray[DTYPE_t, ndim=3] dH = None,
8295  *                  np.ndarray[DTYPE_t, ndim=3] dR=None):             # <<<<<<<<<<<<<<
8296  *
8297  *         super(Std_Measurement_Callables_Cython,self).__init__(R, index, R_time_var_index, unique_R_number,dR)
8298  */
8299     values[7] = (PyObject *)((PyArrayObject *)Py_None);
8300     if (unlikely(__pyx_kwds)) {
8301       Py_ssize_t kw_args;
8302       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8303       switch (pos_args) {
8304         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8305         CYTHON_FALLTHROUGH;
8306         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8307         CYTHON_FALLTHROUGH;
8308         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8309         CYTHON_FALLTHROUGH;
8310         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8311         CYTHON_FALLTHROUGH;
8312         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8313         CYTHON_FALLTHROUGH;
8314         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8315         CYTHON_FALLTHROUGH;
8316         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8317         CYTHON_FALLTHROUGH;
8318         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8319         CYTHON_FALLTHROUGH;
8320         case  0: break;
8321         default: goto __pyx_L5_argtuple_error;
8322       }
8323       kw_args = PyDict_Size(__pyx_kwds);
8324       switch (pos_args) {
8325         case  0:
8326         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H)) != 0)) kw_args--;
8327         else goto __pyx_L5_argtuple_error;
8328         CYTHON_FALLTHROUGH;
8329         case  1:
8330         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H_time_var_index)) != 0)) kw_args--;
8331         else {
8332           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 172, __pyx_L3_error)
8333         }
8334         CYTHON_FALLTHROUGH;
8335         case  2:
8336         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
8337         else {
8338           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 172, __pyx_L3_error)
8339         }
8340         CYTHON_FALLTHROUGH;
8341         case  3:
8342         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
8343         else {
8344           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 172, __pyx_L3_error)
8345         }
8346         CYTHON_FALLTHROUGH;
8347         case  4:
8348         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R_time_var_index)) != 0)) kw_args--;
8349         else {
8350           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 172, __pyx_L3_error)
8351         }
8352         CYTHON_FALLTHROUGH;
8353         case  5:
8354         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unique_R_number)) != 0)) kw_args--;
8355         else {
8356           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 172, __pyx_L3_error)
8357         }
8358         CYTHON_FALLTHROUGH;
8359         case  6:
8360         if (kw_args > 0) {
8361           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dH);
8362           if (value) { values[6] = value; kw_args--; }
8363         }
8364         CYTHON_FALLTHROUGH;
8365         case  7:
8366         if (kw_args > 0) {
8367           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dR);
8368           if (value) { values[7] = value; kw_args--; }
8369         }
8370       }
8371       if (unlikely(kw_args > 0)) {
8372         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 172, __pyx_L3_error)
8373       }
8374     } else {
8375       switch (PyTuple_GET_SIZE(__pyx_args)) {
8376         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8377         CYTHON_FALLTHROUGH;
8378         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8379         CYTHON_FALLTHROUGH;
8380         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8381         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8382         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8383         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8384         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8385         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8386         break;
8387         default: goto __pyx_L5_argtuple_error;
8388       }
8389     }
8390     __pyx_v_H = ((PyArrayObject *)values[0]);
8391     __pyx_v_H_time_var_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_H_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L3_error)
8392     __pyx_v_R = ((PyArrayObject *)values[2]);
8393     __pyx_v_index = ((PyArrayObject *)values[3]);
8394     __pyx_v_R_time_var_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_R_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L3_error)
8395     __pyx_v_unique_R_number = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_unique_R_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 174, __pyx_L3_error)
8396     __pyx_v_dH = ((PyArrayObject *)values[6]);
8397     __pyx_v_dR = ((PyArrayObject *)values[7]);
8398   }
8399   goto __pyx_L4_argument_unpacking_done;
8400   __pyx_L5_argtuple_error:;
8401   __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 172, __pyx_L3_error)
8402   __pyx_L3_error:;
8403   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8404   __Pyx_RefNannyFinishContext();
8405   return -1;
8406   __pyx_L4_argument_unpacking_done:;
8407   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_5numpy_ndarray, 1, "H", 0))) __PYX_ERR(0, 172, __pyx_L1_error)
8408   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_R), __pyx_ptype_5numpy_ndarray, 1, "R", 0))) __PYX_ERR(0, 173, __pyx_L1_error)
8409   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 173, __pyx_L1_error)
8410   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dH), __pyx_ptype_5numpy_ndarray, 1, "dH", 0))) __PYX_ERR(0, 174, __pyx_L1_error)
8411   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dR), __pyx_ptype_5numpy_ndarray, 1, "dR", 0))) __PYX_ERR(0, 175, __pyx_L1_error)
8412   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython___init__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_H, __pyx_v_H_time_var_index, __pyx_v_R, __pyx_v_index, __pyx_v_R_time_var_index, __pyx_v_unique_R_number, __pyx_v_dH, __pyx_v_dR);
8413 
8414   /* "GPy/models/state_space_cython.pyx":172
8415  *         np.ndarray dH
8416  *
8417  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] H, int H_time_var_index,             # <<<<<<<<<<<<<<
8418  *                  np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index, int R_time_var_index,
8419  *                  int unique_R_number, np.ndarray[DTYPE_t, ndim=3] dH = None,
8420  */
8421 
8422   /* function exit code */
8423   goto __pyx_L0;
8424   __pyx_L1_error:;
8425   __pyx_r = -1;
8426   __pyx_L0:;
8427   __Pyx_RefNannyFinishContext();
8428   return __pyx_r;
8429 }
8430 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,PyArrayObject * __pyx_v_H,int __pyx_v_H_time_var_index,PyArrayObject * __pyx_v_R,PyArrayObject * __pyx_v_index,int __pyx_v_R_time_var_index,int __pyx_v_unique_R_number,PyArrayObject * __pyx_v_dH,PyArrayObject * __pyx_v_dR)8431 static int __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, PyArrayObject *__pyx_v_H, int __pyx_v_H_time_var_index, PyArrayObject *__pyx_v_R, PyArrayObject *__pyx_v_index, int __pyx_v_R_time_var_index, int __pyx_v_unique_R_number, PyArrayObject *__pyx_v_dH, PyArrayObject *__pyx_v_dR) {
8432   __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
8433   __Pyx_Buffer __pyx_pybuffer_H;
8434   __Pyx_LocalBuf_ND __pyx_pybuffernd_R;
8435   __Pyx_Buffer __pyx_pybuffer_R;
8436   __Pyx_LocalBuf_ND __pyx_pybuffernd_dH;
8437   __Pyx_Buffer __pyx_pybuffer_dH;
8438   __Pyx_LocalBuf_ND __pyx_pybuffernd_dR;
8439   __Pyx_Buffer __pyx_pybuffer_dR;
8440   __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
8441   __Pyx_Buffer __pyx_pybuffer_index;
8442   int __pyx_r;
8443   __Pyx_RefNannyDeclarations
8444   PyObject *__pyx_t_1 = NULL;
8445   PyObject *__pyx_t_2 = NULL;
8446   PyObject *__pyx_t_3 = NULL;
8447   PyObject *__pyx_t_4 = NULL;
8448   PyObject *__pyx_t_5 = NULL;
8449   int __pyx_t_6;
8450   PyObject *__pyx_t_7 = NULL;
8451   int __pyx_lineno = 0;
8452   const char *__pyx_filename = NULL;
8453   int __pyx_clineno = 0;
8454   __Pyx_RefNannySetupContext("__init__", 0);
8455   __pyx_pybuffer_H.pybuffer.buf = NULL;
8456   __pyx_pybuffer_H.refcount = 0;
8457   __pyx_pybuffernd_H.data = NULL;
8458   __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
8459   __pyx_pybuffer_R.pybuffer.buf = NULL;
8460   __pyx_pybuffer_R.refcount = 0;
8461   __pyx_pybuffernd_R.data = NULL;
8462   __pyx_pybuffernd_R.rcbuffer = &__pyx_pybuffer_R;
8463   __pyx_pybuffer_index.pybuffer.buf = NULL;
8464   __pyx_pybuffer_index.refcount = 0;
8465   __pyx_pybuffernd_index.data = NULL;
8466   __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
8467   __pyx_pybuffer_dH.pybuffer.buf = NULL;
8468   __pyx_pybuffer_dH.refcount = 0;
8469   __pyx_pybuffernd_dH.data = NULL;
8470   __pyx_pybuffernd_dH.rcbuffer = &__pyx_pybuffer_dH;
8471   __pyx_pybuffer_dR.pybuffer.buf = NULL;
8472   __pyx_pybuffer_dR.refcount = 0;
8473   __pyx_pybuffernd_dR.data = NULL;
8474   __pyx_pybuffernd_dR.rcbuffer = &__pyx_pybuffer_dR;
8475   {
8476     __Pyx_BufFmt_StackElem __pyx_stack[1];
8477     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_v_H, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error)
8478   }
8479   __pyx_pybuffernd_H.diminfo[0].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H.diminfo[0].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H.diminfo[1].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H.diminfo[1].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_H.diminfo[2].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_H.diminfo[2].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[2];
8480   {
8481     __Pyx_BufFmt_StackElem __pyx_stack[1];
8482     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_v_R, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error)
8483   }
8484   __pyx_pybuffernd_R.diminfo[0].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R.diminfo[0].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R.diminfo[1].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R.diminfo[1].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_R.diminfo[2].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_R.diminfo[2].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[2];
8485   {
8486     __Pyx_BufFmt_StackElem __pyx_stack[1];
8487     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error)
8488   }
8489   __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_index.diminfo[1].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_index.diminfo[1].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[1];
8490   {
8491     __Pyx_BufFmt_StackElem __pyx_stack[1];
8492     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dH.rcbuffer->pybuffer, (PyObject*)__pyx_v_dH, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error)
8493   }
8494   __pyx_pybuffernd_dH.diminfo[0].strides = __pyx_pybuffernd_dH.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dH.diminfo[0].shape = __pyx_pybuffernd_dH.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dH.diminfo[1].strides = __pyx_pybuffernd_dH.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dH.diminfo[1].shape = __pyx_pybuffernd_dH.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dH.diminfo[2].strides = __pyx_pybuffernd_dH.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dH.diminfo[2].shape = __pyx_pybuffernd_dH.rcbuffer->pybuffer.shape[2];
8495   {
8496     __Pyx_BufFmt_StackElem __pyx_stack[1];
8497     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR.rcbuffer->pybuffer, (PyObject*)__pyx_v_dR, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 172, __pyx_L1_error)
8498   }
8499   __pyx_pybuffernd_dR.diminfo[0].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dR.diminfo[0].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dR.diminfo[1].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dR.diminfo[1].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dR.diminfo[2].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dR.diminfo[2].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[2];
8500 
8501   /* "GPy/models/state_space_cython.pyx":177
8502  *                  np.ndarray[DTYPE_t, ndim=3] dR=None):
8503  *
8504  *         super(Std_Measurement_Callables_Cython,self).__init__(R, index, R_time_var_index, unique_R_number,dR)             # <<<<<<<<<<<<<<
8505  *
8506  *         self.H = H
8507  */
8508   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
8509   __Pyx_GOTREF(__pyx_t_2);
8510   __Pyx_INCREF(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython));
8511   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython));
8512   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython));
8513   __Pyx_INCREF(((PyObject *)__pyx_v_self));
8514   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8515   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
8516   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
8517   __Pyx_GOTREF(__pyx_t_3);
8518   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8519   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
8520   __Pyx_GOTREF(__pyx_t_2);
8521   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8522   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_R_time_var_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
8523   __Pyx_GOTREF(__pyx_t_3);
8524   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_unique_R_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 177, __pyx_L1_error)
8525   __Pyx_GOTREF(__pyx_t_4);
8526   __pyx_t_5 = NULL;
8527   __pyx_t_6 = 0;
8528   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8529     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
8530     if (likely(__pyx_t_5)) {
8531       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8532       __Pyx_INCREF(__pyx_t_5);
8533       __Pyx_INCREF(function);
8534       __Pyx_DECREF_SET(__pyx_t_2, function);
8535       __pyx_t_6 = 1;
8536     }
8537   }
8538   #if CYTHON_FAST_PYCALL
8539   if (PyFunction_Check(__pyx_t_2)) {
8540     PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_R), ((PyObject *)__pyx_v_index), __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_dR)};
8541     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
8542     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8543     __Pyx_GOTREF(__pyx_t_1);
8544     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8545     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8546   } else
8547   #endif
8548   #if CYTHON_FAST_PYCCALL
8549   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
8550     PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_R), ((PyObject *)__pyx_v_index), __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_dR)};
8551     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
8552     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8553     __Pyx_GOTREF(__pyx_t_1);
8554     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8555     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8556   } else
8557   #endif
8558   {
8559     __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error)
8560     __Pyx_GOTREF(__pyx_t_7);
8561     if (__pyx_t_5) {
8562       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8563     }
8564     __Pyx_INCREF(((PyObject *)__pyx_v_R));
8565     __Pyx_GIVEREF(((PyObject *)__pyx_v_R));
8566     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_R));
8567     __Pyx_INCREF(((PyObject *)__pyx_v_index));
8568     __Pyx_GIVEREF(((PyObject *)__pyx_v_index));
8569     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_index));
8570     __Pyx_GIVEREF(__pyx_t_3);
8571     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
8572     __Pyx_GIVEREF(__pyx_t_4);
8573     PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_4);
8574     __Pyx_INCREF(((PyObject *)__pyx_v_dR));
8575     __Pyx_GIVEREF(((PyObject *)__pyx_v_dR));
8576     PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, ((PyObject *)__pyx_v_dR));
8577     __pyx_t_3 = 0;
8578     __pyx_t_4 = 0;
8579     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
8580     __Pyx_GOTREF(__pyx_t_1);
8581     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8582   }
8583   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8584   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8585 
8586   /* "GPy/models/state_space_cython.pyx":179
8587  *         super(Std_Measurement_Callables_Cython,self).__init__(R, index, R_time_var_index, unique_R_number,dR)
8588  *
8589  *         self.H = H             # <<<<<<<<<<<<<<
8590  *         self.H_time_var_index = H_time_var_index
8591  *         self.dH = dH
8592  */
8593   __Pyx_INCREF(((PyObject *)__pyx_v_H));
8594   __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
8595   __Pyx_GOTREF(__pyx_v_self->H);
8596   __Pyx_DECREF(((PyObject *)__pyx_v_self->H));
8597   __pyx_v_self->H = ((PyArrayObject *)__pyx_v_H);
8598 
8599   /* "GPy/models/state_space_cython.pyx":180
8600  *
8601  *         self.H = H
8602  *         self.H_time_var_index = H_time_var_index             # <<<<<<<<<<<<<<
8603  *         self.dH = dH
8604  *
8605  */
8606   __pyx_v_self->H_time_var_index = __pyx_v_H_time_var_index;
8607 
8608   /* "GPy/models/state_space_cython.pyx":181
8609  *         self.H = H
8610  *         self.H_time_var_index = H_time_var_index
8611  *         self.dH = dH             # <<<<<<<<<<<<<<
8612  *
8613  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] H):
8614  */
8615   __Pyx_INCREF(((PyObject *)__pyx_v_dH));
8616   __Pyx_GIVEREF(((PyObject *)__pyx_v_dH));
8617   __Pyx_GOTREF(__pyx_v_self->dH);
8618   __Pyx_DECREF(((PyObject *)__pyx_v_self->dH));
8619   __pyx_v_self->dH = ((PyArrayObject *)__pyx_v_dH);
8620 
8621   /* "GPy/models/state_space_cython.pyx":172
8622  *         np.ndarray dH
8623  *
8624  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] H, int H_time_var_index,             # <<<<<<<<<<<<<<
8625  *                  np.ndarray[DTYPE_t, ndim=3] R, np.ndarray[DTYPE_t, ndim=2] index, int R_time_var_index,
8626  *                  int unique_R_number, np.ndarray[DTYPE_t, ndim=3] dH = None,
8627  */
8628 
8629   /* function exit code */
8630   __pyx_r = 0;
8631   goto __pyx_L0;
8632   __pyx_L1_error:;
8633   __Pyx_XDECREF(__pyx_t_1);
8634   __Pyx_XDECREF(__pyx_t_2);
8635   __Pyx_XDECREF(__pyx_t_3);
8636   __Pyx_XDECREF(__pyx_t_4);
8637   __Pyx_XDECREF(__pyx_t_5);
8638   __Pyx_XDECREF(__pyx_t_7);
8639   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8640     __Pyx_PyThreadState_declare
8641     __Pyx_PyThreadState_assign
8642     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8643     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
8644     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
8645     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH.rcbuffer->pybuffer);
8646     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
8647     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
8648   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8649   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8650   __pyx_r = -1;
8651   goto __pyx_L2;
8652   __pyx_L0:;
8653   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
8654   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
8655   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH.rcbuffer->pybuffer);
8656   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
8657   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
8658   __pyx_L2:;
8659   __Pyx_RefNannyFinishContext();
8660   return __pyx_r;
8661 }
8662 
8663 /* "GPy/models/state_space_cython.pyx":183
8664  *         self.dH = dH
8665  *
8666  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] H):             # <<<<<<<<<<<<<<
8667  *         """
8668  *         function (k, x_{k}, H_{k}). Measurement function.
8669  */
8670 
8671 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_H,int __pyx_skip_dispatch)8672 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_f_h(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_H, int __pyx_skip_dispatch) {
8673   __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
8674   __Pyx_Buffer __pyx_pybuffer_H;
8675   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
8676   __Pyx_Buffer __pyx_pybuffer_m;
8677   PyObject *__pyx_r = NULL;
8678   __Pyx_RefNannyDeclarations
8679   PyObject *__pyx_t_1 = NULL;
8680   PyObject *__pyx_t_2 = NULL;
8681   PyObject *__pyx_t_3 = NULL;
8682   PyObject *__pyx_t_4 = NULL;
8683   PyObject *__pyx_t_5 = NULL;
8684   int __pyx_t_6;
8685   PyObject *__pyx_t_7 = NULL;
8686   int __pyx_lineno = 0;
8687   const char *__pyx_filename = NULL;
8688   int __pyx_clineno = 0;
8689   __Pyx_RefNannySetupContext("f_h", 0);
8690   __pyx_pybuffer_m.pybuffer.buf = NULL;
8691   __pyx_pybuffer_m.refcount = 0;
8692   __pyx_pybuffernd_m.data = NULL;
8693   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
8694   __pyx_pybuffer_H.pybuffer.buf = NULL;
8695   __pyx_pybuffer_H.refcount = 0;
8696   __pyx_pybuffernd_H.data = NULL;
8697   __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
8698   {
8699     __Pyx_BufFmt_StackElem __pyx_stack[1];
8700     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 183, __pyx_L1_error)
8701   }
8702   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
8703   {
8704     __Pyx_BufFmt_StackElem __pyx_stack[1];
8705     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_v_H, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 183, __pyx_L1_error)
8706   }
8707   __pyx_pybuffernd_H.diminfo[0].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H.diminfo[0].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H.diminfo[1].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H.diminfo[1].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[1];
8708   /* Check if called by wrapper */
8709   if (unlikely(__pyx_skip_dispatch)) ;
8710   /* Check if overridden in Python */
8711   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
8712     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8713     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8714     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
8715       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8716       #endif
8717       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
8718       __Pyx_GOTREF(__pyx_t_1);
8719       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h)) {
8720         __Pyx_XDECREF(__pyx_r);
8721         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
8722         __Pyx_GOTREF(__pyx_t_3);
8723         __Pyx_INCREF(__pyx_t_1);
8724         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
8725         __pyx_t_6 = 0;
8726         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8727           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
8728           if (likely(__pyx_t_5)) {
8729             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8730             __Pyx_INCREF(__pyx_t_5);
8731             __Pyx_INCREF(function);
8732             __Pyx_DECREF_SET(__pyx_t_4, function);
8733             __pyx_t_6 = 1;
8734           }
8735         }
8736         #if CYTHON_FAST_PYCALL
8737         if (PyFunction_Check(__pyx_t_4)) {
8738           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_H)};
8739           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
8740           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8741           __Pyx_GOTREF(__pyx_t_2);
8742           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8743         } else
8744         #endif
8745         #if CYTHON_FAST_PYCCALL
8746         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
8747           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_H)};
8748           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
8749           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8750           __Pyx_GOTREF(__pyx_t_2);
8751           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8752         } else
8753         #endif
8754         {
8755           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 183, __pyx_L1_error)
8756           __Pyx_GOTREF(__pyx_t_7);
8757           if (__pyx_t_5) {
8758             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
8759           }
8760           __Pyx_GIVEREF(__pyx_t_3);
8761           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
8762           __Pyx_INCREF(((PyObject *)__pyx_v_m));
8763           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
8764           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
8765           __Pyx_INCREF(((PyObject *)__pyx_v_H));
8766           __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
8767           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_H));
8768           __pyx_t_3 = 0;
8769           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
8770           __Pyx_GOTREF(__pyx_t_2);
8771           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8772         }
8773         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8774         __pyx_r = __pyx_t_2;
8775         __pyx_t_2 = 0;
8776         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8777         goto __pyx_L0;
8778       }
8779       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8780       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
8781       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
8782       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
8783         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
8784       }
8785       #endif
8786       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8787       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
8788     }
8789     #endif
8790   }
8791 
8792   /* "GPy/models/state_space_cython.pyx":191
8793  *         """
8794  *
8795  *         return np.dot(H, m)             # <<<<<<<<<<<<<<
8796  *
8797  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix
8798  */
8799   __Pyx_XDECREF(__pyx_r);
8800   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
8801   __Pyx_GOTREF(__pyx_t_2);
8802   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
8803   __Pyx_GOTREF(__pyx_t_4);
8804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8805   __pyx_t_2 = NULL;
8806   __pyx_t_6 = 0;
8807   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8808     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
8809     if (likely(__pyx_t_2)) {
8810       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8811       __Pyx_INCREF(__pyx_t_2);
8812       __Pyx_INCREF(function);
8813       __Pyx_DECREF_SET(__pyx_t_4, function);
8814       __pyx_t_6 = 1;
8815     }
8816   }
8817   #if CYTHON_FAST_PYCALL
8818   if (PyFunction_Check(__pyx_t_4)) {
8819     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_m)};
8820     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
8821     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8822     __Pyx_GOTREF(__pyx_t_1);
8823   } else
8824   #endif
8825   #if CYTHON_FAST_PYCCALL
8826   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
8827     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_m)};
8828     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
8829     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8830     __Pyx_GOTREF(__pyx_t_1);
8831   } else
8832   #endif
8833   {
8834     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error)
8835     __Pyx_GOTREF(__pyx_t_7);
8836     if (__pyx_t_2) {
8837       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
8838     }
8839     __Pyx_INCREF(((PyObject *)__pyx_v_H));
8840     __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
8841     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_H));
8842     __Pyx_INCREF(((PyObject *)__pyx_v_m));
8843     __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
8844     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
8845     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error)
8846     __Pyx_GOTREF(__pyx_t_1);
8847     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
8848   }
8849   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8850   __pyx_r = __pyx_t_1;
8851   __pyx_t_1 = 0;
8852   goto __pyx_L0;
8853 
8854   /* "GPy/models/state_space_cython.pyx":183
8855  *         self.dH = dH
8856  *
8857  *     cpdef f_h(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] H):             # <<<<<<<<<<<<<<
8858  *         """
8859  *         function (k, x_{k}, H_{k}). Measurement function.
8860  */
8861 
8862   /* function exit code */
8863   __pyx_L1_error:;
8864   __Pyx_XDECREF(__pyx_t_1);
8865   __Pyx_XDECREF(__pyx_t_2);
8866   __Pyx_XDECREF(__pyx_t_3);
8867   __Pyx_XDECREF(__pyx_t_4);
8868   __Pyx_XDECREF(__pyx_t_5);
8869   __Pyx_XDECREF(__pyx_t_7);
8870   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8871     __Pyx_PyThreadState_declare
8872     __Pyx_PyThreadState_assign
8873     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8874     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
8875     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
8876   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8877   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
8878   __pyx_r = 0;
8879   goto __pyx_L2;
8880   __pyx_L0:;
8881   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
8882   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
8883   __pyx_L2:;
8884   __Pyx_XGIVEREF(__pyx_r);
8885   __Pyx_RefNannyFinishContext();
8886   return __pyx_r;
8887 }
8888 
8889 /* Python wrapper */
8890 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8891 static char __pyx_doc_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h[] = "\n        function (k, x_{k}, H_{k}). Measurement function.\n            k (iteration number), starts at 0\n            x_{k} state \n            H_{k} Jacobian matrices of f_h. In the linear case it is exactly H_{k}.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8892 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8893   int __pyx_v_k;
8894   PyArrayObject *__pyx_v_m = 0;
8895   PyArrayObject *__pyx_v_H = 0;
8896   int __pyx_lineno = 0;
8897   const char *__pyx_filename = NULL;
8898   int __pyx_clineno = 0;
8899   PyObject *__pyx_r = 0;
8900   __Pyx_RefNannyDeclarations
8901   __Pyx_RefNannySetupContext("f_h (wrapper)", 0);
8902   {
8903     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_H,0};
8904     PyObject* values[3] = {0,0,0};
8905     if (unlikely(__pyx_kwds)) {
8906       Py_ssize_t kw_args;
8907       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8908       switch (pos_args) {
8909         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8910         CYTHON_FALLTHROUGH;
8911         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8912         CYTHON_FALLTHROUGH;
8913         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8914         CYTHON_FALLTHROUGH;
8915         case  0: break;
8916         default: goto __pyx_L5_argtuple_error;
8917       }
8918       kw_args = PyDict_Size(__pyx_kwds);
8919       switch (pos_args) {
8920         case  0:
8921         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
8922         else goto __pyx_L5_argtuple_error;
8923         CYTHON_FALLTHROUGH;
8924         case  1:
8925         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
8926         else {
8927           __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, 1); __PYX_ERR(0, 183, __pyx_L3_error)
8928         }
8929         CYTHON_FALLTHROUGH;
8930         case  2:
8931         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_H)) != 0)) kw_args--;
8932         else {
8933           __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, 2); __PYX_ERR(0, 183, __pyx_L3_error)
8934         }
8935       }
8936       if (unlikely(kw_args > 0)) {
8937         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f_h") < 0)) __PYX_ERR(0, 183, __pyx_L3_error)
8938       }
8939     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
8940       goto __pyx_L5_argtuple_error;
8941     } else {
8942       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8943       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8944       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8945     }
8946     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 183, __pyx_L3_error)
8947     __pyx_v_m = ((PyArrayObject *)values[1]);
8948     __pyx_v_H = ((PyArrayObject *)values[2]);
8949   }
8950   goto __pyx_L4_argument_unpacking_done;
8951   __pyx_L5_argtuple_error:;
8952   __Pyx_RaiseArgtupleInvalid("f_h", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 183, __pyx_L3_error)
8953   __pyx_L3_error:;
8954   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
8955   __Pyx_RefNannyFinishContext();
8956   return NULL;
8957   __pyx_L4_argument_unpacking_done:;
8958   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
8959   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_H), __pyx_ptype_5numpy_ndarray, 1, "H", 0))) __PYX_ERR(0, 183, __pyx_L1_error)
8960   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_H);
8961 
8962   /* function exit code */
8963   goto __pyx_L0;
8964   __pyx_L1_error:;
8965   __pyx_r = NULL;
8966   __pyx_L0:;
8967   __Pyx_RefNannyFinishContext();
8968   return __pyx_r;
8969 }
8970 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_H)8971 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_H) {
8972   __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
8973   __Pyx_Buffer __pyx_pybuffer_H;
8974   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
8975   __Pyx_Buffer __pyx_pybuffer_m;
8976   PyObject *__pyx_r = NULL;
8977   __Pyx_RefNannyDeclarations
8978   PyObject *__pyx_t_1 = NULL;
8979   int __pyx_lineno = 0;
8980   const char *__pyx_filename = NULL;
8981   int __pyx_clineno = 0;
8982   __Pyx_RefNannySetupContext("f_h", 0);
8983   __pyx_pybuffer_m.pybuffer.buf = NULL;
8984   __pyx_pybuffer_m.refcount = 0;
8985   __pyx_pybuffernd_m.data = NULL;
8986   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
8987   __pyx_pybuffer_H.pybuffer.buf = NULL;
8988   __pyx_pybuffer_H.refcount = 0;
8989   __pyx_pybuffernd_H.data = NULL;
8990   __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
8991   {
8992     __Pyx_BufFmt_StackElem __pyx_stack[1];
8993     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 183, __pyx_L1_error)
8994   }
8995   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
8996   {
8997     __Pyx_BufFmt_StackElem __pyx_stack[1];
8998     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_v_H, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 183, __pyx_L1_error)
8999   }
9000   __pyx_pybuffernd_H.diminfo[0].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H.diminfo[0].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H.diminfo[1].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H.diminfo[1].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[1];
9001   __Pyx_XDECREF(__pyx_r);
9002   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_f_h(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m), ((PyArrayObject *)__pyx_v_H), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
9003   __Pyx_GOTREF(__pyx_t_1);
9004   __pyx_r = __pyx_t_1;
9005   __pyx_t_1 = 0;
9006   goto __pyx_L0;
9007 
9008   /* function exit code */
9009   __pyx_L1_error:;
9010   __Pyx_XDECREF(__pyx_t_1);
9011   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9012     __Pyx_PyThreadState_declare
9013     __Pyx_PyThreadState_assign
9014     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9015     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
9016     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
9017   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9018   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.f_h", __pyx_clineno, __pyx_lineno, __pyx_filename);
9019   __pyx_r = NULL;
9020   goto __pyx_L2;
9021   __pyx_L0:;
9022   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
9023   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
9024   __pyx_L2:;
9025   __Pyx_XGIVEREF(__pyx_r);
9026   __Pyx_RefNannyFinishContext();
9027   return __pyx_r;
9028 }
9029 
9030 /* "GPy/models/state_space_cython.pyx":193
9031  *         return np.dot(H, m)
9032  *
9033  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
9034  *         """
9035  *         function (k, m, P) return Jacobian of measurement function, it is
9036  */
9037 
9038 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m_pred,CYTHON_UNUSED PyArrayObject * __pyx_v_P_pred,int __pyx_skip_dispatch)9039 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch) {
9040   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
9041   __Pyx_Buffer __pyx_pybuffer_P_pred;
9042   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
9043   __Pyx_Buffer __pyx_pybuffer_m_pred;
9044   PyObject *__pyx_r = NULL;
9045   __Pyx_RefNannyDeclarations
9046   PyObject *__pyx_t_1 = NULL;
9047   PyObject *__pyx_t_2 = NULL;
9048   PyObject *__pyx_t_3 = NULL;
9049   PyObject *__pyx_t_4 = NULL;
9050   PyObject *__pyx_t_5 = NULL;
9051   int __pyx_t_6;
9052   PyObject *__pyx_t_7 = NULL;
9053   int __pyx_lineno = 0;
9054   const char *__pyx_filename = NULL;
9055   int __pyx_clineno = 0;
9056   __Pyx_RefNannySetupContext("Hk", 0);
9057   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
9058   __pyx_pybuffer_m_pred.refcount = 0;
9059   __pyx_pybuffernd_m_pred.data = NULL;
9060   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
9061   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
9062   __pyx_pybuffer_P_pred.refcount = 0;
9063   __pyx_pybuffernd_P_pred.data = NULL;
9064   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
9065   {
9066     __Pyx_BufFmt_StackElem __pyx_stack[1];
9067     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
9068   }
9069   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
9070   {
9071     __Pyx_BufFmt_StackElem __pyx_stack[1];
9072     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
9073   }
9074   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
9075   /* Check if called by wrapper */
9076   if (unlikely(__pyx_skip_dispatch)) ;
9077   /* Check if overridden in Python */
9078   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
9079     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9080     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9081     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
9082       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9083       #endif
9084       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Hk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
9085       __Pyx_GOTREF(__pyx_t_1);
9086       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk)) {
9087         __Pyx_XDECREF(__pyx_r);
9088         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
9089         __Pyx_GOTREF(__pyx_t_3);
9090         __Pyx_INCREF(__pyx_t_1);
9091         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
9092         __pyx_t_6 = 0;
9093         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9094           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
9095           if (likely(__pyx_t_5)) {
9096             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9097             __Pyx_INCREF(__pyx_t_5);
9098             __Pyx_INCREF(function);
9099             __Pyx_DECREF_SET(__pyx_t_4, function);
9100             __pyx_t_6 = 1;
9101           }
9102         }
9103         #if CYTHON_FAST_PYCALL
9104         if (PyFunction_Check(__pyx_t_4)) {
9105           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
9106           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
9107           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9108           __Pyx_GOTREF(__pyx_t_2);
9109           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9110         } else
9111         #endif
9112         #if CYTHON_FAST_PYCCALL
9113         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9114           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
9115           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
9116           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9117           __Pyx_GOTREF(__pyx_t_2);
9118           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9119         } else
9120         #endif
9121         {
9122           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 193, __pyx_L1_error)
9123           __Pyx_GOTREF(__pyx_t_7);
9124           if (__pyx_t_5) {
9125             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
9126           }
9127           __Pyx_GIVEREF(__pyx_t_3);
9128           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
9129           __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
9130           __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
9131           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m_pred));
9132           __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
9133           __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
9134           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_P_pred));
9135           __pyx_t_3 = 0;
9136           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
9137           __Pyx_GOTREF(__pyx_t_2);
9138           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9139         }
9140         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9141         __pyx_r = __pyx_t_2;
9142         __pyx_t_2 = 0;
9143         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9144         goto __pyx_L0;
9145       }
9146       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9147       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9148       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
9149       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
9150         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9151       }
9152       #endif
9153       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9154       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9155     }
9156     #endif
9157   }
9158 
9159   /* "GPy/models/state_space_cython.pyx":202
9160  *         """
9161  *
9162  *         return self.H[:,:, <int>self.index[self.H_time_var_index, k]]             # <<<<<<<<<<<<<<
9163  *
9164  *     cpdef dHk(self,int k):
9165  */
9166   __Pyx_XDECREF(__pyx_r);
9167   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->H_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error)
9168   __Pyx_GOTREF(__pyx_t_1);
9169   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
9170   __Pyx_GOTREF(__pyx_t_2);
9171   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
9172   __Pyx_GOTREF(__pyx_t_4);
9173   __Pyx_GIVEREF(__pyx_t_1);
9174   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
9175   __Pyx_GIVEREF(__pyx_t_2);
9176   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
9177   __pyx_t_1 = 0;
9178   __pyx_t_2 = 0;
9179   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base.index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
9180   __Pyx_GOTREF(__pyx_t_2);
9181   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9182   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L1_error)
9183   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9184   __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
9185   __Pyx_GOTREF(__pyx_t_2);
9186   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
9187   __Pyx_GOTREF(__pyx_t_4);
9188   __Pyx_INCREF(__pyx_slice__10);
9189   __Pyx_GIVEREF(__pyx_slice__10);
9190   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
9191   __Pyx_INCREF(__pyx_slice__10);
9192   __Pyx_GIVEREF(__pyx_slice__10);
9193   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
9194   __Pyx_GIVEREF(__pyx_t_2);
9195   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
9196   __pyx_t_2 = 0;
9197   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->H), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
9198   __Pyx_GOTREF(__pyx_t_2);
9199   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9200   __pyx_r = __pyx_t_2;
9201   __pyx_t_2 = 0;
9202   goto __pyx_L0;
9203 
9204   /* "GPy/models/state_space_cython.pyx":193
9205  *         return np.dot(H, m)
9206  *
9207  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
9208  *         """
9209  *         function (k, m, P) return Jacobian of measurement function, it is
9210  */
9211 
9212   /* function exit code */
9213   __pyx_L1_error:;
9214   __Pyx_XDECREF(__pyx_t_1);
9215   __Pyx_XDECREF(__pyx_t_2);
9216   __Pyx_XDECREF(__pyx_t_3);
9217   __Pyx_XDECREF(__pyx_t_4);
9218   __Pyx_XDECREF(__pyx_t_5);
9219   __Pyx_XDECREF(__pyx_t_7);
9220   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9221     __Pyx_PyThreadState_declare
9222     __Pyx_PyThreadState_assign
9223     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9224     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
9225     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
9226   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9227   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9228   __pyx_r = 0;
9229   goto __pyx_L2;
9230   __pyx_L0:;
9231   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
9232   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
9233   __pyx_L2:;
9234   __Pyx_XGIVEREF(__pyx_r);
9235   __Pyx_RefNannyFinishContext();
9236   return __pyx_r;
9237 }
9238 
9239 /* Python wrapper */
9240 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9241 static char __pyx_doc_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk[] = "\n        function (k, m, P) return Jacobian of measurement function, it is\n            passed into p_h.\n            k (iteration number), starts at 0\n            m: point where Jacobian is evaluated\n            P: parameter for Jacobian, usually covariance matrix.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9242 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9243   int __pyx_v_k;
9244   PyArrayObject *__pyx_v_m_pred = 0;
9245   PyArrayObject *__pyx_v_P_pred = 0;
9246   int __pyx_lineno = 0;
9247   const char *__pyx_filename = NULL;
9248   int __pyx_clineno = 0;
9249   PyObject *__pyx_r = 0;
9250   __Pyx_RefNannyDeclarations
9251   __Pyx_RefNannySetupContext("Hk (wrapper)", 0);
9252   {
9253     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m_pred,&__pyx_n_s_P_pred,0};
9254     PyObject* values[3] = {0,0,0};
9255     if (unlikely(__pyx_kwds)) {
9256       Py_ssize_t kw_args;
9257       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9258       switch (pos_args) {
9259         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9260         CYTHON_FALLTHROUGH;
9261         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9262         CYTHON_FALLTHROUGH;
9263         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9264         CYTHON_FALLTHROUGH;
9265         case  0: break;
9266         default: goto __pyx_L5_argtuple_error;
9267       }
9268       kw_args = PyDict_Size(__pyx_kwds);
9269       switch (pos_args) {
9270         case  0:
9271         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
9272         else goto __pyx_L5_argtuple_error;
9273         CYTHON_FALLTHROUGH;
9274         case  1:
9275         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m_pred)) != 0)) kw_args--;
9276         else {
9277           __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, 1); __PYX_ERR(0, 193, __pyx_L3_error)
9278         }
9279         CYTHON_FALLTHROUGH;
9280         case  2:
9281         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P_pred)) != 0)) kw_args--;
9282         else {
9283           __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, 2); __PYX_ERR(0, 193, __pyx_L3_error)
9284         }
9285       }
9286       if (unlikely(kw_args > 0)) {
9287         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Hk") < 0)) __PYX_ERR(0, 193, __pyx_L3_error)
9288       }
9289     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
9290       goto __pyx_L5_argtuple_error;
9291     } else {
9292       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9293       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9294       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9295     }
9296     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error)
9297     __pyx_v_m_pred = ((PyArrayObject *)values[1]);
9298     __pyx_v_P_pred = ((PyArrayObject *)values[2]);
9299   }
9300   goto __pyx_L4_argument_unpacking_done;
9301   __pyx_L5_argtuple_error:;
9302   __Pyx_RaiseArgtupleInvalid("Hk", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 193, __pyx_L3_error)
9303   __pyx_L3_error:;
9304   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9305   __Pyx_RefNannyFinishContext();
9306   return NULL;
9307   __pyx_L4_argument_unpacking_done:;
9308   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m_pred), __pyx_ptype_5numpy_ndarray, 1, "m_pred", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
9309   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P_pred), __pyx_ptype_5numpy_ndarray, 1, "P_pred", 0))) __PYX_ERR(0, 193, __pyx_L1_error)
9310   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m_pred, __pyx_v_P_pred);
9311 
9312   /* function exit code */
9313   goto __pyx_L0;
9314   __pyx_L1_error:;
9315   __pyx_r = NULL;
9316   __pyx_L0:;
9317   __Pyx_RefNannyFinishContext();
9318   return __pyx_r;
9319 }
9320 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m_pred,PyArrayObject * __pyx_v_P_pred)9321 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred) {
9322   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
9323   __Pyx_Buffer __pyx_pybuffer_P_pred;
9324   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
9325   __Pyx_Buffer __pyx_pybuffer_m_pred;
9326   PyObject *__pyx_r = NULL;
9327   __Pyx_RefNannyDeclarations
9328   PyObject *__pyx_t_1 = NULL;
9329   int __pyx_lineno = 0;
9330   const char *__pyx_filename = NULL;
9331   int __pyx_clineno = 0;
9332   __Pyx_RefNannySetupContext("Hk", 0);
9333   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
9334   __pyx_pybuffer_m_pred.refcount = 0;
9335   __pyx_pybuffernd_m_pred.data = NULL;
9336   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
9337   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
9338   __pyx_pybuffer_P_pred.refcount = 0;
9339   __pyx_pybuffernd_P_pred.data = NULL;
9340   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
9341   {
9342     __Pyx_BufFmt_StackElem __pyx_stack[1];
9343     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
9344   }
9345   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
9346   {
9347     __Pyx_BufFmt_StackElem __pyx_stack[1];
9348     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 193, __pyx_L1_error)
9349   }
9350   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
9351   __Pyx_XDECREF(__pyx_r);
9352   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_Hk(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m_pred), ((PyArrayObject *)__pyx_v_P_pred), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
9353   __Pyx_GOTREF(__pyx_t_1);
9354   __pyx_r = __pyx_t_1;
9355   __pyx_t_1 = 0;
9356   goto __pyx_L0;
9357 
9358   /* function exit code */
9359   __pyx_L1_error:;
9360   __Pyx_XDECREF(__pyx_t_1);
9361   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
9362     __Pyx_PyThreadState_declare
9363     __Pyx_PyThreadState_assign
9364     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
9365     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
9366     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
9367   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
9368   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.Hk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9369   __pyx_r = NULL;
9370   goto __pyx_L2;
9371   __pyx_L0:;
9372   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
9373   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
9374   __pyx_L2:;
9375   __Pyx_XGIVEREF(__pyx_r);
9376   __Pyx_RefNannyFinishContext();
9377   return __pyx_r;
9378 }
9379 
9380 /* "GPy/models/state_space_cython.pyx":204
9381  *         return self.H[:,:, <int>self.index[self.H_time_var_index, k]]
9382  *
9383  *     cpdef dHk(self,int k):             # <<<<<<<<<<<<<<
9384  *         if self.dH is None:
9385  *             raise ValueError("dH derivative is None")
9386  */
9387 
9388 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)9389 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
9390   PyObject *__pyx_r = NULL;
9391   __Pyx_RefNannyDeclarations
9392   PyObject *__pyx_t_1 = NULL;
9393   PyObject *__pyx_t_2 = NULL;
9394   PyObject *__pyx_t_3 = NULL;
9395   PyObject *__pyx_t_4 = NULL;
9396   PyObject *__pyx_t_5 = NULL;
9397   int __pyx_t_6;
9398   int __pyx_t_7;
9399   int __pyx_lineno = 0;
9400   const char *__pyx_filename = NULL;
9401   int __pyx_clineno = 0;
9402   __Pyx_RefNannySetupContext("dHk", 0);
9403   /* Check if called by wrapper */
9404   if (unlikely(__pyx_skip_dispatch)) ;
9405   /* Check if overridden in Python */
9406   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
9407     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9408     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9409     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
9410       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9411       #endif
9412       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dHk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
9413       __Pyx_GOTREF(__pyx_t_1);
9414       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk)) {
9415         __Pyx_XDECREF(__pyx_r);
9416         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
9417         __Pyx_GOTREF(__pyx_t_3);
9418         __Pyx_INCREF(__pyx_t_1);
9419         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
9420         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9421           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
9422           if (likely(__pyx_t_5)) {
9423             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9424             __Pyx_INCREF(__pyx_t_5);
9425             __Pyx_INCREF(function);
9426             __Pyx_DECREF_SET(__pyx_t_4, function);
9427           }
9428         }
9429         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
9430         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9431         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9432         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
9433         __Pyx_GOTREF(__pyx_t_2);
9434         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9435         __pyx_r = __pyx_t_2;
9436         __pyx_t_2 = 0;
9437         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9438         goto __pyx_L0;
9439       }
9440       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9441       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
9442       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
9443       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
9444         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
9445       }
9446       #endif
9447       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9448       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
9449     }
9450     #endif
9451   }
9452 
9453   /* "GPy/models/state_space_cython.pyx":205
9454  *
9455  *     cpdef dHk(self,int k):
9456  *         if self.dH is None:             # <<<<<<<<<<<<<<
9457  *             raise ValueError("dH derivative is None")
9458  *
9459  */
9460   __pyx_t_6 = (((PyObject *)__pyx_v_self->dH) == Py_None);
9461   __pyx_t_7 = (__pyx_t_6 != 0);
9462   if (unlikely(__pyx_t_7)) {
9463 
9464     /* "GPy/models/state_space_cython.pyx":206
9465  *     cpdef dHk(self,int k):
9466  *         if self.dH is None:
9467  *             raise ValueError("dH derivative is None")             # <<<<<<<<<<<<<<
9468  *
9469  *         return self.dH # the same dirivative on each iteration
9470  */
9471     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
9472     __Pyx_GOTREF(__pyx_t_1);
9473     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9474     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9475     __PYX_ERR(0, 206, __pyx_L1_error)
9476 
9477     /* "GPy/models/state_space_cython.pyx":205
9478  *
9479  *     cpdef dHk(self,int k):
9480  *         if self.dH is None:             # <<<<<<<<<<<<<<
9481  *             raise ValueError("dH derivative is None")
9482  *
9483  */
9484   }
9485 
9486   /* "GPy/models/state_space_cython.pyx":208
9487  *             raise ValueError("dH derivative is None")
9488  *
9489  *         return self.dH # the same dirivative on each iteration             # <<<<<<<<<<<<<<
9490  *
9491  *
9492  */
9493   __Pyx_XDECREF(__pyx_r);
9494   __Pyx_INCREF(((PyObject *)__pyx_v_self->dH));
9495   __pyx_r = ((PyObject *)__pyx_v_self->dH);
9496   goto __pyx_L0;
9497 
9498   /* "GPy/models/state_space_cython.pyx":204
9499  *         return self.H[:,:, <int>self.index[self.H_time_var_index, k]]
9500  *
9501  *     cpdef dHk(self,int k):             # <<<<<<<<<<<<<<
9502  *         if self.dH is None:
9503  *             raise ValueError("dH derivative is None")
9504  */
9505 
9506   /* function exit code */
9507   __pyx_L1_error:;
9508   __Pyx_XDECREF(__pyx_t_1);
9509   __Pyx_XDECREF(__pyx_t_2);
9510   __Pyx_XDECREF(__pyx_t_3);
9511   __Pyx_XDECREF(__pyx_t_4);
9512   __Pyx_XDECREF(__pyx_t_5);
9513   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9514   __pyx_r = 0;
9515   __pyx_L0:;
9516   __Pyx_XGIVEREF(__pyx_r);
9517   __Pyx_RefNannyFinishContext();
9518   return __pyx_r;
9519 }
9520 
9521 /* Python wrapper */
9522 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)9523 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
9524   int __pyx_v_k;
9525   int __pyx_lineno = 0;
9526   const char *__pyx_filename = NULL;
9527   int __pyx_clineno = 0;
9528   PyObject *__pyx_r = 0;
9529   __Pyx_RefNannyDeclarations
9530   __Pyx_RefNannySetupContext("dHk (wrapper)", 0);
9531   assert(__pyx_arg_k); {
9532     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L3_error)
9533   }
9534   goto __pyx_L4_argument_unpacking_done;
9535   __pyx_L3_error:;
9536   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9537   __Pyx_RefNannyFinishContext();
9538   return NULL;
9539   __pyx_L4_argument_unpacking_done:;
9540   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_6dHk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
9541 
9542   /* function exit code */
9543   __Pyx_RefNannyFinishContext();
9544   return __pyx_r;
9545 }
9546 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_6dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,int __pyx_v_k)9547 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_6dHk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
9548   PyObject *__pyx_r = NULL;
9549   __Pyx_RefNannyDeclarations
9550   PyObject *__pyx_t_1 = NULL;
9551   int __pyx_lineno = 0;
9552   const char *__pyx_filename = NULL;
9553   int __pyx_clineno = 0;
9554   __Pyx_RefNannySetupContext("dHk", 0);
9555   __Pyx_XDECREF(__pyx_r);
9556   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_dHk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
9557   __Pyx_GOTREF(__pyx_t_1);
9558   __pyx_r = __pyx_t_1;
9559   __pyx_t_1 = 0;
9560   goto __pyx_L0;
9561 
9562   /* function exit code */
9563   __pyx_L1_error:;
9564   __Pyx_XDECREF(__pyx_t_1);
9565   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.dHk", __pyx_clineno, __pyx_lineno, __pyx_filename);
9566   __pyx_r = NULL;
9567   __pyx_L0:;
9568   __Pyx_XGIVEREF(__pyx_r);
9569   __Pyx_RefNannyFinishContext();
9570   return __pyx_r;
9571 }
9572 
9573 /* "(tree fragment)":1
9574  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9575  *     cdef tuple state
9576  *     cdef object _dict
9577  */
9578 
9579 /* Python wrapper */
9580 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)9581 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9582   PyObject *__pyx_r = 0;
9583   __Pyx_RefNannyDeclarations
9584   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9585   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_8__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self));
9586 
9587   /* function exit code */
9588   __Pyx_RefNannyFinishContext();
9589   return __pyx_r;
9590 }
9591 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self)9592 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self) {
9593   PyObject *__pyx_v_state = 0;
9594   PyObject *__pyx_v__dict = 0;
9595   int __pyx_v_use_setstate;
9596   PyObject *__pyx_r = NULL;
9597   __Pyx_RefNannyDeclarations
9598   PyObject *__pyx_t_1 = NULL;
9599   PyObject *__pyx_t_2 = NULL;
9600   PyObject *__pyx_t_3 = NULL;
9601   PyObject *__pyx_t_4 = NULL;
9602   int __pyx_t_5;
9603   int __pyx_t_6;
9604   int __pyx_t_7;
9605   int __pyx_lineno = 0;
9606   const char *__pyx_filename = NULL;
9607   int __pyx_clineno = 0;
9608   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9609 
9610   /* "(tree fragment)":5
9611  *     cdef object _dict
9612  *     cdef bint use_setstate
9613  *     state = (self.H, self.H_time_var_index, self.R, self.R_square_root, self.R_time_var_index, self.dH, self.dR, self.index, self.svd_each_time)             # <<<<<<<<<<<<<<
9614  *     _dict = getattr(self, '__dict__', None)
9615  *     if _dict is not None:
9616  */
9617   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->H_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9618   __Pyx_GOTREF(__pyx_t_1);
9619   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.R_time_var_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
9620   __Pyx_GOTREF(__pyx_t_2);
9621   __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.svd_each_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
9622   __Pyx_GOTREF(__pyx_t_3);
9623   __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
9624   __Pyx_GOTREF(__pyx_t_4);
9625   __Pyx_INCREF(((PyObject *)__pyx_v_self->H));
9626   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->H));
9627   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->H));
9628   __Pyx_GIVEREF(__pyx_t_1);
9629   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9630   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.R));
9631   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.R));
9632   PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->__pyx_base.R));
9633   __Pyx_INCREF(__pyx_v_self->__pyx_base.R_square_root);
9634   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.R_square_root);
9635   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_self->__pyx_base.R_square_root);
9636   __Pyx_GIVEREF(__pyx_t_2);
9637   PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
9638   __Pyx_INCREF(((PyObject *)__pyx_v_self->dH));
9639   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dH));
9640   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_self->dH));
9641   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.dR));
9642   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.dR));
9643   PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_self->__pyx_base.dR));
9644   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.index));
9645   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.index));
9646   PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_self->__pyx_base.index));
9647   __Pyx_GIVEREF(__pyx_t_3);
9648   PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_3);
9649   __pyx_t_1 = 0;
9650   __pyx_t_2 = 0;
9651   __pyx_t_3 = 0;
9652   __pyx_v_state = ((PyObject*)__pyx_t_4);
9653   __pyx_t_4 = 0;
9654 
9655   /* "(tree fragment)":6
9656  *     cdef bint use_setstate
9657  *     state = (self.H, self.H_time_var_index, self.R, self.R_square_root, self.R_time_var_index, self.dH, self.dR, self.index, self.svd_each_time)
9658  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
9659  *     if _dict is not None:
9660  *         state += (_dict,)
9661  */
9662   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
9663   __Pyx_GOTREF(__pyx_t_4);
9664   __pyx_v__dict = __pyx_t_4;
9665   __pyx_t_4 = 0;
9666 
9667   /* "(tree fragment)":7
9668  *     state = (self.H, self.H_time_var_index, self.R, self.R_square_root, self.R_time_var_index, self.dH, self.dR, self.index, self.svd_each_time)
9669  *     _dict = getattr(self, '__dict__', None)
9670  *     if _dict is not None:             # <<<<<<<<<<<<<<
9671  *         state += (_dict,)
9672  *         use_setstate = True
9673  */
9674   __pyx_t_5 = (__pyx_v__dict != Py_None);
9675   __pyx_t_6 = (__pyx_t_5 != 0);
9676   if (__pyx_t_6) {
9677 
9678     /* "(tree fragment)":8
9679  *     _dict = getattr(self, '__dict__', None)
9680  *     if _dict is not None:
9681  *         state += (_dict,)             # <<<<<<<<<<<<<<
9682  *         use_setstate = True
9683  *     else:
9684  */
9685     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9686     __Pyx_GOTREF(__pyx_t_4);
9687     __Pyx_INCREF(__pyx_v__dict);
9688     __Pyx_GIVEREF(__pyx_v__dict);
9689     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
9690     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
9691     __Pyx_GOTREF(__pyx_t_3);
9692     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9693     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
9694     __pyx_t_3 = 0;
9695 
9696     /* "(tree fragment)":9
9697  *     if _dict is not None:
9698  *         state += (_dict,)
9699  *         use_setstate = True             # <<<<<<<<<<<<<<
9700  *     else:
9701  *         use_setstate = self.H is not None or self.R is not None or self.R_square_root is not None or self.dH is not None or self.dR is not None or self.index is not None
9702  */
9703     __pyx_v_use_setstate = 1;
9704 
9705     /* "(tree fragment)":7
9706  *     state = (self.H, self.H_time_var_index, self.R, self.R_square_root, self.R_time_var_index, self.dH, self.dR, self.index, self.svd_each_time)
9707  *     _dict = getattr(self, '__dict__', None)
9708  *     if _dict is not None:             # <<<<<<<<<<<<<<
9709  *         state += (_dict,)
9710  *         use_setstate = True
9711  */
9712     goto __pyx_L3;
9713   }
9714 
9715   /* "(tree fragment)":11
9716  *         use_setstate = True
9717  *     else:
9718  *         use_setstate = self.H is not None or self.R is not None or self.R_square_root is not None or self.dH is not None or self.dR is not None or self.index is not None             # <<<<<<<<<<<<<<
9719  *     if use_setstate:
9720  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, None), state
9721  */
9722   /*else*/ {
9723     __pyx_t_5 = (((PyObject *)__pyx_v_self->H) != Py_None);
9724     __pyx_t_7 = (__pyx_t_5 != 0);
9725     if (!__pyx_t_7) {
9726     } else {
9727       __pyx_t_6 = __pyx_t_7;
9728       goto __pyx_L4_bool_binop_done;
9729     }
9730     __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.R) != Py_None);
9731     __pyx_t_5 = (__pyx_t_7 != 0);
9732     if (!__pyx_t_5) {
9733     } else {
9734       __pyx_t_6 = __pyx_t_5;
9735       goto __pyx_L4_bool_binop_done;
9736     }
9737     __pyx_t_5 = (__pyx_v_self->__pyx_base.R_square_root != ((PyObject*)Py_None));
9738     __pyx_t_7 = (__pyx_t_5 != 0);
9739     if (!__pyx_t_7) {
9740     } else {
9741       __pyx_t_6 = __pyx_t_7;
9742       goto __pyx_L4_bool_binop_done;
9743     }
9744     __pyx_t_7 = (((PyObject *)__pyx_v_self->dH) != Py_None);
9745     __pyx_t_5 = (__pyx_t_7 != 0);
9746     if (!__pyx_t_5) {
9747     } else {
9748       __pyx_t_6 = __pyx_t_5;
9749       goto __pyx_L4_bool_binop_done;
9750     }
9751     __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.dR) != Py_None);
9752     __pyx_t_7 = (__pyx_t_5 != 0);
9753     if (!__pyx_t_7) {
9754     } else {
9755       __pyx_t_6 = __pyx_t_7;
9756       goto __pyx_L4_bool_binop_done;
9757     }
9758     __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.index) != Py_None);
9759     __pyx_t_5 = (__pyx_t_7 != 0);
9760     __pyx_t_6 = __pyx_t_5;
9761     __pyx_L4_bool_binop_done:;
9762     __pyx_v_use_setstate = __pyx_t_6;
9763   }
9764   __pyx_L3:;
9765 
9766   /* "(tree fragment)":12
9767  *     else:
9768  *         use_setstate = self.H is not None or self.R is not None or self.R_square_root is not None or self.dH is not None or self.dR is not None or self.index is not None
9769  *     if use_setstate:             # <<<<<<<<<<<<<<
9770  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, None), state
9771  *     else:
9772  */
9773   __pyx_t_6 = (__pyx_v_use_setstate != 0);
9774   if (__pyx_t_6) {
9775 
9776     /* "(tree fragment)":13
9777  *         use_setstate = self.H is not None or self.R is not None or self.R_square_root is not None or self.dH is not None or self.dR is not None or self.index is not None
9778  *     if use_setstate:
9779  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, None), state             # <<<<<<<<<<<<<<
9780  *     else:
9781  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, state)
9782  */
9783     __Pyx_XDECREF(__pyx_r);
9784     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Std_Measurement_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
9785     __Pyx_GOTREF(__pyx_t_3);
9786     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9787     __Pyx_GOTREF(__pyx_t_4);
9788     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9789     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9790     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9791     __Pyx_INCREF(__pyx_int_117883743);
9792     __Pyx_GIVEREF(__pyx_int_117883743);
9793     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_117883743);
9794     __Pyx_INCREF(Py_None);
9795     __Pyx_GIVEREF(Py_None);
9796     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
9797     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
9798     __Pyx_GOTREF(__pyx_t_2);
9799     __Pyx_GIVEREF(__pyx_t_3);
9800     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9801     __Pyx_GIVEREF(__pyx_t_4);
9802     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9803     __Pyx_INCREF(__pyx_v_state);
9804     __Pyx_GIVEREF(__pyx_v_state);
9805     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
9806     __pyx_t_3 = 0;
9807     __pyx_t_4 = 0;
9808     __pyx_r = __pyx_t_2;
9809     __pyx_t_2 = 0;
9810     goto __pyx_L0;
9811 
9812     /* "(tree fragment)":12
9813  *     else:
9814  *         use_setstate = self.H is not None or self.R is not None or self.R_square_root is not None or self.dH is not None or self.dR is not None or self.index is not None
9815  *     if use_setstate:             # <<<<<<<<<<<<<<
9816  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, None), state
9817  *     else:
9818  */
9819   }
9820 
9821   /* "(tree fragment)":15
9822  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, None), state
9823  *     else:
9824  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, state)             # <<<<<<<<<<<<<<
9825  * def __setstate_cython__(self, __pyx_state):
9826  *     __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(self, __pyx_state)
9827  */
9828   /*else*/ {
9829     __Pyx_XDECREF(__pyx_r);
9830     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Std_Measurement_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
9831     __Pyx_GOTREF(__pyx_t_2);
9832     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9833     __Pyx_GOTREF(__pyx_t_4);
9834     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9835     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9836     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9837     __Pyx_INCREF(__pyx_int_117883743);
9838     __Pyx_GIVEREF(__pyx_int_117883743);
9839     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_117883743);
9840     __Pyx_INCREF(__pyx_v_state);
9841     __Pyx_GIVEREF(__pyx_v_state);
9842     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
9843     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
9844     __Pyx_GOTREF(__pyx_t_3);
9845     __Pyx_GIVEREF(__pyx_t_2);
9846     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
9847     __Pyx_GIVEREF(__pyx_t_4);
9848     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
9849     __pyx_t_2 = 0;
9850     __pyx_t_4 = 0;
9851     __pyx_r = __pyx_t_3;
9852     __pyx_t_3 = 0;
9853     goto __pyx_L0;
9854   }
9855 
9856   /* "(tree fragment)":1
9857  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
9858  *     cdef tuple state
9859  *     cdef object _dict
9860  */
9861 
9862   /* function exit code */
9863   __pyx_L1_error:;
9864   __Pyx_XDECREF(__pyx_t_1);
9865   __Pyx_XDECREF(__pyx_t_2);
9866   __Pyx_XDECREF(__pyx_t_3);
9867   __Pyx_XDECREF(__pyx_t_4);
9868   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9869   __pyx_r = NULL;
9870   __pyx_L0:;
9871   __Pyx_XDECREF(__pyx_v_state);
9872   __Pyx_XDECREF(__pyx_v__dict);
9873   __Pyx_XGIVEREF(__pyx_r);
9874   __Pyx_RefNannyFinishContext();
9875   return __pyx_r;
9876 }
9877 
9878 /* "(tree fragment)":16
9879  *     else:
9880  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, state)
9881  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9882  *     __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(self, __pyx_state)
9883  */
9884 
9885 /* Python wrapper */
9886 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)9887 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9888   PyObject *__pyx_r = 0;
9889   __Pyx_RefNannyDeclarations
9890   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9891   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_10__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9892 
9893   /* function exit code */
9894   __Pyx_RefNannyFinishContext();
9895   return __pyx_r;
9896 }
9897 
__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)9898 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9899   PyObject *__pyx_r = NULL;
9900   __Pyx_RefNannyDeclarations
9901   PyObject *__pyx_t_1 = NULL;
9902   int __pyx_lineno = 0;
9903   const char *__pyx_filename = NULL;
9904   int __pyx_clineno = 0;
9905   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9906 
9907   /* "(tree fragment)":17
9908  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, state)
9909  * def __setstate_cython__(self, __pyx_state):
9910  *     __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
9911  */
9912   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9913   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Measurement_Callables_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9914   __Pyx_GOTREF(__pyx_t_1);
9915   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9916 
9917   /* "(tree fragment)":16
9918  *     else:
9919  *         return __pyx_unpickle_Std_Measurement_Callables_Cython, (type(self), 0x706c35f, state)
9920  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
9921  *     __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(self, __pyx_state)
9922  */
9923 
9924   /* function exit code */
9925   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9926   goto __pyx_L0;
9927   __pyx_L1_error:;
9928   __Pyx_XDECREF(__pyx_t_1);
9929   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Measurement_Callables_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9930   __pyx_r = NULL;
9931   __pyx_L0:;
9932   __Pyx_XGIVEREF(__pyx_r);
9933   __Pyx_RefNannyFinishContext();
9934   return __pyx_r;
9935 }
9936 
9937 /* "GPy/models/state_space_cython.pyx":222
9938  *         bint svd_each_time
9939  *
9940  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] Q, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
9941  *                  int Q_time_var_index, int p_unique_Q_number, np.ndarray[DTYPE_t, ndim=3] dQ = None):
9942  *         """
9943  */
9944 
9945 /* Python wrapper */
9946 static int __pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9947 static char __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__[] = "\n        Input:        \n        ---------------\n        Q - array with noise on various steps. The result of preprocessing\n            the noise input.\n        \n        index - for each step of Kalman filter contains the corresponding index\n                in the array.\n        \n        Q_time_var_index - another index in the array R. Computed earlier and passed here.\n        \n        unique_Q_number - number of unique noise matrices below which square roots\n            are cached and above which they are computed each time.\n            \n        dQ: 3D array[:, :, param_num]\n            derivative of Q. Derivative is supported only when Q do not change over time\n            \n        Output:\n        --------------\n        Object which has three necessary functions:\n            Qk(k)\n            dQk(k)\n            Q_srkt(k)\n        ";
9948 #if CYTHON_COMPILING_IN_CPYTHON
9949 struct wrapperbase __pyx_wrapperbase_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__;
9950 #endif
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9951 static int __pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9952   PyArrayObject *__pyx_v_Q = 0;
9953   PyArrayObject *__pyx_v_index = 0;
9954   int __pyx_v_Q_time_var_index;
9955   int __pyx_v_p_unique_Q_number;
9956   PyArrayObject *__pyx_v_dQ = 0;
9957   int __pyx_lineno = 0;
9958   const char *__pyx_filename = NULL;
9959   int __pyx_clineno = 0;
9960   int __pyx_r;
9961   __Pyx_RefNannyDeclarations
9962   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9963   {
9964     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_Q,&__pyx_n_s_index,&__pyx_n_s_Q_time_var_index,&__pyx_n_s_p_unique_Q_number,&__pyx_n_s_dQ,0};
9965     PyObject* values[5] = {0,0,0,0,0};
9966 
9967     /* "GPy/models/state_space_cython.pyx":223
9968  *
9969  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] Q, np.ndarray[DTYPE_t, ndim=2] index,
9970  *                  int Q_time_var_index, int p_unique_Q_number, np.ndarray[DTYPE_t, ndim=3] dQ = None):             # <<<<<<<<<<<<<<
9971  *         """
9972  *         Input:
9973  */
9974     values[4] = (PyObject *)((PyArrayObject *)Py_None);
9975     if (unlikely(__pyx_kwds)) {
9976       Py_ssize_t kw_args;
9977       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9978       switch (pos_args) {
9979         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
9980         CYTHON_FALLTHROUGH;
9981         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
9982         CYTHON_FALLTHROUGH;
9983         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9984         CYTHON_FALLTHROUGH;
9985         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9986         CYTHON_FALLTHROUGH;
9987         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9988         CYTHON_FALLTHROUGH;
9989         case  0: break;
9990         default: goto __pyx_L5_argtuple_error;
9991       }
9992       kw_args = PyDict_Size(__pyx_kwds);
9993       switch (pos_args) {
9994         case  0:
9995         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Q)) != 0)) kw_args--;
9996         else goto __pyx_L5_argtuple_error;
9997         CYTHON_FALLTHROUGH;
9998         case  1:
9999         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
10000         else {
10001           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 222, __pyx_L3_error)
10002         }
10003         CYTHON_FALLTHROUGH;
10004         case  2:
10005         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Q_time_var_index)) != 0)) kw_args--;
10006         else {
10007           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 222, __pyx_L3_error)
10008         }
10009         CYTHON_FALLTHROUGH;
10010         case  3:
10011         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_unique_Q_number)) != 0)) kw_args--;
10012         else {
10013           __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 222, __pyx_L3_error)
10014         }
10015         CYTHON_FALLTHROUGH;
10016         case  4:
10017         if (kw_args > 0) {
10018           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dQ);
10019           if (value) { values[4] = value; kw_args--; }
10020         }
10021       }
10022       if (unlikely(kw_args > 0)) {
10023         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
10024       }
10025     } else {
10026       switch (PyTuple_GET_SIZE(__pyx_args)) {
10027         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10028         CYTHON_FALLTHROUGH;
10029         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10030         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10031         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10032         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10033         break;
10034         default: goto __pyx_L5_argtuple_error;
10035       }
10036     }
10037     __pyx_v_Q = ((PyArrayObject *)values[0]);
10038     __pyx_v_index = ((PyArrayObject *)values[1]);
10039     __pyx_v_Q_time_var_index = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_Q_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error)
10040     __pyx_v_p_unique_Q_number = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_p_unique_Q_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 223, __pyx_L3_error)
10041     __pyx_v_dQ = ((PyArrayObject *)values[4]);
10042   }
10043   goto __pyx_L4_argument_unpacking_done;
10044   __pyx_L5_argtuple_error:;
10045   __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error)
10046   __pyx_L3_error:;
10047   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10048   __Pyx_RefNannyFinishContext();
10049   return -1;
10050   __pyx_L4_argument_unpacking_done:;
10051   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Q), __pyx_ptype_5numpy_ndarray, 1, "Q", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
10052   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 222, __pyx_L1_error)
10053   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dQ), __pyx_ptype_5numpy_ndarray, 1, "dQ", 0))) __PYX_ERR(0, 223, __pyx_L1_error)
10054   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self), __pyx_v_Q, __pyx_v_index, __pyx_v_Q_time_var_index, __pyx_v_p_unique_Q_number, __pyx_v_dQ);
10055 
10056   /* "GPy/models/state_space_cython.pyx":222
10057  *         bint svd_each_time
10058  *
10059  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] Q, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
10060  *                  int Q_time_var_index, int p_unique_Q_number, np.ndarray[DTYPE_t, ndim=3] dQ = None):
10061  *         """
10062  */
10063 
10064   /* function exit code */
10065   goto __pyx_L0;
10066   __pyx_L1_error:;
10067   __pyx_r = -1;
10068   __pyx_L0:;
10069   __Pyx_RefNannyFinishContext();
10070   return __pyx_r;
10071 }
10072 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,PyArrayObject * __pyx_v_Q,PyArrayObject * __pyx_v_index,int __pyx_v_Q_time_var_index,int __pyx_v_p_unique_Q_number,PyArrayObject * __pyx_v_dQ)10073 static int __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_index, int __pyx_v_Q_time_var_index, int __pyx_v_p_unique_Q_number, PyArrayObject *__pyx_v_dQ) {
10074   int __pyx_v_unique_len;
10075   __Pyx_LocalBuf_ND __pyx_pybuffernd_Q;
10076   __Pyx_Buffer __pyx_pybuffer_Q;
10077   __Pyx_LocalBuf_ND __pyx_pybuffernd_dQ;
10078   __Pyx_Buffer __pyx_pybuffer_dQ;
10079   __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
10080   __Pyx_Buffer __pyx_pybuffer_index;
10081   int __pyx_r;
10082   __Pyx_RefNannyDeclarations
10083   PyObject *__pyx_t_1 = NULL;
10084   PyObject *__pyx_t_2 = NULL;
10085   PyObject *__pyx_t_3 = NULL;
10086   Py_ssize_t __pyx_t_4;
10087   int __pyx_t_5;
10088   int __pyx_lineno = 0;
10089   const char *__pyx_filename = NULL;
10090   int __pyx_clineno = 0;
10091   __Pyx_RefNannySetupContext("__init__", 0);
10092   __pyx_pybuffer_Q.pybuffer.buf = NULL;
10093   __pyx_pybuffer_Q.refcount = 0;
10094   __pyx_pybuffernd_Q.data = NULL;
10095   __pyx_pybuffernd_Q.rcbuffer = &__pyx_pybuffer_Q;
10096   __pyx_pybuffer_index.pybuffer.buf = NULL;
10097   __pyx_pybuffer_index.refcount = 0;
10098   __pyx_pybuffernd_index.data = NULL;
10099   __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
10100   __pyx_pybuffer_dQ.pybuffer.buf = NULL;
10101   __pyx_pybuffer_dQ.refcount = 0;
10102   __pyx_pybuffernd_dQ.data = NULL;
10103   __pyx_pybuffernd_dQ.rcbuffer = &__pyx_pybuffer_dQ;
10104   {
10105     __Pyx_BufFmt_StackElem __pyx_stack[1];
10106     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q.rcbuffer->pybuffer, (PyObject*)__pyx_v_Q, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 222, __pyx_L1_error)
10107   }
10108   __pyx_pybuffernd_Q.diminfo[0].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q.diminfo[0].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q.diminfo[1].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q.diminfo[1].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_Q.diminfo[2].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_Q.diminfo[2].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[2];
10109   {
10110     __Pyx_BufFmt_StackElem __pyx_stack[1];
10111     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 222, __pyx_L1_error)
10112   }
10113   __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_index.diminfo[1].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_index.diminfo[1].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[1];
10114   {
10115     __Pyx_BufFmt_StackElem __pyx_stack[1];
10116     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer, (PyObject*)__pyx_v_dQ, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 222, __pyx_L1_error)
10117   }
10118   __pyx_pybuffernd_dQ.diminfo[0].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dQ.diminfo[0].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dQ.diminfo[1].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dQ.diminfo[1].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dQ.diminfo[2].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dQ.diminfo[2].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[2];
10119 
10120   /* "GPy/models/state_space_cython.pyx":249
10121  *         """
10122  *
10123  *         self.Q = Q             # <<<<<<<<<<<<<<
10124  *         self.index = index
10125  *         self.Q_time_var_index = Q_time_var_index
10126  */
10127   __Pyx_INCREF(((PyObject *)__pyx_v_Q));
10128   __Pyx_GIVEREF(((PyObject *)__pyx_v_Q));
10129   __Pyx_GOTREF(__pyx_v_self->Q);
10130   __Pyx_DECREF(((PyObject *)__pyx_v_self->Q));
10131   __pyx_v_self->Q = ((PyArrayObject *)__pyx_v_Q);
10132 
10133   /* "GPy/models/state_space_cython.pyx":250
10134  *
10135  *         self.Q = Q
10136  *         self.index = index             # <<<<<<<<<<<<<<
10137  *         self.Q_time_var_index = Q_time_var_index
10138  *         self.dQ = dQ
10139  */
10140   __Pyx_INCREF(((PyObject *)__pyx_v_index));
10141   __Pyx_GIVEREF(((PyObject *)__pyx_v_index));
10142   __Pyx_GOTREF(__pyx_v_self->index);
10143   __Pyx_DECREF(((PyObject *)__pyx_v_self->index));
10144   __pyx_v_self->index = ((PyArrayObject *)__pyx_v_index);
10145 
10146   /* "GPy/models/state_space_cython.pyx":251
10147  *         self.Q = Q
10148  *         self.index = index
10149  *         self.Q_time_var_index = Q_time_var_index             # <<<<<<<<<<<<<<
10150  *         self.dQ = dQ
10151  *
10152  */
10153   __pyx_v_self->Q_time_var_index = __pyx_v_Q_time_var_index;
10154 
10155   /* "GPy/models/state_space_cython.pyx":252
10156  *         self.index = index
10157  *         self.Q_time_var_index = Q_time_var_index
10158  *         self.dQ = dQ             # <<<<<<<<<<<<<<
10159  *
10160  *         cdef int unique_len = len(np.unique(index))
10161  */
10162   __Pyx_INCREF(((PyObject *)__pyx_v_dQ));
10163   __Pyx_GIVEREF(((PyObject *)__pyx_v_dQ));
10164   __Pyx_GOTREF(__pyx_v_self->dQ);
10165   __Pyx_DECREF(((PyObject *)__pyx_v_self->dQ));
10166   __pyx_v_self->dQ = ((PyArrayObject *)__pyx_v_dQ);
10167 
10168   /* "GPy/models/state_space_cython.pyx":254
10169  *         self.dQ = dQ
10170  *
10171  *         cdef int unique_len = len(np.unique(index))             # <<<<<<<<<<<<<<
10172  *
10173  *         if (unique_len > p_unique_Q_number):
10174  */
10175   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
10176   __Pyx_GOTREF(__pyx_t_2);
10177   __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
10178   __Pyx_GOTREF(__pyx_t_3);
10179   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10180   __pyx_t_2 = NULL;
10181   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
10182     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
10183     if (likely(__pyx_t_2)) {
10184       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
10185       __Pyx_INCREF(__pyx_t_2);
10186       __Pyx_INCREF(function);
10187       __Pyx_DECREF_SET(__pyx_t_3, function);
10188     }
10189   }
10190   __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, ((PyObject *)__pyx_v_index)) : __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_index));
10191   __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
10192   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
10193   __Pyx_GOTREF(__pyx_t_1);
10194   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10195   __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 254, __pyx_L1_error)
10196   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10197   __pyx_v_unique_len = __pyx_t_4;
10198 
10199   /* "GPy/models/state_space_cython.pyx":256
10200  *         cdef int unique_len = len(np.unique(index))
10201  *
10202  *         if (unique_len > p_unique_Q_number):             # <<<<<<<<<<<<<<
10203  *             self.svd_each_time = True
10204  *         else:
10205  */
10206   __pyx_t_5 = ((__pyx_v_unique_len > __pyx_v_p_unique_Q_number) != 0);
10207   if (__pyx_t_5) {
10208 
10209     /* "GPy/models/state_space_cython.pyx":257
10210  *
10211  *         if (unique_len > p_unique_Q_number):
10212  *             self.svd_each_time = True             # <<<<<<<<<<<<<<
10213  *         else:
10214  *             self.svd_each_time = False
10215  */
10216     __pyx_v_self->svd_each_time = 1;
10217 
10218     /* "GPy/models/state_space_cython.pyx":256
10219  *         cdef int unique_len = len(np.unique(index))
10220  *
10221  *         if (unique_len > p_unique_Q_number):             # <<<<<<<<<<<<<<
10222  *             self.svd_each_time = True
10223  *         else:
10224  */
10225     goto __pyx_L3;
10226   }
10227 
10228   /* "GPy/models/state_space_cython.pyx":259
10229  *             self.svd_each_time = True
10230  *         else:
10231  *             self.svd_each_time = False             # <<<<<<<<<<<<<<
10232  *
10233  *         self.Q_square_root = {}
10234  */
10235   /*else*/ {
10236     __pyx_v_self->svd_each_time = 0;
10237   }
10238   __pyx_L3:;
10239 
10240   /* "GPy/models/state_space_cython.pyx":261
10241  *             self.svd_each_time = False
10242  *
10243  *         self.Q_square_root = {}             # <<<<<<<<<<<<<<
10244  *
10245  *
10246  */
10247   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error)
10248   __Pyx_GOTREF(__pyx_t_1);
10249   __Pyx_GIVEREF(__pyx_t_1);
10250   __Pyx_GOTREF(__pyx_v_self->Q_square_root);
10251   __Pyx_DECREF(__pyx_v_self->Q_square_root);
10252   __pyx_v_self->Q_square_root = ((PyObject*)__pyx_t_1);
10253   __pyx_t_1 = 0;
10254 
10255   /* "GPy/models/state_space_cython.pyx":222
10256  *         bint svd_each_time
10257  *
10258  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] Q, np.ndarray[DTYPE_t, ndim=2] index,             # <<<<<<<<<<<<<<
10259  *                  int Q_time_var_index, int p_unique_Q_number, np.ndarray[DTYPE_t, ndim=3] dQ = None):
10260  *         """
10261  */
10262 
10263   /* function exit code */
10264   __pyx_r = 0;
10265   goto __pyx_L0;
10266   __pyx_L1_error:;
10267   __Pyx_XDECREF(__pyx_t_1);
10268   __Pyx_XDECREF(__pyx_t_2);
10269   __Pyx_XDECREF(__pyx_t_3);
10270   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10271     __Pyx_PyThreadState_declare
10272     __Pyx_PyThreadState_assign
10273     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10274     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
10275     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
10276     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
10277   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10278   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10279   __pyx_r = -1;
10280   goto __pyx_L2;
10281   __pyx_L0:;
10282   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
10283   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
10284   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
10285   __pyx_L2:;
10286   __Pyx_RefNannyFinishContext();
10287   return __pyx_r;
10288 }
10289 
10290 /* "GPy/models/state_space_cython.pyx":264
10291  *
10292  *
10293  *     cpdef Qk(self, int k):             # <<<<<<<<<<<<<<
10294  *         """
10295  *         function (k). Returns noise matrix of dynamic model on iteration k.
10296  */
10297 
10298 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)10299 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
10300   PyObject *__pyx_r = NULL;
10301   __Pyx_RefNannyDeclarations
10302   PyObject *__pyx_t_1 = NULL;
10303   PyObject *__pyx_t_2 = NULL;
10304   PyObject *__pyx_t_3 = NULL;
10305   PyObject *__pyx_t_4 = NULL;
10306   PyObject *__pyx_t_5 = NULL;
10307   int __pyx_t_6;
10308   int __pyx_lineno = 0;
10309   const char *__pyx_filename = NULL;
10310   int __pyx_clineno = 0;
10311   __Pyx_RefNannySetupContext("Qk", 0);
10312   /* Check if called by wrapper */
10313   if (unlikely(__pyx_skip_dispatch)) ;
10314   /* Check if overridden in Python */
10315   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10316     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10317     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10318     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10319       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10320       #endif
10321       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Qk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
10322       __Pyx_GOTREF(__pyx_t_1);
10323       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk)) {
10324         __Pyx_XDECREF(__pyx_r);
10325         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error)
10326         __Pyx_GOTREF(__pyx_t_3);
10327         __Pyx_INCREF(__pyx_t_1);
10328         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
10329         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10330           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10331           if (likely(__pyx_t_5)) {
10332             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10333             __Pyx_INCREF(__pyx_t_5);
10334             __Pyx_INCREF(function);
10335             __Pyx_DECREF_SET(__pyx_t_4, function);
10336           }
10337         }
10338         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
10339         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10340         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10341         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
10342         __Pyx_GOTREF(__pyx_t_2);
10343         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10344         __pyx_r = __pyx_t_2;
10345         __pyx_t_2 = 0;
10346         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10347         goto __pyx_L0;
10348       }
10349       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10350       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10351       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10352       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10353         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10354       }
10355       #endif
10356       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10357       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10358     }
10359     #endif
10360   }
10361 
10362   /* "GPy/models/state_space_cython.pyx":269
10363  *                 k (iteration number). starts at 0
10364  *         """
10365  *         return self.Q[:,:, <int>self.index[self.Q_time_var_index, k]]             # <<<<<<<<<<<<<<
10366  *
10367  *     cpdef dQk(self, int k):
10368  */
10369   __Pyx_XDECREF(__pyx_r);
10370   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->Q_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
10371   __Pyx_GOTREF(__pyx_t_1);
10372   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
10373   __Pyx_GOTREF(__pyx_t_2);
10374   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
10375   __Pyx_GOTREF(__pyx_t_4);
10376   __Pyx_GIVEREF(__pyx_t_1);
10377   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10378   __Pyx_GIVEREF(__pyx_t_2);
10379   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
10380   __pyx_t_1 = 0;
10381   __pyx_t_2 = 0;
10382   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
10383   __Pyx_GOTREF(__pyx_t_2);
10384   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10385   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L1_error)
10386   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10387   __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
10388   __Pyx_GOTREF(__pyx_t_2);
10389   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
10390   __Pyx_GOTREF(__pyx_t_4);
10391   __Pyx_INCREF(__pyx_slice__10);
10392   __Pyx_GIVEREF(__pyx_slice__10);
10393   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
10394   __Pyx_INCREF(__pyx_slice__10);
10395   __Pyx_GIVEREF(__pyx_slice__10);
10396   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
10397   __Pyx_GIVEREF(__pyx_t_2);
10398   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
10399   __pyx_t_2 = 0;
10400   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Q), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
10401   __Pyx_GOTREF(__pyx_t_2);
10402   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10403   __pyx_r = __pyx_t_2;
10404   __pyx_t_2 = 0;
10405   goto __pyx_L0;
10406 
10407   /* "GPy/models/state_space_cython.pyx":264
10408  *
10409  *
10410  *     cpdef Qk(self, int k):             # <<<<<<<<<<<<<<
10411  *         """
10412  *         function (k). Returns noise matrix of dynamic model on iteration k.
10413  */
10414 
10415   /* function exit code */
10416   __pyx_L1_error:;
10417   __Pyx_XDECREF(__pyx_t_1);
10418   __Pyx_XDECREF(__pyx_t_2);
10419   __Pyx_XDECREF(__pyx_t_3);
10420   __Pyx_XDECREF(__pyx_t_4);
10421   __Pyx_XDECREF(__pyx_t_5);
10422   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10423   __pyx_r = 0;
10424   __pyx_L0:;
10425   __Pyx_XGIVEREF(__pyx_r);
10426   __Pyx_RefNannyFinishContext();
10427   return __pyx_r;
10428 }
10429 
10430 /* Python wrapper */
10431 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
10432 static char __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk[] = "\n        function (k). Returns noise matrix of dynamic model on iteration k.\n                k (iteration number). starts at 0\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)10433 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
10434   int __pyx_v_k;
10435   int __pyx_lineno = 0;
10436   const char *__pyx_filename = NULL;
10437   int __pyx_clineno = 0;
10438   PyObject *__pyx_r = 0;
10439   __Pyx_RefNannyDeclarations
10440   __Pyx_RefNannySetupContext("Qk (wrapper)", 0);
10441   assert(__pyx_arg_k); {
10442     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L3_error)
10443   }
10444   goto __pyx_L4_argument_unpacking_done;
10445   __pyx_L3_error:;
10446   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10447   __Pyx_RefNannyFinishContext();
10448   return NULL;
10449   __pyx_L4_argument_unpacking_done:;
10450   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
10451 
10452   /* function exit code */
10453   __Pyx_RefNannyFinishContext();
10454   return __pyx_r;
10455 }
10456 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,int __pyx_v_k)10457 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k) {
10458   PyObject *__pyx_r = NULL;
10459   __Pyx_RefNannyDeclarations
10460   PyObject *__pyx_t_1 = NULL;
10461   int __pyx_lineno = 0;
10462   const char *__pyx_filename = NULL;
10463   int __pyx_clineno = 0;
10464   __Pyx_RefNannySetupContext("Qk", 0);
10465   __Pyx_XDECREF(__pyx_r);
10466   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Qk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
10467   __Pyx_GOTREF(__pyx_t_1);
10468   __pyx_r = __pyx_t_1;
10469   __pyx_t_1 = 0;
10470   goto __pyx_L0;
10471 
10472   /* function exit code */
10473   __pyx_L1_error:;
10474   __Pyx_XDECREF(__pyx_t_1);
10475   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10476   __pyx_r = NULL;
10477   __pyx_L0:;
10478   __Pyx_XGIVEREF(__pyx_r);
10479   __Pyx_RefNannyFinishContext();
10480   return __pyx_r;
10481 }
10482 
10483 /* "GPy/models/state_space_cython.pyx":271
10484  *         return self.Q[:,:, <int>self.index[self.Q_time_var_index, k]]
10485  *
10486  *     cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
10487  *         if self.dQ is None:
10488  *             raise ValueError("dQ derivative is None")
10489  */
10490 
10491 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)10492 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
10493   PyObject *__pyx_r = NULL;
10494   __Pyx_RefNannyDeclarations
10495   PyObject *__pyx_t_1 = NULL;
10496   PyObject *__pyx_t_2 = NULL;
10497   PyObject *__pyx_t_3 = NULL;
10498   PyObject *__pyx_t_4 = NULL;
10499   PyObject *__pyx_t_5 = NULL;
10500   int __pyx_t_6;
10501   int __pyx_t_7;
10502   int __pyx_lineno = 0;
10503   const char *__pyx_filename = NULL;
10504   int __pyx_clineno = 0;
10505   __Pyx_RefNannySetupContext("dQk", 0);
10506   /* Check if called by wrapper */
10507   if (unlikely(__pyx_skip_dispatch)) ;
10508   /* Check if overridden in Python */
10509   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10510     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10511     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10512     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10513       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10514       #endif
10515       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dQk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
10516       __Pyx_GOTREF(__pyx_t_1);
10517       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk)) {
10518         __Pyx_XDECREF(__pyx_r);
10519         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
10520         __Pyx_GOTREF(__pyx_t_3);
10521         __Pyx_INCREF(__pyx_t_1);
10522         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
10523         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10524           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10525           if (likely(__pyx_t_5)) {
10526             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10527             __Pyx_INCREF(__pyx_t_5);
10528             __Pyx_INCREF(function);
10529             __Pyx_DECREF_SET(__pyx_t_4, function);
10530           }
10531         }
10532         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
10533         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10534         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10535         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
10536         __Pyx_GOTREF(__pyx_t_2);
10537         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10538         __pyx_r = __pyx_t_2;
10539         __pyx_t_2 = 0;
10540         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10541         goto __pyx_L0;
10542       }
10543       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10544       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10545       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10546       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10547         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10548       }
10549       #endif
10550       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10551       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10552     }
10553     #endif
10554   }
10555 
10556   /* "GPy/models/state_space_cython.pyx":272
10557  *
10558  *     cpdef dQk(self, int k):
10559  *         if self.dQ is None:             # <<<<<<<<<<<<<<
10560  *             raise ValueError("dQ derivative is None")
10561  *
10562  */
10563   __pyx_t_6 = (((PyObject *)__pyx_v_self->dQ) == Py_None);
10564   __pyx_t_7 = (__pyx_t_6 != 0);
10565   if (unlikely(__pyx_t_7)) {
10566 
10567     /* "GPy/models/state_space_cython.pyx":273
10568  *     cpdef dQk(self, int k):
10569  *         if self.dQ is None:
10570  *             raise ValueError("dQ derivative is None")             # <<<<<<<<<<<<<<
10571  *
10572  *         return self.dQ # the same dirivative on each iteration
10573  */
10574     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
10575     __Pyx_GOTREF(__pyx_t_1);
10576     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
10577     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10578     __PYX_ERR(0, 273, __pyx_L1_error)
10579 
10580     /* "GPy/models/state_space_cython.pyx":272
10581  *
10582  *     cpdef dQk(self, int k):
10583  *         if self.dQ is None:             # <<<<<<<<<<<<<<
10584  *             raise ValueError("dQ derivative is None")
10585  *
10586  */
10587   }
10588 
10589   /* "GPy/models/state_space_cython.pyx":275
10590  *             raise ValueError("dQ derivative is None")
10591  *
10592  *         return self.dQ # the same dirivative on each iteration             # <<<<<<<<<<<<<<
10593  *
10594  *     cpdef Q_srk(self, int k):
10595  */
10596   __Pyx_XDECREF(__pyx_r);
10597   __Pyx_INCREF(((PyObject *)__pyx_v_self->dQ));
10598   __pyx_r = ((PyObject *)__pyx_v_self->dQ);
10599   goto __pyx_L0;
10600 
10601   /* "GPy/models/state_space_cython.pyx":271
10602  *         return self.Q[:,:, <int>self.index[self.Q_time_var_index, k]]
10603  *
10604  *     cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
10605  *         if self.dQ is None:
10606  *             raise ValueError("dQ derivative is None")
10607  */
10608 
10609   /* function exit code */
10610   __pyx_L1_error:;
10611   __Pyx_XDECREF(__pyx_t_1);
10612   __Pyx_XDECREF(__pyx_t_2);
10613   __Pyx_XDECREF(__pyx_t_3);
10614   __Pyx_XDECREF(__pyx_t_4);
10615   __Pyx_XDECREF(__pyx_t_5);
10616   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10617   __pyx_r = 0;
10618   __pyx_L0:;
10619   __Pyx_XGIVEREF(__pyx_r);
10620   __Pyx_RefNannyFinishContext();
10621   return __pyx_r;
10622 }
10623 
10624 /* Python wrapper */
10625 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)10626 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
10627   int __pyx_v_k;
10628   int __pyx_lineno = 0;
10629   const char *__pyx_filename = NULL;
10630   int __pyx_clineno = 0;
10631   PyObject *__pyx_r = 0;
10632   __Pyx_RefNannyDeclarations
10633   __Pyx_RefNannySetupContext("dQk (wrapper)", 0);
10634   assert(__pyx_arg_k); {
10635     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 271, __pyx_L3_error)
10636   }
10637   goto __pyx_L4_argument_unpacking_done;
10638   __pyx_L3_error:;
10639   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10640   __Pyx_RefNannyFinishContext();
10641   return NULL;
10642   __pyx_L4_argument_unpacking_done:;
10643   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_4dQk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
10644 
10645   /* function exit code */
10646   __Pyx_RefNannyFinishContext();
10647   return __pyx_r;
10648 }
10649 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_4dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,int __pyx_v_k)10650 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_4dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k) {
10651   PyObject *__pyx_r = NULL;
10652   __Pyx_RefNannyDeclarations
10653   PyObject *__pyx_t_1 = NULL;
10654   int __pyx_lineno = 0;
10655   const char *__pyx_filename = NULL;
10656   int __pyx_clineno = 0;
10657   __Pyx_RefNannySetupContext("dQk", 0);
10658   __Pyx_XDECREF(__pyx_r);
10659   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_dQk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
10660   __Pyx_GOTREF(__pyx_t_1);
10661   __pyx_r = __pyx_t_1;
10662   __pyx_t_1 = 0;
10663   goto __pyx_L0;
10664 
10665   /* function exit code */
10666   __pyx_L1_error:;
10667   __Pyx_XDECREF(__pyx_t_1);
10668   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
10669   __pyx_r = NULL;
10670   __pyx_L0:;
10671   __Pyx_XGIVEREF(__pyx_r);
10672   __Pyx_RefNannyFinishContext();
10673   return __pyx_r;
10674 }
10675 
10676 /* "GPy/models/state_space_cython.pyx":277
10677  *         return self.dQ # the same dirivative on each iteration
10678  *
10679  *     cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
10680  *         """
10681  *         function (k). Returns the square root of noise matrix of dynamic model on iteration k.
10682  */
10683 
10684 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)10685 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
10686   int __pyx_v_ind;
10687   PyArrayObject *__pyx_v_Q = 0;
10688   PyArrayObject *__pyx_v_square_root = 0;
10689   PyArrayObject *__pyx_v_U = 0;
10690   PyArrayObject *__pyx_v_S = 0;
10691   CYTHON_UNUSED PyArrayObject *__pyx_v_Vh = 0;
10692   __Pyx_LocalBuf_ND __pyx_pybuffernd_Q;
10693   __Pyx_Buffer __pyx_pybuffer_Q;
10694   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
10695   __Pyx_Buffer __pyx_pybuffer_S;
10696   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
10697   __Pyx_Buffer __pyx_pybuffer_U;
10698   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
10699   __Pyx_Buffer __pyx_pybuffer_Vh;
10700   __Pyx_LocalBuf_ND __pyx_pybuffernd_square_root;
10701   __Pyx_Buffer __pyx_pybuffer_square_root;
10702   PyObject *__pyx_r = NULL;
10703   __Pyx_RefNannyDeclarations
10704   PyObject *__pyx_t_1 = NULL;
10705   PyObject *__pyx_t_2 = NULL;
10706   PyObject *__pyx_t_3 = NULL;
10707   PyObject *__pyx_t_4 = NULL;
10708   PyObject *__pyx_t_5 = NULL;
10709   int __pyx_t_6;
10710   PyArrayObject *__pyx_t_7 = NULL;
10711   int __pyx_t_8;
10712   PyArrayObject *__pyx_t_9 = NULL;
10713   PyObject *__pyx_t_10 = NULL;
10714   PyObject *__pyx_t_11 = NULL;
10715   PyObject *__pyx_t_12 = NULL;
10716   PyObject *(*__pyx_t_13)(PyObject *);
10717   PyArrayObject *__pyx_t_14 = NULL;
10718   PyArrayObject *__pyx_t_15 = NULL;
10719   PyArrayObject *__pyx_t_16 = NULL;
10720   int __pyx_t_17;
10721   int __pyx_lineno = 0;
10722   const char *__pyx_filename = NULL;
10723   int __pyx_clineno = 0;
10724   __Pyx_RefNannySetupContext("Q_srk", 0);
10725   __pyx_pybuffer_Q.pybuffer.buf = NULL;
10726   __pyx_pybuffer_Q.refcount = 0;
10727   __pyx_pybuffernd_Q.data = NULL;
10728   __pyx_pybuffernd_Q.rcbuffer = &__pyx_pybuffer_Q;
10729   __pyx_pybuffer_square_root.pybuffer.buf = NULL;
10730   __pyx_pybuffer_square_root.refcount = 0;
10731   __pyx_pybuffernd_square_root.data = NULL;
10732   __pyx_pybuffernd_square_root.rcbuffer = &__pyx_pybuffer_square_root;
10733   __pyx_pybuffer_U.pybuffer.buf = NULL;
10734   __pyx_pybuffer_U.refcount = 0;
10735   __pyx_pybuffernd_U.data = NULL;
10736   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
10737   __pyx_pybuffer_S.pybuffer.buf = NULL;
10738   __pyx_pybuffer_S.refcount = 0;
10739   __pyx_pybuffernd_S.data = NULL;
10740   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
10741   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
10742   __pyx_pybuffer_Vh.refcount = 0;
10743   __pyx_pybuffernd_Vh.data = NULL;
10744   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
10745   /* Check if called by wrapper */
10746   if (unlikely(__pyx_skip_dispatch)) ;
10747   /* Check if overridden in Python */
10748   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
10749     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10750     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10751     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
10752       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10753       #endif
10754       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_srk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
10755       __Pyx_GOTREF(__pyx_t_1);
10756       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk)) {
10757         __Pyx_XDECREF(__pyx_r);
10758         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
10759         __Pyx_GOTREF(__pyx_t_3);
10760         __Pyx_INCREF(__pyx_t_1);
10761         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
10762         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
10763           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
10764           if (likely(__pyx_t_5)) {
10765             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
10766             __Pyx_INCREF(__pyx_t_5);
10767             __Pyx_INCREF(function);
10768             __Pyx_DECREF_SET(__pyx_t_4, function);
10769           }
10770         }
10771         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
10772         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10773         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10774         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
10775         __Pyx_GOTREF(__pyx_t_2);
10776         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10777         __pyx_r = __pyx_t_2;
10778         __pyx_t_2 = 0;
10779         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10780         goto __pyx_L0;
10781       }
10782       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10783       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
10784       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
10785       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
10786         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
10787       }
10788       #endif
10789       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10790       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
10791     }
10792     #endif
10793   }
10794 
10795   /* "GPy/models/state_space_cython.pyx":284
10796  *         This function is implemented to use SVD prediction step.
10797  *         """
10798  *         cdef int ind = <int>self.index[self.Q_time_var_index, k]             # <<<<<<<<<<<<<<
10799  *         cdef np.ndarray[DTYPE_t, ndim=2] Q = self.Q[:,:, ind]
10800  *
10801  */
10802   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->Q_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error)
10803   __Pyx_GOTREF(__pyx_t_1);
10804   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
10805   __Pyx_GOTREF(__pyx_t_2);
10806   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
10807   __Pyx_GOTREF(__pyx_t_4);
10808   __Pyx_GIVEREF(__pyx_t_1);
10809   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
10810   __Pyx_GIVEREF(__pyx_t_2);
10811   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
10812   __pyx_t_1 = 0;
10813   __pyx_t_2 = 0;
10814   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
10815   __Pyx_GOTREF(__pyx_t_2);
10816   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10817   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 284, __pyx_L1_error)
10818   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10819   __pyx_v_ind = ((int)__pyx_t_6);
10820 
10821   /* "GPy/models/state_space_cython.pyx":285
10822  *         """
10823  *         cdef int ind = <int>self.index[self.Q_time_var_index, k]
10824  *         cdef np.ndarray[DTYPE_t, ndim=2] Q = self.Q[:,:, ind]             # <<<<<<<<<<<<<<
10825  *
10826  *
10827  */
10828   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
10829   __Pyx_GOTREF(__pyx_t_2);
10830   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
10831   __Pyx_GOTREF(__pyx_t_4);
10832   __Pyx_INCREF(__pyx_slice__10);
10833   __Pyx_GIVEREF(__pyx_slice__10);
10834   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
10835   __Pyx_INCREF(__pyx_slice__10);
10836   __Pyx_GIVEREF(__pyx_slice__10);
10837   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
10838   __Pyx_GIVEREF(__pyx_t_2);
10839   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
10840   __pyx_t_2 = 0;
10841   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Q), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
10842   __Pyx_GOTREF(__pyx_t_2);
10843   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10844   if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 285, __pyx_L1_error)
10845   __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
10846   {
10847     __Pyx_BufFmt_StackElem __pyx_stack[1];
10848     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
10849       __pyx_v_Q = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q.rcbuffer->pybuffer.buf = NULL;
10850       __PYX_ERR(0, 285, __pyx_L1_error)
10851     } else {__pyx_pybuffernd_Q.diminfo[0].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q.diminfo[0].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q.diminfo[1].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q.diminfo[1].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[1];
10852     }
10853   }
10854   __pyx_t_7 = 0;
10855   __pyx_v_Q = ((PyArrayObject *)__pyx_t_2);
10856   __pyx_t_2 = 0;
10857 
10858   /* "GPy/models/state_space_cython.pyx":294
10859  *         cdef np.ndarray[DTYPE_t, ndim=2] Vh
10860  *
10861  *         if (Q.shape[0] == 1): # 1-D case handle simplier. No storage             # <<<<<<<<<<<<<<
10862  *         # of the result, just compute it each time.
10863  *             square_root = np.sqrt( Q )
10864  */
10865   __pyx_t_8 = (((__pyx_v_Q->dimensions[0]) == 1) != 0);
10866   if (__pyx_t_8) {
10867 
10868     /* "GPy/models/state_space_cython.pyx":296
10869  *         if (Q.shape[0] == 1): # 1-D case handle simplier. No storage
10870  *         # of the result, just compute it each time.
10871  *             square_root = np.sqrt( Q )             # <<<<<<<<<<<<<<
10872  *         else:
10873  *             if self.svd_each_time:
10874  */
10875     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
10876     __Pyx_GOTREF(__pyx_t_4);
10877     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
10878     __Pyx_GOTREF(__pyx_t_1);
10879     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10880     __pyx_t_4 = NULL;
10881     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
10882       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
10883       if (likely(__pyx_t_4)) {
10884         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10885         __Pyx_INCREF(__pyx_t_4);
10886         __Pyx_INCREF(function);
10887         __Pyx_DECREF_SET(__pyx_t_1, function);
10888       }
10889     }
10890     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, ((PyObject *)__pyx_v_Q)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_Q));
10891     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10892     if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
10893     __Pyx_GOTREF(__pyx_t_2);
10894     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10895     if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 296, __pyx_L1_error)
10896     __pyx_t_9 = ((PyArrayObject *)__pyx_t_2);
10897     {
10898       __Pyx_BufFmt_StackElem __pyx_stack[1];
10899       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
10900       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
10901       if (unlikely(__pyx_t_6 < 0)) {
10902         PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
10903         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
10904           Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
10905           __Pyx_RaiseBufferFallbackError();
10906         } else {
10907           PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
10908         }
10909         __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
10910       }
10911       __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
10912       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
10913     }
10914     __pyx_t_9 = 0;
10915     __pyx_v_square_root = ((PyArrayObject *)__pyx_t_2);
10916     __pyx_t_2 = 0;
10917 
10918     /* "GPy/models/state_space_cython.pyx":294
10919  *         cdef np.ndarray[DTYPE_t, ndim=2] Vh
10920  *
10921  *         if (Q.shape[0] == 1): # 1-D case handle simplier. No storage             # <<<<<<<<<<<<<<
10922  *         # of the result, just compute it each time.
10923  *             square_root = np.sqrt( Q )
10924  */
10925     goto __pyx_L3;
10926   }
10927 
10928   /* "GPy/models/state_space_cython.pyx":298
10929  *             square_root = np.sqrt( Q )
10930  *         else:
10931  *             if self.svd_each_time:             # <<<<<<<<<<<<<<
10932  *
10933  *                 U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,
10934  */
10935   /*else*/ {
10936     __pyx_t_8 = (__pyx_v_self->svd_each_time != 0);
10937     if (__pyx_t_8) {
10938 
10939       /* "GPy/models/state_space_cython.pyx":300
10940  *             if self.svd_each_time:
10941  *
10942  *                 U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
10943  *                           overwrite_a=False,check_finite=True)
10944  *
10945  */
10946       __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
10947       __Pyx_GOTREF(__pyx_t_2);
10948       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_linalg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
10949       __Pyx_GOTREF(__pyx_t_1);
10950       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10951       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_svd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
10952       __Pyx_GOTREF(__pyx_t_2);
10953       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10954       __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
10955       __Pyx_GOTREF(__pyx_t_1);
10956       __Pyx_INCREF(((PyObject *)__pyx_v_Q));
10957       __Pyx_GIVEREF(((PyObject *)__pyx_v_Q));
10958       PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Q));
10959       __pyx_t_4 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
10960       __Pyx_GOTREF(__pyx_t_4);
10961       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
10962       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
10963 
10964       /* "GPy/models/state_space_cython.pyx":301
10965  *
10966  *                 U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,
10967  *                           overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
10968  *
10969  *                 square_root = U * np.sqrt(S)
10970  */
10971       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
10972       if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
10973 
10974       /* "GPy/models/state_space_cython.pyx":300
10975  *             if self.svd_each_time:
10976  *
10977  *                 U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
10978  *                           overwrite_a=False,check_finite=True)
10979  *
10980  */
10981       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 300, __pyx_L1_error)
10982       __Pyx_GOTREF(__pyx_t_3);
10983       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10984       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10985       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10986       if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
10987         PyObject* sequence = __pyx_t_3;
10988         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10989         if (unlikely(size != 3)) {
10990           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
10991           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10992           __PYX_ERR(0, 300, __pyx_L1_error)
10993         }
10994         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10995         if (likely(PyTuple_CheckExact(sequence))) {
10996           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10997           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
10998           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
10999         } else {
11000           __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
11001           __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
11002           __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
11003         }
11004         __Pyx_INCREF(__pyx_t_4);
11005         __Pyx_INCREF(__pyx_t_1);
11006         __Pyx_INCREF(__pyx_t_2);
11007         #else
11008         __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
11009         __Pyx_GOTREF(__pyx_t_4);
11010         __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error)
11011         __Pyx_GOTREF(__pyx_t_1);
11012         __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error)
11013         __Pyx_GOTREF(__pyx_t_2);
11014         #endif
11015         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11016       } else {
11017         Py_ssize_t index = -1;
11018         __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
11019         __Pyx_GOTREF(__pyx_t_5);
11020         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11021         __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
11022         index = 0; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
11023         __Pyx_GOTREF(__pyx_t_4);
11024         index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
11025         __Pyx_GOTREF(__pyx_t_1);
11026         index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
11027         __Pyx_GOTREF(__pyx_t_2);
11028         if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 300, __pyx_L1_error)
11029         __pyx_t_13 = NULL;
11030         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11031         goto __pyx_L6_unpacking_done;
11032         __pyx_L5_unpacking_failed:;
11033         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11034         __pyx_t_13 = NULL;
11035         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
11036         __PYX_ERR(0, 300, __pyx_L1_error)
11037         __pyx_L6_unpacking_done:;
11038       }
11039       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 300, __pyx_L1_error)
11040       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 300, __pyx_L1_error)
11041       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 300, __pyx_L1_error)
11042       __pyx_t_14 = ((PyArrayObject *)__pyx_t_4);
11043       {
11044         __Pyx_BufFmt_StackElem __pyx_stack[1];
11045         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
11046         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11047         if (unlikely(__pyx_t_6 < 0)) {
11048           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
11049           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11050             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
11051             __Pyx_RaiseBufferFallbackError();
11052           } else {
11053             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
11054           }
11055           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
11056         }
11057         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
11058         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
11059       }
11060       __pyx_t_14 = 0;
11061       __pyx_v_U = ((PyArrayObject *)__pyx_t_4);
11062       __pyx_t_4 = 0;
11063       __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
11064       {
11065         __Pyx_BufFmt_StackElem __pyx_stack[1];
11066         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
11067         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
11068         if (unlikely(__pyx_t_6 < 0)) {
11069           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11070           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
11071             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
11072             __Pyx_RaiseBufferFallbackError();
11073           } else {
11074             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11075           }
11076           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
11077         }
11078         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
11079         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
11080       }
11081       __pyx_t_15 = 0;
11082       __pyx_v_S = ((PyArrayObject *)__pyx_t_1);
11083       __pyx_t_1 = 0;
11084       __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
11085       {
11086         __Pyx_BufFmt_StackElem __pyx_stack[1];
11087         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
11088         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11089         if (unlikely(__pyx_t_6 < 0)) {
11090           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
11091           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11092             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
11093             __Pyx_RaiseBufferFallbackError();
11094           } else {
11095             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
11096           }
11097           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
11098         }
11099         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
11100         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
11101       }
11102       __pyx_t_16 = 0;
11103       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_2);
11104       __pyx_t_2 = 0;
11105 
11106       /* "GPy/models/state_space_cython.pyx":303
11107  *                           overwrite_a=False,check_finite=True)
11108  *
11109  *                 square_root = U * np.sqrt(S)             # <<<<<<<<<<<<<<
11110  *             else:
11111  *
11112  */
11113       __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
11114       __Pyx_GOTREF(__pyx_t_2);
11115       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
11116       __Pyx_GOTREF(__pyx_t_1);
11117       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11118       __pyx_t_2 = NULL;
11119       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11120         __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
11121         if (likely(__pyx_t_2)) {
11122           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11123           __Pyx_INCREF(__pyx_t_2);
11124           __Pyx_INCREF(function);
11125           __Pyx_DECREF_SET(__pyx_t_1, function);
11126         }
11127       }
11128       __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_S));
11129       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11130       if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error)
11131       __Pyx_GOTREF(__pyx_t_3);
11132       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11133       __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_U), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
11134       __Pyx_GOTREF(__pyx_t_1);
11135       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11136       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 303, __pyx_L1_error)
11137       __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
11138       {
11139         __Pyx_BufFmt_StackElem __pyx_stack[1];
11140         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
11141         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11142         if (unlikely(__pyx_t_6 < 0)) {
11143           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11144           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11145             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
11146             __Pyx_RaiseBufferFallbackError();
11147           } else {
11148             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11149           }
11150           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
11151         }
11152         __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
11153         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
11154       }
11155       __pyx_t_9 = 0;
11156       __pyx_v_square_root = ((PyArrayObject *)__pyx_t_1);
11157       __pyx_t_1 = 0;
11158 
11159       /* "GPy/models/state_space_cython.pyx":298
11160  *             square_root = np.sqrt( Q )
11161  *         else:
11162  *             if self.svd_each_time:             # <<<<<<<<<<<<<<
11163  *
11164  *                 U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,
11165  */
11166       goto __pyx_L4;
11167     }
11168 
11169     /* "GPy/models/state_space_cython.pyx":306
11170  *             else:
11171  *
11172  *                 if ind in self.Q_square_root:             # <<<<<<<<<<<<<<
11173  *                     square_root = self.Q_square_root[ind]
11174  *                 else:
11175  */
11176     /*else*/ {
11177       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error)
11178       __Pyx_GOTREF(__pyx_t_1);
11179       if (unlikely(__pyx_v_self->Q_square_root == Py_None)) {
11180         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
11181         __PYX_ERR(0, 306, __pyx_L1_error)
11182       }
11183       __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_self->Q_square_root, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 306, __pyx_L1_error)
11184       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11185       __pyx_t_17 = (__pyx_t_8 != 0);
11186       if (__pyx_t_17) {
11187 
11188         /* "GPy/models/state_space_cython.pyx":307
11189  *
11190  *                 if ind in self.Q_square_root:
11191  *                     square_root = self.Q_square_root[ind]             # <<<<<<<<<<<<<<
11192  *                 else:
11193  *                     U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,
11194  */
11195         if (unlikely(__pyx_v_self->Q_square_root == Py_None)) {
11196           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
11197           __PYX_ERR(0, 307, __pyx_L1_error)
11198         }
11199         __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
11200         __Pyx_GOTREF(__pyx_t_1);
11201         __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_self->Q_square_root, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
11202         __Pyx_GOTREF(__pyx_t_3);
11203         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11204         if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 307, __pyx_L1_error)
11205         __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
11206         {
11207           __Pyx_BufFmt_StackElem __pyx_stack[1];
11208           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
11209           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11210           if (unlikely(__pyx_t_6 < 0)) {
11211             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
11212             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11213               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
11214               __Pyx_RaiseBufferFallbackError();
11215             } else {
11216               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
11217             }
11218             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
11219           }
11220           __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
11221           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 307, __pyx_L1_error)
11222         }
11223         __pyx_t_9 = 0;
11224         __pyx_v_square_root = ((PyArrayObject *)__pyx_t_3);
11225         __pyx_t_3 = 0;
11226 
11227         /* "GPy/models/state_space_cython.pyx":306
11228  *             else:
11229  *
11230  *                 if ind in self.Q_square_root:             # <<<<<<<<<<<<<<
11231  *                     square_root = self.Q_square_root[ind]
11232  *                 else:
11233  */
11234         goto __pyx_L7;
11235       }
11236 
11237       /* "GPy/models/state_space_cython.pyx":309
11238  *                     square_root = self.Q_square_root[ind]
11239  *                 else:
11240  *                     U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
11241  *                               overwrite_a=False,check_finite=True)
11242  *
11243  */
11244       /*else*/ {
11245         __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
11246         __Pyx_GOTREF(__pyx_t_3);
11247         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_linalg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
11248         __Pyx_GOTREF(__pyx_t_1);
11249         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11250         __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_svd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
11251         __Pyx_GOTREF(__pyx_t_3);
11252         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11253         __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
11254         __Pyx_GOTREF(__pyx_t_1);
11255         __Pyx_INCREF(((PyObject *)__pyx_v_Q));
11256         __Pyx_GIVEREF(((PyObject *)__pyx_v_Q));
11257         PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_Q));
11258         __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
11259         __Pyx_GOTREF(__pyx_t_2);
11260         if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
11261         if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
11262 
11263         /* "GPy/models/state_space_cython.pyx":310
11264  *                 else:
11265  *                     U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,
11266  *                               overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
11267  *
11268  *                     square_root = U * np.sqrt(S)
11269  */
11270         if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
11271         if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
11272 
11273         /* "GPy/models/state_space_cython.pyx":309
11274  *                     square_root = self.Q_square_root[ind]
11275  *                 else:
11276  *                     U,S,Vh = sp.linalg.svd( Q,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
11277  *                               overwrite_a=False,check_finite=True)
11278  *
11279  */
11280         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
11281         __Pyx_GOTREF(__pyx_t_4);
11282         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11283         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11284         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11285         if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
11286           PyObject* sequence = __pyx_t_4;
11287           Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11288           if (unlikely(size != 3)) {
11289             if (size > 3) __Pyx_RaiseTooManyValuesError(3);
11290             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11291             __PYX_ERR(0, 309, __pyx_L1_error)
11292           }
11293           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11294           if (likely(PyTuple_CheckExact(sequence))) {
11295             __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
11296             __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
11297             __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2);
11298           } else {
11299             __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
11300             __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
11301             __pyx_t_3 = PyList_GET_ITEM(sequence, 2);
11302           }
11303           __Pyx_INCREF(__pyx_t_2);
11304           __Pyx_INCREF(__pyx_t_1);
11305           __Pyx_INCREF(__pyx_t_3);
11306           #else
11307           __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
11308           __Pyx_GOTREF(__pyx_t_2);
11309           __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error)
11310           __Pyx_GOTREF(__pyx_t_1);
11311           __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
11312           __Pyx_GOTREF(__pyx_t_3);
11313           #endif
11314           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11315         } else {
11316           Py_ssize_t index = -1;
11317           __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
11318           __Pyx_GOTREF(__pyx_t_5);
11319           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11320           __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
11321           index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
11322           __Pyx_GOTREF(__pyx_t_2);
11323           index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
11324           __Pyx_GOTREF(__pyx_t_1);
11325           index = 2; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L8_unpacking_failed;
11326           __Pyx_GOTREF(__pyx_t_3);
11327           if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 309, __pyx_L1_error)
11328           __pyx_t_13 = NULL;
11329           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11330           goto __pyx_L9_unpacking_done;
11331           __pyx_L8_unpacking_failed:;
11332           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11333           __pyx_t_13 = NULL;
11334           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
11335           __PYX_ERR(0, 309, __pyx_L1_error)
11336           __pyx_L9_unpacking_done:;
11337         }
11338         if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 309, __pyx_L1_error)
11339         if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 309, __pyx_L1_error)
11340         if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 309, __pyx_L1_error)
11341         __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
11342         {
11343           __Pyx_BufFmt_StackElem __pyx_stack[1];
11344           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
11345           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11346           if (unlikely(__pyx_t_6 < 0)) {
11347             PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11348             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11349               Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
11350               __Pyx_RaiseBufferFallbackError();
11351             } else {
11352               PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11353             }
11354             __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
11355           }
11356           __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
11357           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
11358         }
11359         __pyx_t_14 = 0;
11360         __pyx_v_U = ((PyArrayObject *)__pyx_t_2);
11361         __pyx_t_2 = 0;
11362         __pyx_t_15 = ((PyArrayObject *)__pyx_t_1);
11363         {
11364           __Pyx_BufFmt_StackElem __pyx_stack[1];
11365           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
11366           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
11367           if (unlikely(__pyx_t_6 < 0)) {
11368             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
11369             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
11370               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
11371               __Pyx_RaiseBufferFallbackError();
11372             } else {
11373               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
11374             }
11375             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
11376           }
11377           __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
11378           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
11379         }
11380         __pyx_t_15 = 0;
11381         __pyx_v_S = ((PyArrayObject *)__pyx_t_1);
11382         __pyx_t_1 = 0;
11383         __pyx_t_16 = ((PyArrayObject *)__pyx_t_3);
11384         {
11385           __Pyx_BufFmt_StackElem __pyx_stack[1];
11386           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
11387           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11388           if (unlikely(__pyx_t_6 < 0)) {
11389             PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11390             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11391               Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
11392               __Pyx_RaiseBufferFallbackError();
11393             } else {
11394               PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11395             }
11396             __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
11397           }
11398           __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
11399           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
11400         }
11401         __pyx_t_16 = 0;
11402         __pyx_v_Vh = ((PyArrayObject *)__pyx_t_3);
11403         __pyx_t_3 = 0;
11404 
11405         /* "GPy/models/state_space_cython.pyx":312
11406  *                               overwrite_a=False,check_finite=True)
11407  *
11408  *                     square_root = U * np.sqrt(S)             # <<<<<<<<<<<<<<
11409  *
11410  *                     self.Q_square_root[ind] = square_root
11411  */
11412         __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
11413         __Pyx_GOTREF(__pyx_t_3);
11414         __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
11415         __Pyx_GOTREF(__pyx_t_1);
11416         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11417         __pyx_t_3 = NULL;
11418         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11419           __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
11420           if (likely(__pyx_t_3)) {
11421             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11422             __Pyx_INCREF(__pyx_t_3);
11423             __Pyx_INCREF(function);
11424             __Pyx_DECREF_SET(__pyx_t_1, function);
11425           }
11426         }
11427         __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_S));
11428         __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11429         if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
11430         __Pyx_GOTREF(__pyx_t_4);
11431         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11432         __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_U), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
11433         __Pyx_GOTREF(__pyx_t_1);
11434         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11435         if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 312, __pyx_L1_error)
11436         __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
11437         {
11438           __Pyx_BufFmt_StackElem __pyx_stack[1];
11439           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
11440           __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
11441           if (unlikely(__pyx_t_6 < 0)) {
11442             PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
11443             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
11444               Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
11445               __Pyx_RaiseBufferFallbackError();
11446             } else {
11447               PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
11448             }
11449             __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
11450           }
11451           __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
11452           if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
11453         }
11454         __pyx_t_9 = 0;
11455         __pyx_v_square_root = ((PyArrayObject *)__pyx_t_1);
11456         __pyx_t_1 = 0;
11457 
11458         /* "GPy/models/state_space_cython.pyx":314
11459  *                     square_root = U * np.sqrt(S)
11460  *
11461  *                     self.Q_square_root[ind] = square_root             # <<<<<<<<<<<<<<
11462  *
11463  *         return square_root
11464  */
11465         if (unlikely(__pyx_v_self->Q_square_root == Py_None)) {
11466           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
11467           __PYX_ERR(0, 314, __pyx_L1_error)
11468         }
11469         __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
11470         __Pyx_GOTREF(__pyx_t_1);
11471         if (unlikely(PyDict_SetItem(__pyx_v_self->Q_square_root, __pyx_t_1, ((PyObject *)__pyx_v_square_root)) < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
11472         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11473       }
11474       __pyx_L7:;
11475     }
11476     __pyx_L4:;
11477   }
11478   __pyx_L3:;
11479 
11480   /* "GPy/models/state_space_cython.pyx":316
11481  *                     self.Q_square_root[ind] = square_root
11482  *
11483  *         return square_root             # <<<<<<<<<<<<<<
11484  *
11485  * cdef class Std_Dynamic_Callables_Cython(Q_handling_Cython):
11486  */
11487   __Pyx_XDECREF(__pyx_r);
11488   __Pyx_INCREF(((PyObject *)__pyx_v_square_root));
11489   __pyx_r = ((PyObject *)__pyx_v_square_root);
11490   goto __pyx_L0;
11491 
11492   /* "GPy/models/state_space_cython.pyx":277
11493  *         return self.dQ # the same dirivative on each iteration
11494  *
11495  *     cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
11496  *         """
11497  *         function (k). Returns the square root of noise matrix of dynamic model on iteration k.
11498  */
11499 
11500   /* function exit code */
11501   __pyx_L1_error:;
11502   __Pyx_XDECREF(__pyx_t_1);
11503   __Pyx_XDECREF(__pyx_t_2);
11504   __Pyx_XDECREF(__pyx_t_3);
11505   __Pyx_XDECREF(__pyx_t_4);
11506   __Pyx_XDECREF(__pyx_t_5);
11507   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11508     __Pyx_PyThreadState_declare
11509     __Pyx_PyThreadState_assign
11510     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11511     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
11512     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
11513     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
11514     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
11515     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
11516   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11517   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
11518   __pyx_r = 0;
11519   goto __pyx_L2;
11520   __pyx_L0:;
11521   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
11522   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
11523   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
11524   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
11525   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
11526   __pyx_L2:;
11527   __Pyx_XDECREF((PyObject *)__pyx_v_Q);
11528   __Pyx_XDECREF((PyObject *)__pyx_v_square_root);
11529   __Pyx_XDECREF((PyObject *)__pyx_v_U);
11530   __Pyx_XDECREF((PyObject *)__pyx_v_S);
11531   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
11532   __Pyx_XGIVEREF(__pyx_r);
11533   __Pyx_RefNannyFinishContext();
11534   return __pyx_r;
11535 }
11536 
11537 /* Python wrapper */
11538 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
11539 static char __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk[] = "\n        function (k). Returns the square root of noise matrix of dynamic model on iteration k.\n                k (iteration number). starts at 0\n                \n        This function is implemented to use SVD prediction step.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)11540 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
11541   int __pyx_v_k;
11542   int __pyx_lineno = 0;
11543   const char *__pyx_filename = NULL;
11544   int __pyx_clineno = 0;
11545   PyObject *__pyx_r = 0;
11546   __Pyx_RefNannyDeclarations
11547   __Pyx_RefNannySetupContext("Q_srk (wrapper)", 0);
11548   assert(__pyx_arg_k); {
11549     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error)
11550   }
11551   goto __pyx_L4_argument_unpacking_done;
11552   __pyx_L3_error:;
11553   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
11554   __Pyx_RefNannyFinishContext();
11555   return NULL;
11556   __pyx_L4_argument_unpacking_done:;
11557   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self), ((int)__pyx_v_k));
11558 
11559   /* function exit code */
11560   __Pyx_RefNannyFinishContext();
11561   return __pyx_r;
11562 }
11563 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,int __pyx_v_k)11564 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, int __pyx_v_k) {
11565   PyObject *__pyx_r = NULL;
11566   __Pyx_RefNannyDeclarations
11567   PyObject *__pyx_t_1 = NULL;
11568   int __pyx_lineno = 0;
11569   const char *__pyx_filename = NULL;
11570   int __pyx_clineno = 0;
11571   __Pyx_RefNannySetupContext("Q_srk", 0);
11572   __Pyx_XDECREF(__pyx_r);
11573   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Q_srk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
11574   __Pyx_GOTREF(__pyx_t_1);
11575   __pyx_r = __pyx_t_1;
11576   __pyx_t_1 = 0;
11577   goto __pyx_L0;
11578 
11579   /* function exit code */
11580   __pyx_L1_error:;
11581   __Pyx_XDECREF(__pyx_t_1);
11582   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
11583   __pyx_r = NULL;
11584   __pyx_L0:;
11585   __Pyx_XGIVEREF(__pyx_r);
11586   __Pyx_RefNannyFinishContext();
11587   return __pyx_r;
11588 }
11589 
11590 /* "(tree fragment)":1
11591  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11592  *     cdef tuple state
11593  *     cdef object _dict
11594  */
11595 
11596 /* Python wrapper */
11597 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_9__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)11598 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
11599   PyObject *__pyx_r = 0;
11600   __Pyx_RefNannyDeclarations
11601   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
11602   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_8__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self));
11603 
11604   /* function exit code */
11605   __Pyx_RefNannyFinishContext();
11606   return __pyx_r;
11607 }
11608 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self)11609 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_8__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self) {
11610   PyObject *__pyx_v_state = 0;
11611   PyObject *__pyx_v__dict = 0;
11612   int __pyx_v_use_setstate;
11613   PyObject *__pyx_r = NULL;
11614   __Pyx_RefNannyDeclarations
11615   PyObject *__pyx_t_1 = NULL;
11616   PyObject *__pyx_t_2 = NULL;
11617   PyObject *__pyx_t_3 = NULL;
11618   int __pyx_t_4;
11619   int __pyx_t_5;
11620   int __pyx_t_6;
11621   int __pyx_lineno = 0;
11622   const char *__pyx_filename = NULL;
11623   int __pyx_clineno = 0;
11624   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
11625 
11626   /* "(tree fragment)":5
11627  *     cdef object _dict
11628  *     cdef bint use_setstate
11629  *     state = (self.Q, self.Q_square_root, self.Q_time_var_index, self.dQ, self.index, self.svd_each_time)             # <<<<<<<<<<<<<<
11630  *     _dict = getattr(self, '__dict__', None)
11631  *     if _dict is not None:
11632  */
11633   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->Q_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
11634   __Pyx_GOTREF(__pyx_t_1);
11635   __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->svd_each_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
11636   __Pyx_GOTREF(__pyx_t_2);
11637   __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
11638   __Pyx_GOTREF(__pyx_t_3);
11639   __Pyx_INCREF(((PyObject *)__pyx_v_self->Q));
11640   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->Q));
11641   PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->Q));
11642   __Pyx_INCREF(__pyx_v_self->Q_square_root);
11643   __Pyx_GIVEREF(__pyx_v_self->Q_square_root);
11644   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Q_square_root);
11645   __Pyx_GIVEREF(__pyx_t_1);
11646   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
11647   __Pyx_INCREF(((PyObject *)__pyx_v_self->dQ));
11648   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dQ));
11649   PyTuple_SET_ITEM(__pyx_t_3, 3, ((PyObject *)__pyx_v_self->dQ));
11650   __Pyx_INCREF(((PyObject *)__pyx_v_self->index));
11651   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->index));
11652   PyTuple_SET_ITEM(__pyx_t_3, 4, ((PyObject *)__pyx_v_self->index));
11653   __Pyx_GIVEREF(__pyx_t_2);
11654   PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
11655   __pyx_t_1 = 0;
11656   __pyx_t_2 = 0;
11657   __pyx_v_state = ((PyObject*)__pyx_t_3);
11658   __pyx_t_3 = 0;
11659 
11660   /* "(tree fragment)":6
11661  *     cdef bint use_setstate
11662  *     state = (self.Q, self.Q_square_root, self.Q_time_var_index, self.dQ, self.index, self.svd_each_time)
11663  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
11664  *     if _dict is not None:
11665  *         state += (_dict,)
11666  */
11667   __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
11668   __Pyx_GOTREF(__pyx_t_3);
11669   __pyx_v__dict = __pyx_t_3;
11670   __pyx_t_3 = 0;
11671 
11672   /* "(tree fragment)":7
11673  *     state = (self.Q, self.Q_square_root, self.Q_time_var_index, self.dQ, self.index, self.svd_each_time)
11674  *     _dict = getattr(self, '__dict__', None)
11675  *     if _dict is not None:             # <<<<<<<<<<<<<<
11676  *         state += (_dict,)
11677  *         use_setstate = True
11678  */
11679   __pyx_t_4 = (__pyx_v__dict != Py_None);
11680   __pyx_t_5 = (__pyx_t_4 != 0);
11681   if (__pyx_t_5) {
11682 
11683     /* "(tree fragment)":8
11684  *     _dict = getattr(self, '__dict__', None)
11685  *     if _dict is not None:
11686  *         state += (_dict,)             # <<<<<<<<<<<<<<
11687  *         use_setstate = True
11688  *     else:
11689  */
11690     __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
11691     __Pyx_GOTREF(__pyx_t_3);
11692     __Pyx_INCREF(__pyx_v__dict);
11693     __Pyx_GIVEREF(__pyx_v__dict);
11694     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
11695     __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
11696     __Pyx_GOTREF(__pyx_t_2);
11697     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11698     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
11699     __pyx_t_2 = 0;
11700 
11701     /* "(tree fragment)":9
11702  *     if _dict is not None:
11703  *         state += (_dict,)
11704  *         use_setstate = True             # <<<<<<<<<<<<<<
11705  *     else:
11706  *         use_setstate = self.Q is not None or self.Q_square_root is not None or self.dQ is not None or self.index is not None
11707  */
11708     __pyx_v_use_setstate = 1;
11709 
11710     /* "(tree fragment)":7
11711  *     state = (self.Q, self.Q_square_root, self.Q_time_var_index, self.dQ, self.index, self.svd_each_time)
11712  *     _dict = getattr(self, '__dict__', None)
11713  *     if _dict is not None:             # <<<<<<<<<<<<<<
11714  *         state += (_dict,)
11715  *         use_setstate = True
11716  */
11717     goto __pyx_L3;
11718   }
11719 
11720   /* "(tree fragment)":11
11721  *         use_setstate = True
11722  *     else:
11723  *         use_setstate = self.Q is not None or self.Q_square_root is not None or self.dQ is not None or self.index is not None             # <<<<<<<<<<<<<<
11724  *     if use_setstate:
11725  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, None), state
11726  */
11727   /*else*/ {
11728     __pyx_t_4 = (((PyObject *)__pyx_v_self->Q) != Py_None);
11729     __pyx_t_6 = (__pyx_t_4 != 0);
11730     if (!__pyx_t_6) {
11731     } else {
11732       __pyx_t_5 = __pyx_t_6;
11733       goto __pyx_L4_bool_binop_done;
11734     }
11735     __pyx_t_6 = (__pyx_v_self->Q_square_root != ((PyObject*)Py_None));
11736     __pyx_t_4 = (__pyx_t_6 != 0);
11737     if (!__pyx_t_4) {
11738     } else {
11739       __pyx_t_5 = __pyx_t_4;
11740       goto __pyx_L4_bool_binop_done;
11741     }
11742     __pyx_t_4 = (((PyObject *)__pyx_v_self->dQ) != Py_None);
11743     __pyx_t_6 = (__pyx_t_4 != 0);
11744     if (!__pyx_t_6) {
11745     } else {
11746       __pyx_t_5 = __pyx_t_6;
11747       goto __pyx_L4_bool_binop_done;
11748     }
11749     __pyx_t_6 = (((PyObject *)__pyx_v_self->index) != Py_None);
11750     __pyx_t_4 = (__pyx_t_6 != 0);
11751     __pyx_t_5 = __pyx_t_4;
11752     __pyx_L4_bool_binop_done:;
11753     __pyx_v_use_setstate = __pyx_t_5;
11754   }
11755   __pyx_L3:;
11756 
11757   /* "(tree fragment)":12
11758  *     else:
11759  *         use_setstate = self.Q is not None or self.Q_square_root is not None or self.dQ is not None or self.index is not None
11760  *     if use_setstate:             # <<<<<<<<<<<<<<
11761  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, None), state
11762  *     else:
11763  */
11764   __pyx_t_5 = (__pyx_v_use_setstate != 0);
11765   if (__pyx_t_5) {
11766 
11767     /* "(tree fragment)":13
11768  *         use_setstate = self.Q is not None or self.Q_square_root is not None or self.dQ is not None or self.index is not None
11769  *     if use_setstate:
11770  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, None), state             # <<<<<<<<<<<<<<
11771  *     else:
11772  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, state)
11773  */
11774     __Pyx_XDECREF(__pyx_r);
11775     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Q_handling_Cython); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
11776     __Pyx_GOTREF(__pyx_t_2);
11777     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
11778     __Pyx_GOTREF(__pyx_t_3);
11779     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11780     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11781     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11782     __Pyx_INCREF(__pyx_int_125522784);
11783     __Pyx_GIVEREF(__pyx_int_125522784);
11784     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_125522784);
11785     __Pyx_INCREF(Py_None);
11786     __Pyx_GIVEREF(Py_None);
11787     PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
11788     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
11789     __Pyx_GOTREF(__pyx_t_1);
11790     __Pyx_GIVEREF(__pyx_t_2);
11791     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
11792     __Pyx_GIVEREF(__pyx_t_3);
11793     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
11794     __Pyx_INCREF(__pyx_v_state);
11795     __Pyx_GIVEREF(__pyx_v_state);
11796     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
11797     __pyx_t_2 = 0;
11798     __pyx_t_3 = 0;
11799     __pyx_r = __pyx_t_1;
11800     __pyx_t_1 = 0;
11801     goto __pyx_L0;
11802 
11803     /* "(tree fragment)":12
11804  *     else:
11805  *         use_setstate = self.Q is not None or self.Q_square_root is not None or self.dQ is not None or self.index is not None
11806  *     if use_setstate:             # <<<<<<<<<<<<<<
11807  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, None), state
11808  *     else:
11809  */
11810   }
11811 
11812   /* "(tree fragment)":15
11813  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, None), state
11814  *     else:
11815  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, state)             # <<<<<<<<<<<<<<
11816  * def __setstate_cython__(self, __pyx_state):
11817  *     __pyx_unpickle_Q_handling_Cython__set_state(self, __pyx_state)
11818  */
11819   /*else*/ {
11820     __Pyx_XDECREF(__pyx_r);
11821     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Q_handling_Cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
11822     __Pyx_GOTREF(__pyx_t_1);
11823     __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
11824     __Pyx_GOTREF(__pyx_t_3);
11825     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11826     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11827     PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
11828     __Pyx_INCREF(__pyx_int_125522784);
11829     __Pyx_GIVEREF(__pyx_int_125522784);
11830     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_125522784);
11831     __Pyx_INCREF(__pyx_v_state);
11832     __Pyx_GIVEREF(__pyx_v_state);
11833     PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
11834     __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
11835     __Pyx_GOTREF(__pyx_t_2);
11836     __Pyx_GIVEREF(__pyx_t_1);
11837     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
11838     __Pyx_GIVEREF(__pyx_t_3);
11839     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
11840     __pyx_t_1 = 0;
11841     __pyx_t_3 = 0;
11842     __pyx_r = __pyx_t_2;
11843     __pyx_t_2 = 0;
11844     goto __pyx_L0;
11845   }
11846 
11847   /* "(tree fragment)":1
11848  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
11849  *     cdef tuple state
11850  *     cdef object _dict
11851  */
11852 
11853   /* function exit code */
11854   __pyx_L1_error:;
11855   __Pyx_XDECREF(__pyx_t_1);
11856   __Pyx_XDECREF(__pyx_t_2);
11857   __Pyx_XDECREF(__pyx_t_3);
11858   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11859   __pyx_r = NULL;
11860   __pyx_L0:;
11861   __Pyx_XDECREF(__pyx_v_state);
11862   __Pyx_XDECREF(__pyx_v__dict);
11863   __Pyx_XGIVEREF(__pyx_r);
11864   __Pyx_RefNannyFinishContext();
11865   return __pyx_r;
11866 }
11867 
11868 /* "(tree fragment)":16
11869  *     else:
11870  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, state)
11871  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11872  *     __pyx_unpickle_Q_handling_Cython__set_state(self, __pyx_state)
11873  */
11874 
11875 /* Python wrapper */
11876 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_11__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)11877 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11878   PyObject *__pyx_r = 0;
11879   __Pyx_RefNannyDeclarations
11880   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
11881   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_10__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
11882 
11883   /* function exit code */
11884   __Pyx_RefNannyFinishContext();
11885   return __pyx_r;
11886 }
11887 
__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)11888 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_17Q_handling_Cython_10__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
11889   PyObject *__pyx_r = NULL;
11890   __Pyx_RefNannyDeclarations
11891   PyObject *__pyx_t_1 = NULL;
11892   int __pyx_lineno = 0;
11893   const char *__pyx_filename = NULL;
11894   int __pyx_clineno = 0;
11895   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
11896 
11897   /* "(tree fragment)":17
11898  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, state)
11899  * def __setstate_cython__(self, __pyx_state):
11900  *     __pyx_unpickle_Q_handling_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
11901  */
11902   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
11903   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Q_handling_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
11904   __Pyx_GOTREF(__pyx_t_1);
11905   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11906 
11907   /* "(tree fragment)":16
11908  *     else:
11909  *         return __pyx_unpickle_Q_handling_Cython, (type(self), 0x77b5360, state)
11910  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
11911  *     __pyx_unpickle_Q_handling_Cython__set_state(self, __pyx_state)
11912  */
11913 
11914   /* function exit code */
11915   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11916   goto __pyx_L0;
11917   __pyx_L1_error:;
11918   __Pyx_XDECREF(__pyx_t_1);
11919   __Pyx_AddTraceback("GPy.models.state_space_cython.Q_handling_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11920   __pyx_r = NULL;
11921   __pyx_L0:;
11922   __Pyx_XGIVEREF(__pyx_r);
11923   __Pyx_RefNannyFinishContext();
11924   return __pyx_r;
11925 }
11926 
11927 /* "GPy/models/state_space_cython.pyx":324
11928  *         np.ndarray  dA
11929  *
11930  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] A, int A_time_var_index,             # <<<<<<<<<<<<<<
11931  *                  np.ndarray[DTYPE_t, ndim=3] Q,
11932  *                  np.ndarray[DTYPE_t, ndim=2] index,
11933  */
11934 
11935 /* Python wrapper */
11936 static int __pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)11937 static int __pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11938   PyArrayObject *__pyx_v_A = 0;
11939   int __pyx_v_A_time_var_index;
11940   PyArrayObject *__pyx_v_Q = 0;
11941   PyArrayObject *__pyx_v_index = 0;
11942   int __pyx_v_Q_time_var_index;
11943   int __pyx_v_unique_Q_number;
11944   PyArrayObject *__pyx_v_dA = 0;
11945   PyArrayObject *__pyx_v_dQ = 0;
11946   int __pyx_lineno = 0;
11947   const char *__pyx_filename = NULL;
11948   int __pyx_clineno = 0;
11949   int __pyx_r;
11950   __Pyx_RefNannyDeclarations
11951   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
11952   {
11953     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,&__pyx_n_s_A_time_var_index,&__pyx_n_s_Q,&__pyx_n_s_index,&__pyx_n_s_Q_time_var_index,&__pyx_n_s_unique_Q_number,&__pyx_n_s_dA,&__pyx_n_s_dQ,0};
11954     PyObject* values[8] = {0,0,0,0,0,0,0,0};
11955 
11956     /* "GPy/models/state_space_cython.pyx":328
11957  *                  np.ndarray[DTYPE_t, ndim=2] index,
11958  *                  int Q_time_var_index, int unique_Q_number,
11959  *                  np.ndarray[DTYPE_t, ndim=3] dA = None,             # <<<<<<<<<<<<<<
11960  *                  np.ndarray[DTYPE_t, ndim=3] dQ=None):
11961  *
11962  */
11963     values[6] = (PyObject *)((PyArrayObject *)Py_None);
11964 
11965     /* "GPy/models/state_space_cython.pyx":329
11966  *                  int Q_time_var_index, int unique_Q_number,
11967  *                  np.ndarray[DTYPE_t, ndim=3] dA = None,
11968  *                  np.ndarray[DTYPE_t, ndim=3] dQ=None):             # <<<<<<<<<<<<<<
11969  *
11970  *         super(Std_Dynamic_Callables_Cython,self).__init__(Q, index, Q_time_var_index, unique_Q_number,dQ)
11971  */
11972     values[7] = (PyObject *)((PyArrayObject *)Py_None);
11973     if (unlikely(__pyx_kwds)) {
11974       Py_ssize_t kw_args;
11975       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11976       switch (pos_args) {
11977         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
11978         CYTHON_FALLTHROUGH;
11979         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
11980         CYTHON_FALLTHROUGH;
11981         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
11982         CYTHON_FALLTHROUGH;
11983         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
11984         CYTHON_FALLTHROUGH;
11985         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
11986         CYTHON_FALLTHROUGH;
11987         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
11988         CYTHON_FALLTHROUGH;
11989         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11990         CYTHON_FALLTHROUGH;
11991         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11992         CYTHON_FALLTHROUGH;
11993         case  0: break;
11994         default: goto __pyx_L5_argtuple_error;
11995       }
11996       kw_args = PyDict_Size(__pyx_kwds);
11997       switch (pos_args) {
11998         case  0:
11999         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
12000         else goto __pyx_L5_argtuple_error;
12001         CYTHON_FALLTHROUGH;
12002         case  1:
12003         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A_time_var_index)) != 0)) kw_args--;
12004         else {
12005           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 324, __pyx_L3_error)
12006         }
12007         CYTHON_FALLTHROUGH;
12008         case  2:
12009         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Q)) != 0)) kw_args--;
12010         else {
12011           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 324, __pyx_L3_error)
12012         }
12013         CYTHON_FALLTHROUGH;
12014         case  3:
12015         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
12016         else {
12017           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 324, __pyx_L3_error)
12018         }
12019         CYTHON_FALLTHROUGH;
12020         case  4:
12021         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Q_time_var_index)) != 0)) kw_args--;
12022         else {
12023           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 324, __pyx_L3_error)
12024         }
12025         CYTHON_FALLTHROUGH;
12026         case  5:
12027         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_unique_Q_number)) != 0)) kw_args--;
12028         else {
12029           __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 324, __pyx_L3_error)
12030         }
12031         CYTHON_FALLTHROUGH;
12032         case  6:
12033         if (kw_args > 0) {
12034           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dA);
12035           if (value) { values[6] = value; kw_args--; }
12036         }
12037         CYTHON_FALLTHROUGH;
12038         case  7:
12039         if (kw_args > 0) {
12040           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dQ);
12041           if (value) { values[7] = value; kw_args--; }
12042         }
12043       }
12044       if (unlikely(kw_args > 0)) {
12045         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
12046       }
12047     } else {
12048       switch (PyTuple_GET_SIZE(__pyx_args)) {
12049         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12050         CYTHON_FALLTHROUGH;
12051         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12052         CYTHON_FALLTHROUGH;
12053         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12054         values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12055         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12056         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12057         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12058         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12059         break;
12060         default: goto __pyx_L5_argtuple_error;
12061       }
12062     }
12063     __pyx_v_A = ((PyArrayObject *)values[0]);
12064     __pyx_v_A_time_var_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_A_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error)
12065     __pyx_v_Q = ((PyArrayObject *)values[2]);
12066     __pyx_v_index = ((PyArrayObject *)values[3]);
12067     __pyx_v_Q_time_var_index = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_Q_time_var_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error)
12068     __pyx_v_unique_Q_number = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_unique_Q_number == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 327, __pyx_L3_error)
12069     __pyx_v_dA = ((PyArrayObject *)values[6]);
12070     __pyx_v_dQ = ((PyArrayObject *)values[7]);
12071   }
12072   goto __pyx_L4_argument_unpacking_done;
12073   __pyx_L5_argtuple_error:;
12074   __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
12075   __pyx_L3_error:;
12076   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12077   __Pyx_RefNannyFinishContext();
12078   return -1;
12079   __pyx_L4_argument_unpacking_done:;
12080   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 324, __pyx_L1_error)
12081   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Q), __pyx_ptype_5numpy_ndarray, 1, "Q", 0))) __PYX_ERR(0, 325, __pyx_L1_error)
12082   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), __pyx_ptype_5numpy_ndarray, 1, "index", 0))) __PYX_ERR(0, 326, __pyx_L1_error)
12083   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dA), __pyx_ptype_5numpy_ndarray, 1, "dA", 0))) __PYX_ERR(0, 328, __pyx_L1_error)
12084   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dQ), __pyx_ptype_5numpy_ndarray, 1, "dQ", 0))) __PYX_ERR(0, 329, __pyx_L1_error)
12085   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython___init__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_A, __pyx_v_A_time_var_index, __pyx_v_Q, __pyx_v_index, __pyx_v_Q_time_var_index, __pyx_v_unique_Q_number, __pyx_v_dA, __pyx_v_dQ);
12086 
12087   /* "GPy/models/state_space_cython.pyx":324
12088  *         np.ndarray  dA
12089  *
12090  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] A, int A_time_var_index,             # <<<<<<<<<<<<<<
12091  *                  np.ndarray[DTYPE_t, ndim=3] Q,
12092  *                  np.ndarray[DTYPE_t, ndim=2] index,
12093  */
12094 
12095   /* function exit code */
12096   goto __pyx_L0;
12097   __pyx_L1_error:;
12098   __pyx_r = -1;
12099   __pyx_L0:;
12100   __Pyx_RefNannyFinishContext();
12101   return __pyx_r;
12102 }
12103 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,PyArrayObject * __pyx_v_A,int __pyx_v_A_time_var_index,PyArrayObject * __pyx_v_Q,PyArrayObject * __pyx_v_index,int __pyx_v_Q_time_var_index,int __pyx_v_unique_Q_number,PyArrayObject * __pyx_v_dA,PyArrayObject * __pyx_v_dQ)12104 static int __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, PyArrayObject *__pyx_v_A, int __pyx_v_A_time_var_index, PyArrayObject *__pyx_v_Q, PyArrayObject *__pyx_v_index, int __pyx_v_Q_time_var_index, int __pyx_v_unique_Q_number, PyArrayObject *__pyx_v_dA, PyArrayObject *__pyx_v_dQ) {
12105   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
12106   __Pyx_Buffer __pyx_pybuffer_A;
12107   __Pyx_LocalBuf_ND __pyx_pybuffernd_Q;
12108   __Pyx_Buffer __pyx_pybuffer_Q;
12109   __Pyx_LocalBuf_ND __pyx_pybuffernd_dA;
12110   __Pyx_Buffer __pyx_pybuffer_dA;
12111   __Pyx_LocalBuf_ND __pyx_pybuffernd_dQ;
12112   __Pyx_Buffer __pyx_pybuffer_dQ;
12113   __Pyx_LocalBuf_ND __pyx_pybuffernd_index;
12114   __Pyx_Buffer __pyx_pybuffer_index;
12115   int __pyx_r;
12116   __Pyx_RefNannyDeclarations
12117   PyObject *__pyx_t_1 = NULL;
12118   PyObject *__pyx_t_2 = NULL;
12119   PyObject *__pyx_t_3 = NULL;
12120   PyObject *__pyx_t_4 = NULL;
12121   PyObject *__pyx_t_5 = NULL;
12122   int __pyx_t_6;
12123   PyObject *__pyx_t_7 = NULL;
12124   int __pyx_lineno = 0;
12125   const char *__pyx_filename = NULL;
12126   int __pyx_clineno = 0;
12127   __Pyx_RefNannySetupContext("__init__", 0);
12128   __pyx_pybuffer_A.pybuffer.buf = NULL;
12129   __pyx_pybuffer_A.refcount = 0;
12130   __pyx_pybuffernd_A.data = NULL;
12131   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
12132   __pyx_pybuffer_Q.pybuffer.buf = NULL;
12133   __pyx_pybuffer_Q.refcount = 0;
12134   __pyx_pybuffernd_Q.data = NULL;
12135   __pyx_pybuffernd_Q.rcbuffer = &__pyx_pybuffer_Q;
12136   __pyx_pybuffer_index.pybuffer.buf = NULL;
12137   __pyx_pybuffer_index.refcount = 0;
12138   __pyx_pybuffernd_index.data = NULL;
12139   __pyx_pybuffernd_index.rcbuffer = &__pyx_pybuffer_index;
12140   __pyx_pybuffer_dA.pybuffer.buf = NULL;
12141   __pyx_pybuffer_dA.refcount = 0;
12142   __pyx_pybuffernd_dA.data = NULL;
12143   __pyx_pybuffernd_dA.rcbuffer = &__pyx_pybuffer_dA;
12144   __pyx_pybuffer_dQ.pybuffer.buf = NULL;
12145   __pyx_pybuffer_dQ.refcount = 0;
12146   __pyx_pybuffernd_dQ.data = NULL;
12147   __pyx_pybuffernd_dQ.rcbuffer = &__pyx_pybuffer_dQ;
12148   {
12149     __Pyx_BufFmt_StackElem __pyx_stack[1];
12150     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
12151   }
12152   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_A.diminfo[2].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_A.diminfo[2].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[2];
12153   {
12154     __Pyx_BufFmt_StackElem __pyx_stack[1];
12155     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q.rcbuffer->pybuffer, (PyObject*)__pyx_v_Q, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
12156   }
12157   __pyx_pybuffernd_Q.diminfo[0].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q.diminfo[0].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q.diminfo[1].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q.diminfo[1].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_Q.diminfo[2].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_Q.diminfo[2].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[2];
12158   {
12159     __Pyx_BufFmt_StackElem __pyx_stack[1];
12160     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_index.rcbuffer->pybuffer, (PyObject*)__pyx_v_index, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
12161   }
12162   __pyx_pybuffernd_index.diminfo[0].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_index.diminfo[0].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_index.diminfo[1].strides = __pyx_pybuffernd_index.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_index.diminfo[1].shape = __pyx_pybuffernd_index.rcbuffer->pybuffer.shape[1];
12163   {
12164     __Pyx_BufFmt_StackElem __pyx_stack[1];
12165     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dA.rcbuffer->pybuffer, (PyObject*)__pyx_v_dA, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
12166   }
12167   __pyx_pybuffernd_dA.diminfo[0].strides = __pyx_pybuffernd_dA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dA.diminfo[0].shape = __pyx_pybuffernd_dA.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dA.diminfo[1].strides = __pyx_pybuffernd_dA.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dA.diminfo[1].shape = __pyx_pybuffernd_dA.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dA.diminfo[2].strides = __pyx_pybuffernd_dA.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dA.diminfo[2].shape = __pyx_pybuffernd_dA.rcbuffer->pybuffer.shape[2];
12168   {
12169     __Pyx_BufFmt_StackElem __pyx_stack[1];
12170     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer, (PyObject*)__pyx_v_dQ, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 324, __pyx_L1_error)
12171   }
12172   __pyx_pybuffernd_dQ.diminfo[0].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dQ.diminfo[0].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dQ.diminfo[1].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dQ.diminfo[1].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dQ.diminfo[2].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dQ.diminfo[2].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[2];
12173 
12174   /* "GPy/models/state_space_cython.pyx":331
12175  *                  np.ndarray[DTYPE_t, ndim=3] dQ=None):
12176  *
12177  *         super(Std_Dynamic_Callables_Cython,self).__init__(Q, index, Q_time_var_index, unique_Q_number,dQ)             # <<<<<<<<<<<<<<
12178  *
12179  *         self.A = A
12180  */
12181   __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
12182   __Pyx_GOTREF(__pyx_t_2);
12183   __Pyx_INCREF(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython));
12184   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython));
12185   PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython));
12186   __Pyx_INCREF(((PyObject *)__pyx_v_self));
12187   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12188   PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_self));
12189   __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
12190   __Pyx_GOTREF(__pyx_t_3);
12191   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12192   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
12193   __Pyx_GOTREF(__pyx_t_2);
12194   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12195   __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_Q_time_var_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
12196   __Pyx_GOTREF(__pyx_t_3);
12197   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_unique_Q_number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
12198   __Pyx_GOTREF(__pyx_t_4);
12199   __pyx_t_5 = NULL;
12200   __pyx_t_6 = 0;
12201   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
12202     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
12203     if (likely(__pyx_t_5)) {
12204       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
12205       __Pyx_INCREF(__pyx_t_5);
12206       __Pyx_INCREF(function);
12207       __Pyx_DECREF_SET(__pyx_t_2, function);
12208       __pyx_t_6 = 1;
12209     }
12210   }
12211   #if CYTHON_FAST_PYCALL
12212   if (PyFunction_Check(__pyx_t_2)) {
12213     PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_Q), ((PyObject *)__pyx_v_index), __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_dQ)};
12214     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
12215     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12216     __Pyx_GOTREF(__pyx_t_1);
12217     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12218     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12219   } else
12220   #endif
12221   #if CYTHON_FAST_PYCCALL
12222   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
12223     PyObject *__pyx_temp[6] = {__pyx_t_5, ((PyObject *)__pyx_v_Q), ((PyObject *)__pyx_v_index), __pyx_t_3, __pyx_t_4, ((PyObject *)__pyx_v_dQ)};
12224     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 5+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
12225     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12226     __Pyx_GOTREF(__pyx_t_1);
12227     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12228     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12229   } else
12230   #endif
12231   {
12232     __pyx_t_7 = PyTuple_New(5+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error)
12233     __Pyx_GOTREF(__pyx_t_7);
12234     if (__pyx_t_5) {
12235       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
12236     }
12237     __Pyx_INCREF(((PyObject *)__pyx_v_Q));
12238     __Pyx_GIVEREF(((PyObject *)__pyx_v_Q));
12239     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_Q));
12240     __Pyx_INCREF(((PyObject *)__pyx_v_index));
12241     __Pyx_GIVEREF(((PyObject *)__pyx_v_index));
12242     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_index));
12243     __Pyx_GIVEREF(__pyx_t_3);
12244     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
12245     __Pyx_GIVEREF(__pyx_t_4);
12246     PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_t_4);
12247     __Pyx_INCREF(((PyObject *)__pyx_v_dQ));
12248     __Pyx_GIVEREF(((PyObject *)__pyx_v_dQ));
12249     PyTuple_SET_ITEM(__pyx_t_7, 4+__pyx_t_6, ((PyObject *)__pyx_v_dQ));
12250     __pyx_t_3 = 0;
12251     __pyx_t_4 = 0;
12252     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
12253     __Pyx_GOTREF(__pyx_t_1);
12254     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12255   }
12256   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12257   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12258 
12259   /* "GPy/models/state_space_cython.pyx":333
12260  *         super(Std_Dynamic_Callables_Cython,self).__init__(Q, index, Q_time_var_index, unique_Q_number,dQ)
12261  *
12262  *         self.A = A             # <<<<<<<<<<<<<<
12263  *         self.A_time_var_index = A_time_var_index
12264  *         self.dA = dA
12265  */
12266   __Pyx_INCREF(((PyObject *)__pyx_v_A));
12267   __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
12268   __Pyx_GOTREF(__pyx_v_self->A);
12269   __Pyx_DECREF(((PyObject *)__pyx_v_self->A));
12270   __pyx_v_self->A = ((PyArrayObject *)__pyx_v_A);
12271 
12272   /* "GPy/models/state_space_cython.pyx":334
12273  *
12274  *         self.A = A
12275  *         self.A_time_var_index = A_time_var_index             # <<<<<<<<<<<<<<
12276  *         self.dA = dA
12277  *
12278  */
12279   __pyx_v_self->A_time_var_index = __pyx_v_A_time_var_index;
12280 
12281   /* "GPy/models/state_space_cython.pyx":335
12282  *         self.A = A
12283  *         self.A_time_var_index = A_time_var_index
12284  *         self.dA = dA             # <<<<<<<<<<<<<<
12285  *
12286  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):
12287  */
12288   __Pyx_INCREF(((PyObject *)__pyx_v_dA));
12289   __Pyx_GIVEREF(((PyObject *)__pyx_v_dA));
12290   __Pyx_GOTREF(__pyx_v_self->dA);
12291   __Pyx_DECREF(((PyObject *)__pyx_v_self->dA));
12292   __pyx_v_self->dA = ((PyArrayObject *)__pyx_v_dA);
12293 
12294   /* "GPy/models/state_space_cython.pyx":324
12295  *         np.ndarray  dA
12296  *
12297  *     def __init__(self, np.ndarray[DTYPE_t, ndim=3] A, int A_time_var_index,             # <<<<<<<<<<<<<<
12298  *                  np.ndarray[DTYPE_t, ndim=3] Q,
12299  *                  np.ndarray[DTYPE_t, ndim=2] index,
12300  */
12301 
12302   /* function exit code */
12303   __pyx_r = 0;
12304   goto __pyx_L0;
12305   __pyx_L1_error:;
12306   __Pyx_XDECREF(__pyx_t_1);
12307   __Pyx_XDECREF(__pyx_t_2);
12308   __Pyx_XDECREF(__pyx_t_3);
12309   __Pyx_XDECREF(__pyx_t_4);
12310   __Pyx_XDECREF(__pyx_t_5);
12311   __Pyx_XDECREF(__pyx_t_7);
12312   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12313     __Pyx_PyThreadState_declare
12314     __Pyx_PyThreadState_assign
12315     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12316     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12317     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
12318     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA.rcbuffer->pybuffer);
12319     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
12320     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
12321   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12322   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12323   __pyx_r = -1;
12324   goto __pyx_L2;
12325   __pyx_L0:;
12326   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12327   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
12328   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA.rcbuffer->pybuffer);
12329   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
12330   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_index.rcbuffer->pybuffer);
12331   __pyx_L2:;
12332   __Pyx_RefNannyFinishContext();
12333   return __pyx_r;
12334 }
12335 
12336 /* "GPy/models/state_space_cython.pyx":337
12337  *         self.dA = dA
12338  *
12339  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
12340  *         """
12341  *             f_a: function (k, x_{k-1}, A_{k}). Dynamic function.
12342  */
12343 
12344 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_A,int __pyx_skip_dispatch)12345 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch) {
12346   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
12347   __Pyx_Buffer __pyx_pybuffer_A;
12348   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
12349   __Pyx_Buffer __pyx_pybuffer_m;
12350   PyObject *__pyx_r = NULL;
12351   __Pyx_RefNannyDeclarations
12352   PyObject *__pyx_t_1 = NULL;
12353   PyObject *__pyx_t_2 = NULL;
12354   PyObject *__pyx_t_3 = NULL;
12355   PyObject *__pyx_t_4 = NULL;
12356   PyObject *__pyx_t_5 = NULL;
12357   int __pyx_t_6;
12358   PyObject *__pyx_t_7 = NULL;
12359   int __pyx_lineno = 0;
12360   const char *__pyx_filename = NULL;
12361   int __pyx_clineno = 0;
12362   __Pyx_RefNannySetupContext("f_a", 0);
12363   __pyx_pybuffer_m.pybuffer.buf = NULL;
12364   __pyx_pybuffer_m.refcount = 0;
12365   __pyx_pybuffernd_m.data = NULL;
12366   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
12367   __pyx_pybuffer_A.pybuffer.buf = NULL;
12368   __pyx_pybuffer_A.refcount = 0;
12369   __pyx_pybuffernd_A.data = NULL;
12370   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
12371   {
12372     __Pyx_BufFmt_StackElem __pyx_stack[1];
12373     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
12374   }
12375   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
12376   {
12377     __Pyx_BufFmt_StackElem __pyx_stack[1];
12378     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
12379   }
12380   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
12381   /* Check if called by wrapper */
12382   if (unlikely(__pyx_skip_dispatch)) ;
12383   /* Check if overridden in Python */
12384   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
12385     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12386     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12387     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
12388       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12389       #endif
12390       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
12391       __Pyx_GOTREF(__pyx_t_1);
12392       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a)) {
12393         __Pyx_XDECREF(__pyx_r);
12394         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 337, __pyx_L1_error)
12395         __Pyx_GOTREF(__pyx_t_3);
12396         __Pyx_INCREF(__pyx_t_1);
12397         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
12398         __pyx_t_6 = 0;
12399         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12400           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
12401           if (likely(__pyx_t_5)) {
12402             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12403             __Pyx_INCREF(__pyx_t_5);
12404             __Pyx_INCREF(function);
12405             __Pyx_DECREF_SET(__pyx_t_4, function);
12406             __pyx_t_6 = 1;
12407           }
12408         }
12409         #if CYTHON_FAST_PYCALL
12410         if (PyFunction_Check(__pyx_t_4)) {
12411           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
12412           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
12413           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12414           __Pyx_GOTREF(__pyx_t_2);
12415           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12416         } else
12417         #endif
12418         #if CYTHON_FAST_PYCCALL
12419         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12420           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
12421           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
12422           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12423           __Pyx_GOTREF(__pyx_t_2);
12424           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12425         } else
12426         #endif
12427         {
12428           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error)
12429           __Pyx_GOTREF(__pyx_t_7);
12430           if (__pyx_t_5) {
12431             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
12432           }
12433           __Pyx_GIVEREF(__pyx_t_3);
12434           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
12435           __Pyx_INCREF(((PyObject *)__pyx_v_m));
12436           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
12437           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
12438           __Pyx_INCREF(((PyObject *)__pyx_v_A));
12439           __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
12440           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_A));
12441           __pyx_t_3 = 0;
12442           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
12443           __Pyx_GOTREF(__pyx_t_2);
12444           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12445         }
12446         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12447         __pyx_r = __pyx_t_2;
12448         __pyx_t_2 = 0;
12449         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12450         goto __pyx_L0;
12451       }
12452       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12453       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12454       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
12455       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
12456         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12457       }
12458       #endif
12459       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12460       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12461     }
12462     #endif
12463   }
12464 
12465   /* "GPy/models/state_space_cython.pyx":345
12466  *         """
12467  *
12468  *         return np.dot(A,m)             # <<<<<<<<<<<<<<
12469  *
12470  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix
12471  */
12472   __Pyx_XDECREF(__pyx_r);
12473   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
12474   __Pyx_GOTREF(__pyx_t_2);
12475   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 345, __pyx_L1_error)
12476   __Pyx_GOTREF(__pyx_t_4);
12477   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12478   __pyx_t_2 = NULL;
12479   __pyx_t_6 = 0;
12480   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12481     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
12482     if (likely(__pyx_t_2)) {
12483       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12484       __Pyx_INCREF(__pyx_t_2);
12485       __Pyx_INCREF(function);
12486       __Pyx_DECREF_SET(__pyx_t_4, function);
12487       __pyx_t_6 = 1;
12488     }
12489   }
12490   #if CYTHON_FAST_PYCALL
12491   if (PyFunction_Check(__pyx_t_4)) {
12492     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_m)};
12493     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
12494     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12495     __Pyx_GOTREF(__pyx_t_1);
12496   } else
12497   #endif
12498   #if CYTHON_FAST_PYCCALL
12499   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12500     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_m)};
12501     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
12502     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
12503     __Pyx_GOTREF(__pyx_t_1);
12504   } else
12505   #endif
12506   {
12507     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error)
12508     __Pyx_GOTREF(__pyx_t_7);
12509     if (__pyx_t_2) {
12510       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
12511     }
12512     __Pyx_INCREF(((PyObject *)__pyx_v_A));
12513     __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
12514     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_A));
12515     __Pyx_INCREF(((PyObject *)__pyx_v_m));
12516     __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
12517     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
12518     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
12519     __Pyx_GOTREF(__pyx_t_1);
12520     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12521   }
12522   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12523   __pyx_r = __pyx_t_1;
12524   __pyx_t_1 = 0;
12525   goto __pyx_L0;
12526 
12527   /* "GPy/models/state_space_cython.pyx":337
12528  *         self.dA = dA
12529  *
12530  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
12531  *         """
12532  *             f_a: function (k, x_{k-1}, A_{k}). Dynamic function.
12533  */
12534 
12535   /* function exit code */
12536   __pyx_L1_error:;
12537   __Pyx_XDECREF(__pyx_t_1);
12538   __Pyx_XDECREF(__pyx_t_2);
12539   __Pyx_XDECREF(__pyx_t_3);
12540   __Pyx_XDECREF(__pyx_t_4);
12541   __Pyx_XDECREF(__pyx_t_5);
12542   __Pyx_XDECREF(__pyx_t_7);
12543   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12544     __Pyx_PyThreadState_declare
12545     __Pyx_PyThreadState_assign
12546     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12547     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12548     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
12549   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12550   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
12551   __pyx_r = 0;
12552   goto __pyx_L2;
12553   __pyx_L0:;
12554   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12555   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
12556   __pyx_L2:;
12557   __Pyx_XGIVEREF(__pyx_r);
12558   __Pyx_RefNannyFinishContext();
12559   return __pyx_r;
12560 }
12561 
12562 /* Python wrapper */
12563 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12564 static char __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a[] = "\n            f_a: function (k, x_{k-1}, A_{k}). Dynamic function.        \n            k (iteration number), starts at 0\n            x_{k-1} State from the previous step\n            A_{k} Jacobian matrices of f_a. In the linear case it is exactly A_{k}.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12565 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12566   int __pyx_v_k;
12567   PyArrayObject *__pyx_v_m = 0;
12568   PyArrayObject *__pyx_v_A = 0;
12569   int __pyx_lineno = 0;
12570   const char *__pyx_filename = NULL;
12571   int __pyx_clineno = 0;
12572   PyObject *__pyx_r = 0;
12573   __Pyx_RefNannyDeclarations
12574   __Pyx_RefNannySetupContext("f_a (wrapper)", 0);
12575   {
12576     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_A,0};
12577     PyObject* values[3] = {0,0,0};
12578     if (unlikely(__pyx_kwds)) {
12579       Py_ssize_t kw_args;
12580       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12581       switch (pos_args) {
12582         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12583         CYTHON_FALLTHROUGH;
12584         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12585         CYTHON_FALLTHROUGH;
12586         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12587         CYTHON_FALLTHROUGH;
12588         case  0: break;
12589         default: goto __pyx_L5_argtuple_error;
12590       }
12591       kw_args = PyDict_Size(__pyx_kwds);
12592       switch (pos_args) {
12593         case  0:
12594         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
12595         else goto __pyx_L5_argtuple_error;
12596         CYTHON_FALLTHROUGH;
12597         case  1:
12598         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
12599         else {
12600           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 1); __PYX_ERR(0, 337, __pyx_L3_error)
12601         }
12602         CYTHON_FALLTHROUGH;
12603         case  2:
12604         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
12605         else {
12606           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 2); __PYX_ERR(0, 337, __pyx_L3_error)
12607         }
12608       }
12609       if (unlikely(kw_args > 0)) {
12610         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f_a") < 0)) __PYX_ERR(0, 337, __pyx_L3_error)
12611       }
12612     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12613       goto __pyx_L5_argtuple_error;
12614     } else {
12615       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12616       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12617       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12618     }
12619     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L3_error)
12620     __pyx_v_m = ((PyArrayObject *)values[1]);
12621     __pyx_v_A = ((PyArrayObject *)values[2]);
12622   }
12623   goto __pyx_L4_argument_unpacking_done;
12624   __pyx_L5_argtuple_error:;
12625   __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 337, __pyx_L3_error)
12626   __pyx_L3_error:;
12627   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
12628   __Pyx_RefNannyFinishContext();
12629   return NULL;
12630   __pyx_L4_argument_unpacking_done:;
12631   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 337, __pyx_L1_error)
12632   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 337, __pyx_L1_error)
12633   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_A);
12634 
12635   /* function exit code */
12636   goto __pyx_L0;
12637   __pyx_L1_error:;
12638   __pyx_r = NULL;
12639   __pyx_L0:;
12640   __Pyx_RefNannyFinishContext();
12641   return __pyx_r;
12642 }
12643 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_A)12644 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A) {
12645   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
12646   __Pyx_Buffer __pyx_pybuffer_A;
12647   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
12648   __Pyx_Buffer __pyx_pybuffer_m;
12649   PyObject *__pyx_r = NULL;
12650   __Pyx_RefNannyDeclarations
12651   PyObject *__pyx_t_1 = NULL;
12652   int __pyx_lineno = 0;
12653   const char *__pyx_filename = NULL;
12654   int __pyx_clineno = 0;
12655   __Pyx_RefNannySetupContext("f_a", 0);
12656   __pyx_pybuffer_m.pybuffer.buf = NULL;
12657   __pyx_pybuffer_m.refcount = 0;
12658   __pyx_pybuffernd_m.data = NULL;
12659   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
12660   __pyx_pybuffer_A.pybuffer.buf = NULL;
12661   __pyx_pybuffer_A.refcount = 0;
12662   __pyx_pybuffernd_A.data = NULL;
12663   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
12664   {
12665     __Pyx_BufFmt_StackElem __pyx_stack[1];
12666     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
12667   }
12668   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
12669   {
12670     __Pyx_BufFmt_StackElem __pyx_stack[1];
12671     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 337, __pyx_L1_error)
12672   }
12673   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
12674   __Pyx_XDECREF(__pyx_r);
12675   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_f_a(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m), ((PyArrayObject *)__pyx_v_A), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
12676   __Pyx_GOTREF(__pyx_t_1);
12677   __pyx_r = __pyx_t_1;
12678   __pyx_t_1 = 0;
12679   goto __pyx_L0;
12680 
12681   /* function exit code */
12682   __pyx_L1_error:;
12683   __Pyx_XDECREF(__pyx_t_1);
12684   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12685     __Pyx_PyThreadState_declare
12686     __Pyx_PyThreadState_assign
12687     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12688     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12689     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
12690   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12691   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
12692   __pyx_r = NULL;
12693   goto __pyx_L2;
12694   __pyx_L0:;
12695   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
12696   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
12697   __pyx_L2:;
12698   __Pyx_XGIVEREF(__pyx_r);
12699   __Pyx_RefNannyFinishContext();
12700   return __pyx_r;
12701 }
12702 
12703 /* "GPy/models/state_space_cython.pyx":347
12704  *         return np.dot(A,m)
12705  *
12706  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
12707  *         """
12708  *         function (k, m, P) return Jacobian of measurement function, it is
12709  */
12710 
12711 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m_pred,CYTHON_UNUSED PyArrayObject * __pyx_v_P_pred,int __pyx_skip_dispatch)12712 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m_pred, CYTHON_UNUSED PyArrayObject *__pyx_v_P_pred, int __pyx_skip_dispatch) {
12713   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
12714   __Pyx_Buffer __pyx_pybuffer_P_pred;
12715   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
12716   __Pyx_Buffer __pyx_pybuffer_m_pred;
12717   PyObject *__pyx_r = NULL;
12718   __Pyx_RefNannyDeclarations
12719   PyObject *__pyx_t_1 = NULL;
12720   PyObject *__pyx_t_2 = NULL;
12721   PyObject *__pyx_t_3 = NULL;
12722   PyObject *__pyx_t_4 = NULL;
12723   PyObject *__pyx_t_5 = NULL;
12724   int __pyx_t_6;
12725   PyObject *__pyx_t_7 = NULL;
12726   int __pyx_lineno = 0;
12727   const char *__pyx_filename = NULL;
12728   int __pyx_clineno = 0;
12729   __Pyx_RefNannySetupContext("Ak", 0);
12730   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
12731   __pyx_pybuffer_m_pred.refcount = 0;
12732   __pyx_pybuffernd_m_pred.data = NULL;
12733   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
12734   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
12735   __pyx_pybuffer_P_pred.refcount = 0;
12736   __pyx_pybuffernd_P_pred.data = NULL;
12737   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
12738   {
12739     __Pyx_BufFmt_StackElem __pyx_stack[1];
12740     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
12741   }
12742   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
12743   {
12744     __Pyx_BufFmt_StackElem __pyx_stack[1];
12745     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
12746   }
12747   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
12748   /* Check if called by wrapper */
12749   if (unlikely(__pyx_skip_dispatch)) ;
12750   /* Check if overridden in Python */
12751   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
12752     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12753     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12754     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
12755       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12756       #endif
12757       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Ak); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
12758       __Pyx_GOTREF(__pyx_t_1);
12759       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak)) {
12760         __Pyx_XDECREF(__pyx_r);
12761         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 347, __pyx_L1_error)
12762         __Pyx_GOTREF(__pyx_t_3);
12763         __Pyx_INCREF(__pyx_t_1);
12764         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
12765         __pyx_t_6 = 0;
12766         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
12767           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
12768           if (likely(__pyx_t_5)) {
12769             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
12770             __Pyx_INCREF(__pyx_t_5);
12771             __Pyx_INCREF(function);
12772             __Pyx_DECREF_SET(__pyx_t_4, function);
12773             __pyx_t_6 = 1;
12774           }
12775         }
12776         #if CYTHON_FAST_PYCALL
12777         if (PyFunction_Check(__pyx_t_4)) {
12778           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
12779           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
12780           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12781           __Pyx_GOTREF(__pyx_t_2);
12782           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12783         } else
12784         #endif
12785         #if CYTHON_FAST_PYCCALL
12786         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
12787           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m_pred), ((PyObject *)__pyx_v_P_pred)};
12788           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
12789           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12790           __Pyx_GOTREF(__pyx_t_2);
12791           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12792         } else
12793         #endif
12794         {
12795           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error)
12796           __Pyx_GOTREF(__pyx_t_7);
12797           if (__pyx_t_5) {
12798             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
12799           }
12800           __Pyx_GIVEREF(__pyx_t_3);
12801           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
12802           __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
12803           __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
12804           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m_pred));
12805           __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
12806           __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
12807           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_P_pred));
12808           __pyx_t_3 = 0;
12809           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
12810           __Pyx_GOTREF(__pyx_t_2);
12811           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12812         }
12813         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12814         __pyx_r = __pyx_t_2;
12815         __pyx_t_2 = 0;
12816         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12817         goto __pyx_L0;
12818       }
12819       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12820       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
12821       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
12822       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
12823         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
12824       }
12825       #endif
12826       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12827       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
12828     }
12829     #endif
12830   }
12831 
12832   /* "GPy/models/state_space_cython.pyx":356
12833  *         """
12834  *
12835  *         return self.A[:,:, <int>self.index[self.A_time_var_index, k]]             # <<<<<<<<<<<<<<
12836  *
12837  *     cpdef dAk(self, int k):
12838  */
12839   __Pyx_XDECREF(__pyx_r);
12840   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->A_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
12841   __Pyx_GOTREF(__pyx_t_1);
12842   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
12843   __Pyx_GOTREF(__pyx_t_2);
12844   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
12845   __Pyx_GOTREF(__pyx_t_4);
12846   __Pyx_GIVEREF(__pyx_t_1);
12847   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
12848   __Pyx_GIVEREF(__pyx_t_2);
12849   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
12850   __pyx_t_1 = 0;
12851   __pyx_t_2 = 0;
12852   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->__pyx_base.index), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
12853   __Pyx_GOTREF(__pyx_t_2);
12854   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12855   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L1_error)
12856   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12857   __pyx_t_2 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
12858   __Pyx_GOTREF(__pyx_t_2);
12859   __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
12860   __Pyx_GOTREF(__pyx_t_4);
12861   __Pyx_INCREF(__pyx_slice__10);
12862   __Pyx_GIVEREF(__pyx_slice__10);
12863   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
12864   __Pyx_INCREF(__pyx_slice__10);
12865   __Pyx_GIVEREF(__pyx_slice__10);
12866   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
12867   __Pyx_GIVEREF(__pyx_t_2);
12868   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
12869   __pyx_t_2 = 0;
12870   __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->A), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error)
12871   __Pyx_GOTREF(__pyx_t_2);
12872   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12873   __pyx_r = __pyx_t_2;
12874   __pyx_t_2 = 0;
12875   goto __pyx_L0;
12876 
12877   /* "GPy/models/state_space_cython.pyx":347
12878  *         return np.dot(A,m)
12879  *
12880  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix             # <<<<<<<<<<<<<<
12881  *         """
12882  *         function (k, m, P) return Jacobian of measurement function, it is
12883  */
12884 
12885   /* function exit code */
12886   __pyx_L1_error:;
12887   __Pyx_XDECREF(__pyx_t_1);
12888   __Pyx_XDECREF(__pyx_t_2);
12889   __Pyx_XDECREF(__pyx_t_3);
12890   __Pyx_XDECREF(__pyx_t_4);
12891   __Pyx_XDECREF(__pyx_t_5);
12892   __Pyx_XDECREF(__pyx_t_7);
12893   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
12894     __Pyx_PyThreadState_declare
12895     __Pyx_PyThreadState_assign
12896     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
12897     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
12898     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
12899   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
12900   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
12901   __pyx_r = 0;
12902   goto __pyx_L2;
12903   __pyx_L0:;
12904   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
12905   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
12906   __pyx_L2:;
12907   __Pyx_XGIVEREF(__pyx_r);
12908   __Pyx_RefNannyFinishContext();
12909   return __pyx_r;
12910 }
12911 
12912 /* Python wrapper */
12913 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12914 static char __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak[] = "\n        function (k, m, P) return Jacobian of measurement function, it is\n            passed into p_h.\n            k (iteration number), starts at 0\n            m: point where Jacobian is evaluated\n            P: parameter for Jacobian, usually covariance matrix.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)12915 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12916   int __pyx_v_k;
12917   PyArrayObject *__pyx_v_m_pred = 0;
12918   PyArrayObject *__pyx_v_P_pred = 0;
12919   int __pyx_lineno = 0;
12920   const char *__pyx_filename = NULL;
12921   int __pyx_clineno = 0;
12922   PyObject *__pyx_r = 0;
12923   __Pyx_RefNannyDeclarations
12924   __Pyx_RefNannySetupContext("Ak (wrapper)", 0);
12925   {
12926     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m_pred,&__pyx_n_s_P_pred,0};
12927     PyObject* values[3] = {0,0,0};
12928     if (unlikely(__pyx_kwds)) {
12929       Py_ssize_t kw_args;
12930       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12931       switch (pos_args) {
12932         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12933         CYTHON_FALLTHROUGH;
12934         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12935         CYTHON_FALLTHROUGH;
12936         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12937         CYTHON_FALLTHROUGH;
12938         case  0: break;
12939         default: goto __pyx_L5_argtuple_error;
12940       }
12941       kw_args = PyDict_Size(__pyx_kwds);
12942       switch (pos_args) {
12943         case  0:
12944         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
12945         else goto __pyx_L5_argtuple_error;
12946         CYTHON_FALLTHROUGH;
12947         case  1:
12948         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m_pred)) != 0)) kw_args--;
12949         else {
12950           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 1); __PYX_ERR(0, 347, __pyx_L3_error)
12951         }
12952         CYTHON_FALLTHROUGH;
12953         case  2:
12954         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P_pred)) != 0)) kw_args--;
12955         else {
12956           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 2); __PYX_ERR(0, 347, __pyx_L3_error)
12957         }
12958       }
12959       if (unlikely(kw_args > 0)) {
12960         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Ak") < 0)) __PYX_ERR(0, 347, __pyx_L3_error)
12961       }
12962     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
12963       goto __pyx_L5_argtuple_error;
12964     } else {
12965       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12966       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12967       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12968     }
12969     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 347, __pyx_L3_error)
12970     __pyx_v_m_pred = ((PyArrayObject *)values[1]);
12971     __pyx_v_P_pred = ((PyArrayObject *)values[2]);
12972   }
12973   goto __pyx_L4_argument_unpacking_done;
12974   __pyx_L5_argtuple_error:;
12975   __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 347, __pyx_L3_error)
12976   __pyx_L3_error:;
12977   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
12978   __Pyx_RefNannyFinishContext();
12979   return NULL;
12980   __pyx_L4_argument_unpacking_done:;
12981   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m_pred), __pyx_ptype_5numpy_ndarray, 1, "m_pred", 0))) __PYX_ERR(0, 347, __pyx_L1_error)
12982   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P_pred), __pyx_ptype_5numpy_ndarray, 1, "P_pred", 0))) __PYX_ERR(0, 347, __pyx_L1_error)
12983   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m_pred, __pyx_v_P_pred);
12984 
12985   /* function exit code */
12986   goto __pyx_L0;
12987   __pyx_L1_error:;
12988   __pyx_r = NULL;
12989   __pyx_L0:;
12990   __Pyx_RefNannyFinishContext();
12991   return __pyx_r;
12992 }
12993 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m_pred,PyArrayObject * __pyx_v_P_pred)12994 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m_pred, PyArrayObject *__pyx_v_P_pred) {
12995   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
12996   __Pyx_Buffer __pyx_pybuffer_P_pred;
12997   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
12998   __Pyx_Buffer __pyx_pybuffer_m_pred;
12999   PyObject *__pyx_r = NULL;
13000   __Pyx_RefNannyDeclarations
13001   PyObject *__pyx_t_1 = NULL;
13002   int __pyx_lineno = 0;
13003   const char *__pyx_filename = NULL;
13004   int __pyx_clineno = 0;
13005   __Pyx_RefNannySetupContext("Ak", 0);
13006   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
13007   __pyx_pybuffer_m_pred.refcount = 0;
13008   __pyx_pybuffernd_m_pred.data = NULL;
13009   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
13010   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
13011   __pyx_pybuffer_P_pred.refcount = 0;
13012   __pyx_pybuffernd_P_pred.data = NULL;
13013   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
13014   {
13015     __Pyx_BufFmt_StackElem __pyx_stack[1];
13016     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
13017   }
13018   __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
13019   {
13020     __Pyx_BufFmt_StackElem __pyx_stack[1];
13021     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 347, __pyx_L1_error)
13022   }
13023   __pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
13024   __Pyx_XDECREF(__pyx_r);
13025   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_Ak(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m_pred), ((PyArrayObject *)__pyx_v_P_pred), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
13026   __Pyx_GOTREF(__pyx_t_1);
13027   __pyx_r = __pyx_t_1;
13028   __pyx_t_1 = 0;
13029   goto __pyx_L0;
13030 
13031   /* function exit code */
13032   __pyx_L1_error:;
13033   __Pyx_XDECREF(__pyx_t_1);
13034   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13035     __Pyx_PyThreadState_declare
13036     __Pyx_PyThreadState_assign
13037     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13038     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
13039     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
13040   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13041   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
13042   __pyx_r = NULL;
13043   goto __pyx_L2;
13044   __pyx_L0:;
13045   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
13046   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
13047   __pyx_L2:;
13048   __Pyx_XGIVEREF(__pyx_r);
13049   __Pyx_RefNannyFinishContext();
13050   return __pyx_r;
13051 }
13052 
13053 /* "GPy/models/state_space_cython.pyx":358
13054  *         return self.A[:,:, <int>self.index[self.A_time_var_index, k]]
13055  *
13056  *     cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
13057  *         if self.dA is None:
13058  *             raise ValueError("dA derivative is None")
13059  */
13060 
13061 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,int __pyx_skip_dispatch)13062 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, int __pyx_skip_dispatch) {
13063   PyObject *__pyx_r = NULL;
13064   __Pyx_RefNannyDeclarations
13065   PyObject *__pyx_t_1 = NULL;
13066   PyObject *__pyx_t_2 = NULL;
13067   PyObject *__pyx_t_3 = NULL;
13068   PyObject *__pyx_t_4 = NULL;
13069   PyObject *__pyx_t_5 = NULL;
13070   int __pyx_t_6;
13071   int __pyx_t_7;
13072   int __pyx_lineno = 0;
13073   const char *__pyx_filename = NULL;
13074   int __pyx_clineno = 0;
13075   __Pyx_RefNannySetupContext("dAk", 0);
13076   /* Check if called by wrapper */
13077   if (unlikely(__pyx_skip_dispatch)) ;
13078   /* Check if overridden in Python */
13079   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
13080     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13081     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13082     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
13083       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13084       #endif
13085       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dAk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
13086       __Pyx_GOTREF(__pyx_t_1);
13087       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk)) {
13088         __Pyx_XDECREF(__pyx_r);
13089         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
13090         __Pyx_GOTREF(__pyx_t_3);
13091         __Pyx_INCREF(__pyx_t_1);
13092         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
13093         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
13094           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
13095           if (likely(__pyx_t_5)) {
13096             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
13097             __Pyx_INCREF(__pyx_t_5);
13098             __Pyx_INCREF(function);
13099             __Pyx_DECREF_SET(__pyx_t_4, function);
13100           }
13101         }
13102         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
13103         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13104         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13105         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error)
13106         __Pyx_GOTREF(__pyx_t_2);
13107         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13108         __pyx_r = __pyx_t_2;
13109         __pyx_t_2 = 0;
13110         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13111         goto __pyx_L0;
13112       }
13113       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13114       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13115       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
13116       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
13117         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13118       }
13119       #endif
13120       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13121       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13122     }
13123     #endif
13124   }
13125 
13126   /* "GPy/models/state_space_cython.pyx":359
13127  *
13128  *     cpdef dAk(self, int k):
13129  *         if self.dA is None:             # <<<<<<<<<<<<<<
13130  *             raise ValueError("dA derivative is None")
13131  *
13132  */
13133   __pyx_t_6 = (((PyObject *)__pyx_v_self->dA) == Py_None);
13134   __pyx_t_7 = (__pyx_t_6 != 0);
13135   if (unlikely(__pyx_t_7)) {
13136 
13137     /* "GPy/models/state_space_cython.pyx":360
13138  *     cpdef dAk(self, int k):
13139  *         if self.dA is None:
13140  *             raise ValueError("dA derivative is None")             # <<<<<<<<<<<<<<
13141  *
13142  *         return self.dA # the same dirivative on each iteration
13143  */
13144     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
13145     __Pyx_GOTREF(__pyx_t_1);
13146     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13147     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13148     __PYX_ERR(0, 360, __pyx_L1_error)
13149 
13150     /* "GPy/models/state_space_cython.pyx":359
13151  *
13152  *     cpdef dAk(self, int k):
13153  *         if self.dA is None:             # <<<<<<<<<<<<<<
13154  *             raise ValueError("dA derivative is None")
13155  *
13156  */
13157   }
13158 
13159   /* "GPy/models/state_space_cython.pyx":362
13160  *             raise ValueError("dA derivative is None")
13161  *
13162  *         return self.dA # the same dirivative on each iteration             # <<<<<<<<<<<<<<
13163  *
13164  *
13165  */
13166   __Pyx_XDECREF(__pyx_r);
13167   __Pyx_INCREF(((PyObject *)__pyx_v_self->dA));
13168   __pyx_r = ((PyObject *)__pyx_v_self->dA);
13169   goto __pyx_L0;
13170 
13171   /* "GPy/models/state_space_cython.pyx":358
13172  *         return self.A[:,:, <int>self.index[self.A_time_var_index, k]]
13173  *
13174  *     cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
13175  *         if self.dA is None:
13176  *             raise ValueError("dA derivative is None")
13177  */
13178 
13179   /* function exit code */
13180   __pyx_L1_error:;
13181   __Pyx_XDECREF(__pyx_t_1);
13182   __Pyx_XDECREF(__pyx_t_2);
13183   __Pyx_XDECREF(__pyx_t_3);
13184   __Pyx_XDECREF(__pyx_t_4);
13185   __Pyx_XDECREF(__pyx_t_5);
13186   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
13187   __pyx_r = 0;
13188   __pyx_L0:;
13189   __Pyx_XGIVEREF(__pyx_r);
13190   __Pyx_RefNannyFinishContext();
13191   return __pyx_r;
13192 }
13193 
13194 /* Python wrapper */
13195 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)13196 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
13197   int __pyx_v_k;
13198   int __pyx_lineno = 0;
13199   const char *__pyx_filename = NULL;
13200   int __pyx_clineno = 0;
13201   PyObject *__pyx_r = 0;
13202   __Pyx_RefNannyDeclarations
13203   __Pyx_RefNannySetupContext("dAk (wrapper)", 0);
13204   assert(__pyx_arg_k); {
13205     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 358, __pyx_L3_error)
13206   }
13207   goto __pyx_L4_argument_unpacking_done;
13208   __pyx_L3_error:;
13209   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
13210   __Pyx_RefNannyFinishContext();
13211   return NULL;
13212   __pyx_L4_argument_unpacking_done:;
13213   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_6dAk(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), ((int)__pyx_v_k));
13214 
13215   /* function exit code */
13216   __Pyx_RefNannyFinishContext();
13217   return __pyx_r;
13218 }
13219 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_6dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_k)13220 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_6dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_k) {
13221   PyObject *__pyx_r = NULL;
13222   __Pyx_RefNannyDeclarations
13223   PyObject *__pyx_t_1 = NULL;
13224   int __pyx_lineno = 0;
13225   const char *__pyx_filename = NULL;
13226   int __pyx_clineno = 0;
13227   __Pyx_RefNannySetupContext("dAk", 0);
13228   __Pyx_XDECREF(__pyx_r);
13229   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_dAk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error)
13230   __Pyx_GOTREF(__pyx_t_1);
13231   __pyx_r = __pyx_t_1;
13232   __pyx_t_1 = 0;
13233   goto __pyx_L0;
13234 
13235   /* function exit code */
13236   __pyx_L1_error:;
13237   __Pyx_XDECREF(__pyx_t_1);
13238   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
13239   __pyx_r = NULL;
13240   __pyx_L0:;
13241   __Pyx_XGIVEREF(__pyx_r);
13242   __Pyx_RefNannyFinishContext();
13243   return __pyx_r;
13244 }
13245 
13246 /* "GPy/models/state_space_cython.pyx":365
13247  *
13248  *
13249  *     cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
13250  *         """
13251  *         For reusing this object e.g. in smoother computation. It makes sence
13252  */
13253 
13254 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset * __pyx_optional_args)13255 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset *__pyx_optional_args) {
13256   int __pyx_v_compute_derivatives = ((int)0);
13257   PyObject *__pyx_r = NULL;
13258   __Pyx_RefNannyDeclarations
13259   PyObject *__pyx_t_1 = NULL;
13260   PyObject *__pyx_t_2 = NULL;
13261   PyObject *__pyx_t_3 = NULL;
13262   PyObject *__pyx_t_4 = NULL;
13263   PyObject *__pyx_t_5 = NULL;
13264   int __pyx_lineno = 0;
13265   const char *__pyx_filename = NULL;
13266   int __pyx_clineno = 0;
13267   __Pyx_RefNannySetupContext("reset", 0);
13268   if (__pyx_optional_args) {
13269     if (__pyx_optional_args->__pyx_n > 0) {
13270       __pyx_v_compute_derivatives = __pyx_optional_args->compute_derivatives;
13271     }
13272   }
13273   /* Check if called by wrapper */
13274   if (unlikely(__pyx_skip_dispatch)) ;
13275   /* Check if overridden in Python */
13276   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
13277     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13278     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13279     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
13280       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13281       #endif
13282       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
13283       __Pyx_GOTREF(__pyx_t_1);
13284       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset)) {
13285         __Pyx_XDECREF(__pyx_r);
13286         __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_compute_derivatives); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error)
13287         __Pyx_GOTREF(__pyx_t_3);
13288         __Pyx_INCREF(__pyx_t_1);
13289         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
13290         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
13291           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
13292           if (likely(__pyx_t_5)) {
13293             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
13294             __Pyx_INCREF(__pyx_t_5);
13295             __Pyx_INCREF(function);
13296             __Pyx_DECREF_SET(__pyx_t_4, function);
13297           }
13298         }
13299         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
13300         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
13301         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13302         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error)
13303         __Pyx_GOTREF(__pyx_t_2);
13304         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13305         __pyx_r = __pyx_t_2;
13306         __pyx_t_2 = 0;
13307         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13308         goto __pyx_L0;
13309       }
13310       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13311       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
13312       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
13313       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
13314         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
13315       }
13316       #endif
13317       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13318       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
13319     }
13320     #endif
13321   }
13322 
13323   /* "GPy/models/state_space_cython.pyx":371
13324  *         time steps.
13325  *         """
13326  *         return self             # <<<<<<<<<<<<<<
13327  *
13328  * cdef class AQcompute_batch_Cython(Q_handling_Cython):
13329  */
13330   __Pyx_XDECREF(__pyx_r);
13331   __Pyx_INCREF(((PyObject *)__pyx_v_self));
13332   __pyx_r = ((PyObject *)__pyx_v_self);
13333   goto __pyx_L0;
13334 
13335   /* "GPy/models/state_space_cython.pyx":365
13336  *
13337  *
13338  *     cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
13339  *         """
13340  *         For reusing this object e.g. in smoother computation. It makes sence
13341  */
13342 
13343   /* function exit code */
13344   __pyx_L1_error:;
13345   __Pyx_XDECREF(__pyx_t_1);
13346   __Pyx_XDECREF(__pyx_t_2);
13347   __Pyx_XDECREF(__pyx_t_3);
13348   __Pyx_XDECREF(__pyx_t_4);
13349   __Pyx_XDECREF(__pyx_t_5);
13350   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
13351   __pyx_r = 0;
13352   __pyx_L0:;
13353   __Pyx_XGIVEREF(__pyx_r);
13354   __Pyx_RefNannyFinishContext();
13355   return __pyx_r;
13356 }
13357 
13358 /* Python wrapper */
13359 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13360 static char __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset[] = "\n        For reusing this object e.g. in smoother computation. It makes sence\n        because necessary matrices have been already computed for all\n        time steps.\n        ";
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13361 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13362   int __pyx_v_compute_derivatives;
13363   int __pyx_lineno = 0;
13364   const char *__pyx_filename = NULL;
13365   int __pyx_clineno = 0;
13366   PyObject *__pyx_r = 0;
13367   __Pyx_RefNannyDeclarations
13368   __Pyx_RefNannySetupContext("reset (wrapper)", 0);
13369   {
13370     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_compute_derivatives,0};
13371     PyObject* values[1] = {0};
13372     if (unlikely(__pyx_kwds)) {
13373       Py_ssize_t kw_args;
13374       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13375       switch (pos_args) {
13376         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13377         CYTHON_FALLTHROUGH;
13378         case  0: break;
13379         default: goto __pyx_L5_argtuple_error;
13380       }
13381       kw_args = PyDict_Size(__pyx_kwds);
13382       switch (pos_args) {
13383         case  0:
13384         if (kw_args > 0) {
13385           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_derivatives);
13386           if (value) { values[0] = value; kw_args--; }
13387         }
13388       }
13389       if (unlikely(kw_args > 0)) {
13390         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset") < 0)) __PYX_ERR(0, 365, __pyx_L3_error)
13391       }
13392     } else {
13393       switch (PyTuple_GET_SIZE(__pyx_args)) {
13394         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13395         CYTHON_FALLTHROUGH;
13396         case  0: break;
13397         default: goto __pyx_L5_argtuple_error;
13398       }
13399     }
13400     if (values[0]) {
13401       __pyx_v_compute_derivatives = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_compute_derivatives == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error)
13402     } else {
13403       __pyx_v_compute_derivatives = ((int)0);
13404     }
13405   }
13406   goto __pyx_L4_argument_unpacking_done;
13407   __pyx_L5_argtuple_error:;
13408   __Pyx_RaiseArgtupleInvalid("reset", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 365, __pyx_L3_error)
13409   __pyx_L3_error:;
13410   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
13411   __Pyx_RefNannyFinishContext();
13412   return NULL;
13413   __pyx_L4_argument_unpacking_done:;
13414   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), __pyx_v_compute_derivatives);
13415 
13416   /* function exit code */
13417   __Pyx_RefNannyFinishContext();
13418   return __pyx_r;
13419 }
13420 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,int __pyx_v_compute_derivatives)13421 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, int __pyx_v_compute_derivatives) {
13422   PyObject *__pyx_r = NULL;
13423   __Pyx_RefNannyDeclarations
13424   PyObject *__pyx_t_1 = NULL;
13425   struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset __pyx_t_2;
13426   int __pyx_lineno = 0;
13427   const char *__pyx_filename = NULL;
13428   int __pyx_clineno = 0;
13429   __Pyx_RefNannySetupContext("reset", 0);
13430   __Pyx_XDECREF(__pyx_r);
13431   __pyx_t_2.__pyx_n = 1;
13432   __pyx_t_2.compute_derivatives = __pyx_v_compute_derivatives;
13433   __pyx_t_1 = __pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython->__pyx_base.__pyx_base.reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error)
13434   __Pyx_GOTREF(__pyx_t_1);
13435   __pyx_r = __pyx_t_1;
13436   __pyx_t_1 = 0;
13437   goto __pyx_L0;
13438 
13439   /* function exit code */
13440   __pyx_L1_error:;
13441   __Pyx_XDECREF(__pyx_t_1);
13442   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
13443   __pyx_r = NULL;
13444   __pyx_L0:;
13445   __Pyx_XGIVEREF(__pyx_r);
13446   __Pyx_RefNannyFinishContext();
13447   return __pyx_r;
13448 }
13449 
13450 /* "(tree fragment)":1
13451  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
13452  *     cdef tuple state
13453  *     cdef object _dict
13454  */
13455 
13456 /* Python wrapper */
13457 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_11__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)13458 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13459   PyObject *__pyx_r = 0;
13460   __Pyx_RefNannyDeclarations
13461   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13462   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_10__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self));
13463 
13464   /* function exit code */
13465   __Pyx_RefNannyFinishContext();
13466   return __pyx_r;
13467 }
13468 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_10__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self)13469 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_10__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self) {
13470   PyObject *__pyx_v_state = 0;
13471   PyObject *__pyx_v__dict = 0;
13472   int __pyx_v_use_setstate;
13473   PyObject *__pyx_r = NULL;
13474   __Pyx_RefNannyDeclarations
13475   PyObject *__pyx_t_1 = NULL;
13476   PyObject *__pyx_t_2 = NULL;
13477   PyObject *__pyx_t_3 = NULL;
13478   PyObject *__pyx_t_4 = NULL;
13479   int __pyx_t_5;
13480   int __pyx_t_6;
13481   int __pyx_t_7;
13482   int __pyx_lineno = 0;
13483   const char *__pyx_filename = NULL;
13484   int __pyx_clineno = 0;
13485   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13486 
13487   /* "(tree fragment)":5
13488  *     cdef object _dict
13489  *     cdef bint use_setstate
13490  *     state = (self.A, self.A_time_var_index, self.Q, self.Q_square_root, self.Q_time_var_index, self.dA, self.dQ, self.index, self.svd_each_time)             # <<<<<<<<<<<<<<
13491  *     _dict = getattr(self, '__dict__', None)
13492  *     if _dict is not None:
13493  */
13494   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->A_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
13495   __Pyx_GOTREF(__pyx_t_1);
13496   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.Q_time_var_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
13497   __Pyx_GOTREF(__pyx_t_2);
13498   __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.svd_each_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
13499   __Pyx_GOTREF(__pyx_t_3);
13500   __pyx_t_4 = PyTuple_New(9); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
13501   __Pyx_GOTREF(__pyx_t_4);
13502   __Pyx_INCREF(((PyObject *)__pyx_v_self->A));
13503   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->A));
13504   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->A));
13505   __Pyx_GIVEREF(__pyx_t_1);
13506   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
13507   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.Q));
13508   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.Q));
13509   PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject *)__pyx_v_self->__pyx_base.Q));
13510   __Pyx_INCREF(__pyx_v_self->__pyx_base.Q_square_root);
13511   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.Q_square_root);
13512   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_self->__pyx_base.Q_square_root);
13513   __Pyx_GIVEREF(__pyx_t_2);
13514   PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_2);
13515   __Pyx_INCREF(((PyObject *)__pyx_v_self->dA));
13516   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dA));
13517   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_self->dA));
13518   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.dQ));
13519   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.dQ));
13520   PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_self->__pyx_base.dQ));
13521   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.index));
13522   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.index));
13523   PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_self->__pyx_base.index));
13524   __Pyx_GIVEREF(__pyx_t_3);
13525   PyTuple_SET_ITEM(__pyx_t_4, 8, __pyx_t_3);
13526   __pyx_t_1 = 0;
13527   __pyx_t_2 = 0;
13528   __pyx_t_3 = 0;
13529   __pyx_v_state = ((PyObject*)__pyx_t_4);
13530   __pyx_t_4 = 0;
13531 
13532   /* "(tree fragment)":6
13533  *     cdef bint use_setstate
13534  *     state = (self.A, self.A_time_var_index, self.Q, self.Q_square_root, self.Q_time_var_index, self.dA, self.dQ, self.index, self.svd_each_time)
13535  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
13536  *     if _dict is not None:
13537  *         state += (_dict,)
13538  */
13539   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
13540   __Pyx_GOTREF(__pyx_t_4);
13541   __pyx_v__dict = __pyx_t_4;
13542   __pyx_t_4 = 0;
13543 
13544   /* "(tree fragment)":7
13545  *     state = (self.A, self.A_time_var_index, self.Q, self.Q_square_root, self.Q_time_var_index, self.dA, self.dQ, self.index, self.svd_each_time)
13546  *     _dict = getattr(self, '__dict__', None)
13547  *     if _dict is not None:             # <<<<<<<<<<<<<<
13548  *         state += (_dict,)
13549  *         use_setstate = True
13550  */
13551   __pyx_t_5 = (__pyx_v__dict != Py_None);
13552   __pyx_t_6 = (__pyx_t_5 != 0);
13553   if (__pyx_t_6) {
13554 
13555     /* "(tree fragment)":8
13556  *     _dict = getattr(self, '__dict__', None)
13557  *     if _dict is not None:
13558  *         state += (_dict,)             # <<<<<<<<<<<<<<
13559  *         use_setstate = True
13560  *     else:
13561  */
13562     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
13563     __Pyx_GOTREF(__pyx_t_4);
13564     __Pyx_INCREF(__pyx_v__dict);
13565     __Pyx_GIVEREF(__pyx_v__dict);
13566     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
13567     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
13568     __Pyx_GOTREF(__pyx_t_3);
13569     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13570     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
13571     __pyx_t_3 = 0;
13572 
13573     /* "(tree fragment)":9
13574  *     if _dict is not None:
13575  *         state += (_dict,)
13576  *         use_setstate = True             # <<<<<<<<<<<<<<
13577  *     else:
13578  *         use_setstate = self.A is not None or self.Q is not None or self.Q_square_root is not None or self.dA is not None or self.dQ is not None or self.index is not None
13579  */
13580     __pyx_v_use_setstate = 1;
13581 
13582     /* "(tree fragment)":7
13583  *     state = (self.A, self.A_time_var_index, self.Q, self.Q_square_root, self.Q_time_var_index, self.dA, self.dQ, self.index, self.svd_each_time)
13584  *     _dict = getattr(self, '__dict__', None)
13585  *     if _dict is not None:             # <<<<<<<<<<<<<<
13586  *         state += (_dict,)
13587  *         use_setstate = True
13588  */
13589     goto __pyx_L3;
13590   }
13591 
13592   /* "(tree fragment)":11
13593  *         use_setstate = True
13594  *     else:
13595  *         use_setstate = self.A is not None or self.Q is not None or self.Q_square_root is not None or self.dA is not None or self.dQ is not None or self.index is not None             # <<<<<<<<<<<<<<
13596  *     if use_setstate:
13597  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, None), state
13598  */
13599   /*else*/ {
13600     __pyx_t_5 = (((PyObject *)__pyx_v_self->A) != Py_None);
13601     __pyx_t_7 = (__pyx_t_5 != 0);
13602     if (!__pyx_t_7) {
13603     } else {
13604       __pyx_t_6 = __pyx_t_7;
13605       goto __pyx_L4_bool_binop_done;
13606     }
13607     __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.Q) != Py_None);
13608     __pyx_t_5 = (__pyx_t_7 != 0);
13609     if (!__pyx_t_5) {
13610     } else {
13611       __pyx_t_6 = __pyx_t_5;
13612       goto __pyx_L4_bool_binop_done;
13613     }
13614     __pyx_t_5 = (__pyx_v_self->__pyx_base.Q_square_root != ((PyObject*)Py_None));
13615     __pyx_t_7 = (__pyx_t_5 != 0);
13616     if (!__pyx_t_7) {
13617     } else {
13618       __pyx_t_6 = __pyx_t_7;
13619       goto __pyx_L4_bool_binop_done;
13620     }
13621     __pyx_t_7 = (((PyObject *)__pyx_v_self->dA) != Py_None);
13622     __pyx_t_5 = (__pyx_t_7 != 0);
13623     if (!__pyx_t_5) {
13624     } else {
13625       __pyx_t_6 = __pyx_t_5;
13626       goto __pyx_L4_bool_binop_done;
13627     }
13628     __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.dQ) != Py_None);
13629     __pyx_t_7 = (__pyx_t_5 != 0);
13630     if (!__pyx_t_7) {
13631     } else {
13632       __pyx_t_6 = __pyx_t_7;
13633       goto __pyx_L4_bool_binop_done;
13634     }
13635     __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.index) != Py_None);
13636     __pyx_t_5 = (__pyx_t_7 != 0);
13637     __pyx_t_6 = __pyx_t_5;
13638     __pyx_L4_bool_binop_done:;
13639     __pyx_v_use_setstate = __pyx_t_6;
13640   }
13641   __pyx_L3:;
13642 
13643   /* "(tree fragment)":12
13644  *     else:
13645  *         use_setstate = self.A is not None or self.Q is not None or self.Q_square_root is not None or self.dA is not None or self.dQ is not None or self.index is not None
13646  *     if use_setstate:             # <<<<<<<<<<<<<<
13647  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, None), state
13648  *     else:
13649  */
13650   __pyx_t_6 = (__pyx_v_use_setstate != 0);
13651   if (__pyx_t_6) {
13652 
13653     /* "(tree fragment)":13
13654  *         use_setstate = self.A is not None or self.Q is not None or self.Q_square_root is not None or self.dA is not None or self.dQ is not None or self.index is not None
13655  *     if use_setstate:
13656  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, None), state             # <<<<<<<<<<<<<<
13657  *     else:
13658  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, state)
13659  */
13660     __Pyx_XDECREF(__pyx_r);
13661     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_Std_Dynamic_Calla); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
13662     __Pyx_GOTREF(__pyx_t_3);
13663     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
13664     __Pyx_GOTREF(__pyx_t_4);
13665     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13666     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13667     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13668     __Pyx_INCREF(__pyx_int_234819414);
13669     __Pyx_GIVEREF(__pyx_int_234819414);
13670     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_234819414);
13671     __Pyx_INCREF(Py_None);
13672     __Pyx_GIVEREF(Py_None);
13673     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
13674     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
13675     __Pyx_GOTREF(__pyx_t_2);
13676     __Pyx_GIVEREF(__pyx_t_3);
13677     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
13678     __Pyx_GIVEREF(__pyx_t_4);
13679     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
13680     __Pyx_INCREF(__pyx_v_state);
13681     __Pyx_GIVEREF(__pyx_v_state);
13682     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
13683     __pyx_t_3 = 0;
13684     __pyx_t_4 = 0;
13685     __pyx_r = __pyx_t_2;
13686     __pyx_t_2 = 0;
13687     goto __pyx_L0;
13688 
13689     /* "(tree fragment)":12
13690  *     else:
13691  *         use_setstate = self.A is not None or self.Q is not None or self.Q_square_root is not None or self.dA is not None or self.dQ is not None or self.index is not None
13692  *     if use_setstate:             # <<<<<<<<<<<<<<
13693  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, None), state
13694  *     else:
13695  */
13696   }
13697 
13698   /* "(tree fragment)":15
13699  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, None), state
13700  *     else:
13701  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, state)             # <<<<<<<<<<<<<<
13702  * def __setstate_cython__(self, __pyx_state):
13703  *     __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(self, __pyx_state)
13704  */
13705   /*else*/ {
13706     __Pyx_XDECREF(__pyx_r);
13707     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Std_Dynamic_Calla); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
13708     __Pyx_GOTREF(__pyx_t_2);
13709     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
13710     __Pyx_GOTREF(__pyx_t_4);
13711     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13712     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13713     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
13714     __Pyx_INCREF(__pyx_int_234819414);
13715     __Pyx_GIVEREF(__pyx_int_234819414);
13716     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_234819414);
13717     __Pyx_INCREF(__pyx_v_state);
13718     __Pyx_GIVEREF(__pyx_v_state);
13719     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
13720     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
13721     __Pyx_GOTREF(__pyx_t_3);
13722     __Pyx_GIVEREF(__pyx_t_2);
13723     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
13724     __Pyx_GIVEREF(__pyx_t_4);
13725     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
13726     __pyx_t_2 = 0;
13727     __pyx_t_4 = 0;
13728     __pyx_r = __pyx_t_3;
13729     __pyx_t_3 = 0;
13730     goto __pyx_L0;
13731   }
13732 
13733   /* "(tree fragment)":1
13734  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
13735  *     cdef tuple state
13736  *     cdef object _dict
13737  */
13738 
13739   /* function exit code */
13740   __pyx_L1_error:;
13741   __Pyx_XDECREF(__pyx_t_1);
13742   __Pyx_XDECREF(__pyx_t_2);
13743   __Pyx_XDECREF(__pyx_t_3);
13744   __Pyx_XDECREF(__pyx_t_4);
13745   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13746   __pyx_r = NULL;
13747   __pyx_L0:;
13748   __Pyx_XDECREF(__pyx_v_state);
13749   __Pyx_XDECREF(__pyx_v__dict);
13750   __Pyx_XGIVEREF(__pyx_r);
13751   __Pyx_RefNannyFinishContext();
13752   return __pyx_r;
13753 }
13754 
13755 /* "(tree fragment)":16
13756  *     else:
13757  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, state)
13758  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
13759  *     __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(self, __pyx_state)
13760  */
13761 
13762 /* Python wrapper */
13763 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_13__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)13764 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13765   PyObject *__pyx_r = 0;
13766   __Pyx_RefNannyDeclarations
13767   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13768   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_12__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13769 
13770   /* function exit code */
13771   __Pyx_RefNannyFinishContext();
13772   return __pyx_r;
13773 }
13774 
__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_12__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)13775 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_12__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13776   PyObject *__pyx_r = NULL;
13777   __Pyx_RefNannyDeclarations
13778   PyObject *__pyx_t_1 = NULL;
13779   int __pyx_lineno = 0;
13780   const char *__pyx_filename = NULL;
13781   int __pyx_clineno = 0;
13782   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13783 
13784   /* "(tree fragment)":17
13785  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, state)
13786  * def __setstate_cython__(self, __pyx_state):
13787  *     __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
13788  */
13789   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
13790   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
13791   __Pyx_GOTREF(__pyx_t_1);
13792   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13793 
13794   /* "(tree fragment)":16
13795  *     else:
13796  *         return __pyx_unpickle_Std_Dynamic_Callables_Cython, (type(self), 0xdff0f56, state)
13797  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
13798  *     __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(self, __pyx_state)
13799  */
13800 
13801   /* function exit code */
13802   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13803   goto __pyx_L0;
13804   __pyx_L1_error:;
13805   __Pyx_XDECREF(__pyx_t_1);
13806   __Pyx_AddTraceback("GPy.models.state_space_cython.Std_Dynamic_Callables_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13807   __pyx_r = NULL;
13808   __pyx_L0:;
13809   __Pyx_XGIVEREF(__pyx_r);
13810   __Pyx_RefNannyFinishContext();
13811   return __pyx_r;
13812 }
13813 
13814 /* "GPy/models/state_space_cython.pyx":399
13815  *             int last_k
13816  *
13817  *         def __init__(self, np.ndarray[DTYPE_t, ndim=3] As, np.ndarray[DTYPE_t, ndim=3] Qs,             # <<<<<<<<<<<<<<
13818  *                      np.ndarray[DTYPE_int_t, ndim=1] reconstruct_indices,
13819  *                      np.ndarray[DTYPE_t, ndim=4] dAs=None,
13820  */
13821 
13822 /* Python wrapper */
13823 static int __pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13824 static char __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__[] = "\n            Constructor. All necessary parameters are passed here and stored \n            in the opject.            \n            \n            Input:\n            -------------------\n                F, L, Qc, P_inf : matrices\n                    Parameters of corresponding continuous state model\n                dt: array\n                    All time steps\n                compute_derivatives: bool\n                    Whether to calculate derivatives\n                    \n                dP_inf, dF, dQc: 3D array\n                    Derivatives if they are required\n            \n            Output:\n            -------------------\n            \n            ";
13825 #if CYTHON_COMPILING_IN_CPYTHON
13826 struct wrapperbase __pyx_wrapperbase_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__;
13827 #endif
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)13828 static int __pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13829   PyArrayObject *__pyx_v_As = 0;
13830   PyArrayObject *__pyx_v_Qs = 0;
13831   PyArrayObject *__pyx_v_reconstruct_indices = 0;
13832   PyArrayObject *__pyx_v_dAs = 0;
13833   PyArrayObject *__pyx_v_dQs = 0;
13834   int __pyx_lineno = 0;
13835   const char *__pyx_filename = NULL;
13836   int __pyx_clineno = 0;
13837   int __pyx_r;
13838   __Pyx_RefNannyDeclarations
13839   __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
13840   {
13841     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_As,&__pyx_n_s_Qs,&__pyx_n_s_reconstruct_indices,&__pyx_n_s_dAs,&__pyx_n_s_dQs,0};
13842     PyObject* values[5] = {0,0,0,0,0};
13843 
13844     /* "GPy/models/state_space_cython.pyx":401
13845  *         def __init__(self, np.ndarray[DTYPE_t, ndim=3] As, np.ndarray[DTYPE_t, ndim=3] Qs,
13846  *                      np.ndarray[DTYPE_int_t, ndim=1] reconstruct_indices,
13847  *                      np.ndarray[DTYPE_t, ndim=4] dAs=None,             # <<<<<<<<<<<<<<
13848  *                      np.ndarray[DTYPE_t, ndim=4] dQs=None):
13849  *             """
13850  */
13851     values[3] = (PyObject *)((PyArrayObject *)Py_None);
13852 
13853     /* "GPy/models/state_space_cython.pyx":402
13854  *                      np.ndarray[DTYPE_int_t, ndim=1] reconstruct_indices,
13855  *                      np.ndarray[DTYPE_t, ndim=4] dAs=None,
13856  *                      np.ndarray[DTYPE_t, ndim=4] dQs=None):             # <<<<<<<<<<<<<<
13857  *             """
13858  *             Constructor. All necessary parameters are passed here and stored
13859  */
13860     values[4] = (PyObject *)((PyArrayObject *)Py_None);
13861     if (unlikely(__pyx_kwds)) {
13862       Py_ssize_t kw_args;
13863       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13864       switch (pos_args) {
13865         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13866         CYTHON_FALLTHROUGH;
13867         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13868         CYTHON_FALLTHROUGH;
13869         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13870         CYTHON_FALLTHROUGH;
13871         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13872         CYTHON_FALLTHROUGH;
13873         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13874         CYTHON_FALLTHROUGH;
13875         case  0: break;
13876         default: goto __pyx_L5_argtuple_error;
13877       }
13878       kw_args = PyDict_Size(__pyx_kwds);
13879       switch (pos_args) {
13880         case  0:
13881         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_As)) != 0)) kw_args--;
13882         else goto __pyx_L5_argtuple_error;
13883         CYTHON_FALLTHROUGH;
13884         case  1:
13885         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Qs)) != 0)) kw_args--;
13886         else {
13887           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 399, __pyx_L3_error)
13888         }
13889         CYTHON_FALLTHROUGH;
13890         case  2:
13891         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reconstruct_indices)) != 0)) kw_args--;
13892         else {
13893           __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 399, __pyx_L3_error)
13894         }
13895         CYTHON_FALLTHROUGH;
13896         case  3:
13897         if (kw_args > 0) {
13898           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dAs);
13899           if (value) { values[3] = value; kw_args--; }
13900         }
13901         CYTHON_FALLTHROUGH;
13902         case  4:
13903         if (kw_args > 0) {
13904           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dQs);
13905           if (value) { values[4] = value; kw_args--; }
13906         }
13907       }
13908       if (unlikely(kw_args > 0)) {
13909         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 399, __pyx_L3_error)
13910       }
13911     } else {
13912       switch (PyTuple_GET_SIZE(__pyx_args)) {
13913         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13914         CYTHON_FALLTHROUGH;
13915         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13916         CYTHON_FALLTHROUGH;
13917         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13918         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13919         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13920         break;
13921         default: goto __pyx_L5_argtuple_error;
13922       }
13923     }
13924     __pyx_v_As = ((PyArrayObject *)values[0]);
13925     __pyx_v_Qs = ((PyArrayObject *)values[1]);
13926     __pyx_v_reconstruct_indices = ((PyArrayObject *)values[2]);
13927     __pyx_v_dAs = ((PyArrayObject *)values[3]);
13928     __pyx_v_dQs = ((PyArrayObject *)values[4]);
13929   }
13930   goto __pyx_L4_argument_unpacking_done;
13931   __pyx_L5_argtuple_error:;
13932   __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 399, __pyx_L3_error)
13933   __pyx_L3_error:;
13934   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13935   __Pyx_RefNannyFinishContext();
13936   return -1;
13937   __pyx_L4_argument_unpacking_done:;
13938   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_As), __pyx_ptype_5numpy_ndarray, 1, "As", 0))) __PYX_ERR(0, 399, __pyx_L1_error)
13939   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_Qs), __pyx_ptype_5numpy_ndarray, 1, "Qs", 0))) __PYX_ERR(0, 399, __pyx_L1_error)
13940   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_reconstruct_indices), __pyx_ptype_5numpy_ndarray, 1, "reconstruct_indices", 0))) __PYX_ERR(0, 400, __pyx_L1_error)
13941   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dAs), __pyx_ptype_5numpy_ndarray, 1, "dAs", 0))) __PYX_ERR(0, 401, __pyx_L1_error)
13942   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dQs), __pyx_ptype_5numpy_ndarray, 1, "dQs", 0))) __PYX_ERR(0, 402, __pyx_L1_error)
13943   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), __pyx_v_As, __pyx_v_Qs, __pyx_v_reconstruct_indices, __pyx_v_dAs, __pyx_v_dQs);
13944 
13945   /* "GPy/models/state_space_cython.pyx":399
13946  *             int last_k
13947  *
13948  *         def __init__(self, np.ndarray[DTYPE_t, ndim=3] As, np.ndarray[DTYPE_t, ndim=3] Qs,             # <<<<<<<<<<<<<<
13949  *                      np.ndarray[DTYPE_int_t, ndim=1] reconstruct_indices,
13950  *                      np.ndarray[DTYPE_t, ndim=4] dAs=None,
13951  */
13952 
13953   /* function exit code */
13954   goto __pyx_L0;
13955   __pyx_L1_error:;
13956   __pyx_r = -1;
13957   __pyx_L0:;
13958   __Pyx_RefNannyFinishContext();
13959   return __pyx_r;
13960 }
13961 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,PyArrayObject * __pyx_v_As,PyArrayObject * __pyx_v_Qs,PyArrayObject * __pyx_v_reconstruct_indices,PyArrayObject * __pyx_v_dAs,PyArrayObject * __pyx_v_dQs)13962 static int __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, PyArrayObject *__pyx_v_As, PyArrayObject *__pyx_v_Qs, PyArrayObject *__pyx_v_reconstruct_indices, PyArrayObject *__pyx_v_dAs, PyArrayObject *__pyx_v_dQs) {
13963   __Pyx_LocalBuf_ND __pyx_pybuffernd_As;
13964   __Pyx_Buffer __pyx_pybuffer_As;
13965   __Pyx_LocalBuf_ND __pyx_pybuffernd_Qs;
13966   __Pyx_Buffer __pyx_pybuffer_Qs;
13967   __Pyx_LocalBuf_ND __pyx_pybuffernd_dAs;
13968   __Pyx_Buffer __pyx_pybuffer_dAs;
13969   __Pyx_LocalBuf_ND __pyx_pybuffernd_dQs;
13970   __Pyx_Buffer __pyx_pybuffer_dQs;
13971   __Pyx_LocalBuf_ND __pyx_pybuffernd_reconstruct_indices;
13972   __Pyx_Buffer __pyx_pybuffer_reconstruct_indices;
13973   int __pyx_r;
13974   __Pyx_RefNannyDeclarations
13975   PyObject *__pyx_t_1 = NULL;
13976   PyObject *__pyx_t_2 = NULL;
13977   PyObject *__pyx_t_3 = NULL;
13978   int __pyx_t_4;
13979   int __pyx_lineno = 0;
13980   const char *__pyx_filename = NULL;
13981   int __pyx_clineno = 0;
13982   __Pyx_RefNannySetupContext("__init__", 0);
13983   __pyx_pybuffer_As.pybuffer.buf = NULL;
13984   __pyx_pybuffer_As.refcount = 0;
13985   __pyx_pybuffernd_As.data = NULL;
13986   __pyx_pybuffernd_As.rcbuffer = &__pyx_pybuffer_As;
13987   __pyx_pybuffer_Qs.pybuffer.buf = NULL;
13988   __pyx_pybuffer_Qs.refcount = 0;
13989   __pyx_pybuffernd_Qs.data = NULL;
13990   __pyx_pybuffernd_Qs.rcbuffer = &__pyx_pybuffer_Qs;
13991   __pyx_pybuffer_reconstruct_indices.pybuffer.buf = NULL;
13992   __pyx_pybuffer_reconstruct_indices.refcount = 0;
13993   __pyx_pybuffernd_reconstruct_indices.data = NULL;
13994   __pyx_pybuffernd_reconstruct_indices.rcbuffer = &__pyx_pybuffer_reconstruct_indices;
13995   __pyx_pybuffer_dAs.pybuffer.buf = NULL;
13996   __pyx_pybuffer_dAs.refcount = 0;
13997   __pyx_pybuffernd_dAs.data = NULL;
13998   __pyx_pybuffernd_dAs.rcbuffer = &__pyx_pybuffer_dAs;
13999   __pyx_pybuffer_dQs.pybuffer.buf = NULL;
14000   __pyx_pybuffer_dQs.refcount = 0;
14001   __pyx_pybuffernd_dQs.data = NULL;
14002   __pyx_pybuffernd_dQs.rcbuffer = &__pyx_pybuffer_dQs;
14003   {
14004     __Pyx_BufFmt_StackElem __pyx_stack[1];
14005     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_As.rcbuffer->pybuffer, (PyObject*)__pyx_v_As, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
14006   }
14007   __pyx_pybuffernd_As.diminfo[0].strides = __pyx_pybuffernd_As.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_As.diminfo[0].shape = __pyx_pybuffernd_As.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_As.diminfo[1].strides = __pyx_pybuffernd_As.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_As.diminfo[1].shape = __pyx_pybuffernd_As.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_As.diminfo[2].strides = __pyx_pybuffernd_As.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_As.diminfo[2].shape = __pyx_pybuffernd_As.rcbuffer->pybuffer.shape[2];
14008   {
14009     __Pyx_BufFmt_StackElem __pyx_stack[1];
14010     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Qs.rcbuffer->pybuffer, (PyObject*)__pyx_v_Qs, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
14011   }
14012   __pyx_pybuffernd_Qs.diminfo[0].strides = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Qs.diminfo[0].shape = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Qs.diminfo[1].strides = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Qs.diminfo[1].shape = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_Qs.diminfo[2].strides = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_Qs.diminfo[2].shape = __pyx_pybuffernd_Qs.rcbuffer->pybuffer.shape[2];
14013   {
14014     __Pyx_BufFmt_StackElem __pyx_stack[1];
14015     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_reconstruct_indices.rcbuffer->pybuffer, (PyObject*)__pyx_v_reconstruct_indices, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_int_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
14016   }
14017   __pyx_pybuffernd_reconstruct_indices.diminfo[0].strides = __pyx_pybuffernd_reconstruct_indices.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_reconstruct_indices.diminfo[0].shape = __pyx_pybuffernd_reconstruct_indices.rcbuffer->pybuffer.shape[0];
14018   {
14019     __Pyx_BufFmt_StackElem __pyx_stack[1];
14020     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dAs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dAs, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
14021   }
14022   __pyx_pybuffernd_dAs.diminfo[0].strides = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dAs.diminfo[0].shape = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dAs.diminfo[1].strides = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dAs.diminfo[1].shape = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dAs.diminfo[2].strides = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dAs.diminfo[2].shape = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_dAs.diminfo[3].strides = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_dAs.diminfo[3].shape = __pyx_pybuffernd_dAs.rcbuffer->pybuffer.shape[3];
14023   {
14024     __Pyx_BufFmt_StackElem __pyx_stack[1];
14025     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQs.rcbuffer->pybuffer, (PyObject*)__pyx_v_dQs, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) __PYX_ERR(0, 399, __pyx_L1_error)
14026   }
14027   __pyx_pybuffernd_dQs.diminfo[0].strides = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dQs.diminfo[0].shape = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dQs.diminfo[1].strides = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dQs.diminfo[1].shape = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dQs.diminfo[2].strides = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dQs.diminfo[2].shape = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_dQs.diminfo[3].strides = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_dQs.diminfo[3].shape = __pyx_pybuffernd_dQs.rcbuffer->pybuffer.shape[3];
14028 
14029   /* "GPy/models/state_space_cython.pyx":424
14030  *             """
14031  *
14032  *             self.As = As             # <<<<<<<<<<<<<<
14033  *             self.Qs = Qs
14034  *             self.dAs = dAs
14035  */
14036   __Pyx_INCREF(((PyObject *)__pyx_v_As));
14037   __Pyx_GIVEREF(((PyObject *)__pyx_v_As));
14038   __Pyx_GOTREF(__pyx_v_self->As);
14039   __Pyx_DECREF(((PyObject *)__pyx_v_self->As));
14040   __pyx_v_self->As = ((PyArrayObject *)__pyx_v_As);
14041 
14042   /* "GPy/models/state_space_cython.pyx":425
14043  *
14044  *             self.As = As
14045  *             self.Qs = Qs             # <<<<<<<<<<<<<<
14046  *             self.dAs = dAs
14047  *             self.dQs = dQs
14048  */
14049   __Pyx_INCREF(((PyObject *)__pyx_v_Qs));
14050   __Pyx_GIVEREF(((PyObject *)__pyx_v_Qs));
14051   __Pyx_GOTREF(__pyx_v_self->Qs);
14052   __Pyx_DECREF(((PyObject *)__pyx_v_self->Qs));
14053   __pyx_v_self->Qs = ((PyArrayObject *)__pyx_v_Qs);
14054 
14055   /* "GPy/models/state_space_cython.pyx":426
14056  *             self.As = As
14057  *             self.Qs = Qs
14058  *             self.dAs = dAs             # <<<<<<<<<<<<<<
14059  *             self.dQs = dQs
14060  *             self.reconstruct_indices = reconstruct_indices
14061  */
14062   __Pyx_INCREF(((PyObject *)__pyx_v_dAs));
14063   __Pyx_GIVEREF(((PyObject *)__pyx_v_dAs));
14064   __Pyx_GOTREF(__pyx_v_self->dAs);
14065   __Pyx_DECREF(((PyObject *)__pyx_v_self->dAs));
14066   __pyx_v_self->dAs = ((PyArrayObject *)__pyx_v_dAs);
14067 
14068   /* "GPy/models/state_space_cython.pyx":427
14069  *             self.Qs = Qs
14070  *             self.dAs = dAs
14071  *             self.dQs = dQs             # <<<<<<<<<<<<<<
14072  *             self.reconstruct_indices = reconstruct_indices
14073  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14074  */
14075   __Pyx_INCREF(((PyObject *)__pyx_v_dQs));
14076   __Pyx_GIVEREF(((PyObject *)__pyx_v_dQs));
14077   __Pyx_GOTREF(__pyx_v_self->dQs);
14078   __Pyx_DECREF(((PyObject *)__pyx_v_self->dQs));
14079   __pyx_v_self->dQs = ((PyArrayObject *)__pyx_v_dQs);
14080 
14081   /* "GPy/models/state_space_cython.pyx":428
14082  *             self.dAs = dAs
14083  *             self.dQs = dQs
14084  *             self.reconstruct_indices = reconstruct_indices             # <<<<<<<<<<<<<<
14085  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14086  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14087  */
14088   __Pyx_INCREF(((PyObject *)__pyx_v_reconstruct_indices));
14089   __Pyx_GIVEREF(((PyObject *)__pyx_v_reconstruct_indices));
14090   __Pyx_GOTREF(__pyx_v_self->reconstruct_indices);
14091   __Pyx_DECREF(((PyObject *)__pyx_v_self->reconstruct_indices));
14092   __pyx_v_self->reconstruct_indices = ((PyArrayObject *)__pyx_v_reconstruct_indices);
14093 
14094   /* "GPy/models/state_space_cython.pyx":429
14095  *             self.dQs = dQs
14096  *             self.reconstruct_indices = reconstruct_indices
14097  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\             # <<<<<<<<<<<<<<
14098  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14099  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14100  */
14101   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->As), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
14102   __Pyx_GOTREF(__pyx_t_1);
14103   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->Qs), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error)
14104   __Pyx_GOTREF(__pyx_t_2);
14105   __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
14106   __Pyx_GOTREF(__pyx_t_3);
14107   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14108   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14109 
14110   /* "GPy/models/state_space_cython.pyx":430
14111  *             self.reconstruct_indices = reconstruct_indices
14112  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14113  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\             # <<<<<<<<<<<<<<
14114  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14115  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)
14116  */
14117   __pyx_t_4 = (((PyObject *)__pyx_v_self->dAs) != Py_None);
14118   if ((__pyx_t_4 != 0)) {
14119     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dAs), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
14120     __Pyx_GOTREF(__pyx_t_1);
14121     __pyx_t_2 = __pyx_t_1;
14122     __pyx_t_1 = 0;
14123   } else {
14124     __Pyx_INCREF(__pyx_int_0);
14125     __pyx_t_2 = __pyx_int_0;
14126   }
14127 
14128   /* "GPy/models/state_space_cython.pyx":429
14129  *             self.dQs = dQs
14130  *             self.reconstruct_indices = reconstruct_indices
14131  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\             # <<<<<<<<<<<<<<
14132  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14133  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14134  */
14135   __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
14136   __Pyx_GOTREF(__pyx_t_1);
14137   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14138   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14139 
14140   /* "GPy/models/state_space_cython.pyx":431
14141  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14142  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14143  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\             # <<<<<<<<<<<<<<
14144  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)
14145  *
14146  */
14147   __pyx_t_4 = (((PyObject *)__pyx_v_self->dQs) != Py_None);
14148   if ((__pyx_t_4 != 0)) {
14149     __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dQs), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
14150     __Pyx_GOTREF(__pyx_t_3);
14151     __pyx_t_2 = __pyx_t_3;
14152     __pyx_t_3 = 0;
14153   } else {
14154     __Pyx_INCREF(__pyx_int_0);
14155     __pyx_t_2 = __pyx_int_0;
14156   }
14157 
14158   /* "GPy/models/state_space_cython.pyx":430
14159  *             self.reconstruct_indices = reconstruct_indices
14160  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14161  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\             # <<<<<<<<<<<<<<
14162  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14163  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)
14164  */
14165   __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
14166   __Pyx_GOTREF(__pyx_t_3);
14167   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14168   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14169 
14170   /* "GPy/models/state_space_cython.pyx":432
14171  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14172  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14173  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)             # <<<<<<<<<<<<<<
14174  *
14175  *             self.Q_svd_dict = {}
14176  */
14177   __pyx_t_4 = (((PyObject *)__pyx_v_self->reconstruct_indices) != Py_None);
14178   if ((__pyx_t_4 != 0)) {
14179     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_n_s_nbytes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
14180     __Pyx_GOTREF(__pyx_t_1);
14181     __pyx_t_2 = __pyx_t_1;
14182     __pyx_t_1 = 0;
14183   } else {
14184     __Pyx_INCREF(__pyx_int_0);
14185     __pyx_t_2 = __pyx_int_0;
14186   }
14187 
14188   /* "GPy/models/state_space_cython.pyx":431
14189  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\
14190  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14191  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\             # <<<<<<<<<<<<<<
14192  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)
14193  *
14194  */
14195   __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
14196   __Pyx_GOTREF(__pyx_t_1);
14197   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14198   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14199 
14200   /* "GPy/models/state_space_cython.pyx":429
14201  *             self.dQs = dQs
14202  *             self.reconstruct_indices = reconstruct_indices
14203  *             self.total_size_of_data = self.As.nbytes + self.Qs.nbytes +\             # <<<<<<<<<<<<<<
14204  *                             (self.dAs.nbytes if (self.dAs is not None) else 0) +\
14205  *                             (self.dQs.nbytes if (self.dQs is not None) else 0) +\
14206  */
14207   if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_total_size_of_data, __pyx_t_1) < 0) __PYX_ERR(0, 429, __pyx_L1_error)
14208   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14209 
14210   /* "GPy/models/state_space_cython.pyx":434
14211  *                             (self.reconstruct_indices.nbytes if (self.reconstruct_indices is not None) else 0)
14212  *
14213  *             self.Q_svd_dict = {}             # <<<<<<<<<<<<<<
14214  *             self.Q_square_root_dict = {}
14215  *             self.Q_inverse_dict = {}
14216  */
14217   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error)
14218   __Pyx_GOTREF(__pyx_t_1);
14219   __Pyx_GIVEREF(__pyx_t_1);
14220   __Pyx_GOTREF(__pyx_v_self->Q_svd_dict);
14221   __Pyx_DECREF(__pyx_v_self->Q_svd_dict);
14222   __pyx_v_self->Q_svd_dict = ((PyObject*)__pyx_t_1);
14223   __pyx_t_1 = 0;
14224 
14225   /* "GPy/models/state_space_cython.pyx":435
14226  *
14227  *             self.Q_svd_dict = {}
14228  *             self.Q_square_root_dict = {}             # <<<<<<<<<<<<<<
14229  *             self.Q_inverse_dict = {}
14230  *             self.last_k = 0
14231  */
14232   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
14233   __Pyx_GOTREF(__pyx_t_1);
14234   if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_square_root_dict, __pyx_t_1) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
14235   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14236 
14237   /* "GPy/models/state_space_cython.pyx":436
14238  *             self.Q_svd_dict = {}
14239  *             self.Q_square_root_dict = {}
14240  *             self.Q_inverse_dict = {}             # <<<<<<<<<<<<<<
14241  *             self.last_k = 0
14242  *              # !!!Print statistics! Which object is created
14243  */
14244   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
14245   __Pyx_GOTREF(__pyx_t_1);
14246   if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_inverse_dict, __pyx_t_1) < 0) __PYX_ERR(0, 436, __pyx_L1_error)
14247   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14248 
14249   /* "GPy/models/state_space_cython.pyx":437
14250  *             self.Q_square_root_dict = {}
14251  *             self.Q_inverse_dict = {}
14252  *             self.last_k = 0             # <<<<<<<<<<<<<<
14253  *              # !!!Print statistics! Which object is created
14254  *             # !!!Print statistics! Print sizes of matrices
14255  */
14256   __pyx_v_self->last_k = 0;
14257 
14258   /* "GPy/models/state_space_cython.pyx":399
14259  *             int last_k
14260  *
14261  *         def __init__(self, np.ndarray[DTYPE_t, ndim=3] As, np.ndarray[DTYPE_t, ndim=3] Qs,             # <<<<<<<<<<<<<<
14262  *                      np.ndarray[DTYPE_int_t, ndim=1] reconstruct_indices,
14263  *                      np.ndarray[DTYPE_t, ndim=4] dAs=None,
14264  */
14265 
14266   /* function exit code */
14267   __pyx_r = 0;
14268   goto __pyx_L0;
14269   __pyx_L1_error:;
14270   __Pyx_XDECREF(__pyx_t_1);
14271   __Pyx_XDECREF(__pyx_t_2);
14272   __Pyx_XDECREF(__pyx_t_3);
14273   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14274     __Pyx_PyThreadState_declare
14275     __Pyx_PyThreadState_assign
14276     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14277     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_As.rcbuffer->pybuffer);
14278     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qs.rcbuffer->pybuffer);
14279     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dAs.rcbuffer->pybuffer);
14280     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQs.rcbuffer->pybuffer);
14281     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_reconstruct_indices.rcbuffer->pybuffer);
14282   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14283   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14284   __pyx_r = -1;
14285   goto __pyx_L2;
14286   __pyx_L0:;
14287   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_As.rcbuffer->pybuffer);
14288   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Qs.rcbuffer->pybuffer);
14289   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dAs.rcbuffer->pybuffer);
14290   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQs.rcbuffer->pybuffer);
14291   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_reconstruct_indices.rcbuffer->pybuffer);
14292   __pyx_L2:;
14293   __Pyx_RefNannyFinishContext();
14294   return __pyx_r;
14295 }
14296 
14297 /* "GPy/models/state_space_cython.pyx":440
14298  *              # !!!Print statistics! Which object is created
14299  *             # !!!Print statistics! Print sizes of matrices
14300  *         cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
14301  *             """
14302  *             Dynamic model
14303  */
14304 
14305 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,CYTHON_UNUSED int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_A,int __pyx_skip_dispatch)14306 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_f_a(CYTHON_UNUSED struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, CYTHON_UNUSED int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A, int __pyx_skip_dispatch) {
14307   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
14308   __Pyx_Buffer __pyx_pybuffer_A;
14309   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
14310   __Pyx_Buffer __pyx_pybuffer_m;
14311   PyObject *__pyx_r = NULL;
14312   __Pyx_RefNannyDeclarations
14313   PyObject *__pyx_t_1 = NULL;
14314   PyObject *__pyx_t_2 = NULL;
14315   PyObject *__pyx_t_3 = NULL;
14316   PyObject *__pyx_t_4 = NULL;
14317   PyObject *__pyx_t_5 = NULL;
14318   int __pyx_t_6;
14319   PyObject *__pyx_t_7 = NULL;
14320   int __pyx_lineno = 0;
14321   const char *__pyx_filename = NULL;
14322   int __pyx_clineno = 0;
14323   __Pyx_RefNannySetupContext("f_a", 0);
14324   __pyx_pybuffer_m.pybuffer.buf = NULL;
14325   __pyx_pybuffer_m.refcount = 0;
14326   __pyx_pybuffernd_m.data = NULL;
14327   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
14328   __pyx_pybuffer_A.pybuffer.buf = NULL;
14329   __pyx_pybuffer_A.refcount = 0;
14330   __pyx_pybuffernd_A.data = NULL;
14331   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
14332   {
14333     __Pyx_BufFmt_StackElem __pyx_stack[1];
14334     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error)
14335   }
14336   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
14337   {
14338     __Pyx_BufFmt_StackElem __pyx_stack[1];
14339     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error)
14340   }
14341   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
14342   /* Check if called by wrapper */
14343   if (unlikely(__pyx_skip_dispatch)) ;
14344   /* Check if overridden in Python */
14345   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
14346     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14347     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14348     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
14349       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14350       #endif
14351       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_f_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
14352       __Pyx_GOTREF(__pyx_t_1);
14353       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a)) {
14354         __Pyx_XDECREF(__pyx_r);
14355         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error)
14356         __Pyx_GOTREF(__pyx_t_3);
14357         __Pyx_INCREF(__pyx_t_1);
14358         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
14359         __pyx_t_6 = 0;
14360         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14361           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
14362           if (likely(__pyx_t_5)) {
14363             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
14364             __Pyx_INCREF(__pyx_t_5);
14365             __Pyx_INCREF(function);
14366             __Pyx_DECREF_SET(__pyx_t_4, function);
14367             __pyx_t_6 = 1;
14368           }
14369         }
14370         #if CYTHON_FAST_PYCALL
14371         if (PyFunction_Check(__pyx_t_4)) {
14372           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
14373           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
14374           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14375           __Pyx_GOTREF(__pyx_t_2);
14376           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14377         } else
14378         #endif
14379         #if CYTHON_FAST_PYCCALL
14380         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
14381           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_A)};
14382           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
14383           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14384           __Pyx_GOTREF(__pyx_t_2);
14385           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14386         } else
14387         #endif
14388         {
14389           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error)
14390           __Pyx_GOTREF(__pyx_t_7);
14391           if (__pyx_t_5) {
14392             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
14393           }
14394           __Pyx_GIVEREF(__pyx_t_3);
14395           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
14396           __Pyx_INCREF(((PyObject *)__pyx_v_m));
14397           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
14398           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
14399           __Pyx_INCREF(((PyObject *)__pyx_v_A));
14400           __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
14401           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_A));
14402           __pyx_t_3 = 0;
14403           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error)
14404           __Pyx_GOTREF(__pyx_t_2);
14405           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14406         }
14407         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14408         __pyx_r = __pyx_t_2;
14409         __pyx_t_2 = 0;
14410         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14411         goto __pyx_L0;
14412       }
14413       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14414       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14415       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
14416       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
14417         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14418       }
14419       #endif
14420       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14421       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14422     }
14423     #endif
14424   }
14425 
14426   /* "GPy/models/state_space_cython.pyx":444
14427  *             Dynamic model
14428  *             """
14429  *             return np.dot(A, m) # default dynamic model             # <<<<<<<<<<<<<<
14430  *
14431  *         cpdef reset(self, bint compute_derivatives=False):
14432  */
14433   __Pyx_XDECREF(__pyx_r);
14434   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error)
14435   __Pyx_GOTREF(__pyx_t_2);
14436   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error)
14437   __Pyx_GOTREF(__pyx_t_4);
14438   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
14439   __pyx_t_2 = NULL;
14440   __pyx_t_6 = 0;
14441   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14442     __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
14443     if (likely(__pyx_t_2)) {
14444       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
14445       __Pyx_INCREF(__pyx_t_2);
14446       __Pyx_INCREF(function);
14447       __Pyx_DECREF_SET(__pyx_t_4, function);
14448       __pyx_t_6 = 1;
14449     }
14450   }
14451   #if CYTHON_FAST_PYCALL
14452   if (PyFunction_Check(__pyx_t_4)) {
14453     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_m)};
14454     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
14455     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14456     __Pyx_GOTREF(__pyx_t_1);
14457   } else
14458   #endif
14459   #if CYTHON_FAST_PYCCALL
14460   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
14461     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_m)};
14462     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
14463     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
14464     __Pyx_GOTREF(__pyx_t_1);
14465   } else
14466   #endif
14467   {
14468     __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error)
14469     __Pyx_GOTREF(__pyx_t_7);
14470     if (__pyx_t_2) {
14471       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
14472     }
14473     __Pyx_INCREF(((PyObject *)__pyx_v_A));
14474     __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
14475     PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_A));
14476     __Pyx_INCREF(((PyObject *)__pyx_v_m));
14477     __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
14478     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
14479     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error)
14480     __Pyx_GOTREF(__pyx_t_1);
14481     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14482   }
14483   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14484   __pyx_r = __pyx_t_1;
14485   __pyx_t_1 = 0;
14486   goto __pyx_L0;
14487 
14488   /* "GPy/models/state_space_cython.pyx":440
14489  *              # !!!Print statistics! Which object is created
14490  *             # !!!Print statistics! Print sizes of matrices
14491  *         cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):             # <<<<<<<<<<<<<<
14492  *             """
14493  *             Dynamic model
14494  */
14495 
14496   /* function exit code */
14497   __pyx_L1_error:;
14498   __Pyx_XDECREF(__pyx_t_1);
14499   __Pyx_XDECREF(__pyx_t_2);
14500   __Pyx_XDECREF(__pyx_t_3);
14501   __Pyx_XDECREF(__pyx_t_4);
14502   __Pyx_XDECREF(__pyx_t_5);
14503   __Pyx_XDECREF(__pyx_t_7);
14504   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14505     __Pyx_PyThreadState_declare
14506     __Pyx_PyThreadState_assign
14507     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14508     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
14509     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
14510   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14511   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
14512   __pyx_r = 0;
14513   goto __pyx_L2;
14514   __pyx_L0:;
14515   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
14516   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
14517   __pyx_L2:;
14518   __Pyx_XGIVEREF(__pyx_r);
14519   __Pyx_RefNannyFinishContext();
14520   return __pyx_r;
14521 }
14522 
14523 /* Python wrapper */
14524 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14525 static char __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a[] = "\n            Dynamic model\n            ";
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14526 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14527   int __pyx_v_k;
14528   PyArrayObject *__pyx_v_m = 0;
14529   PyArrayObject *__pyx_v_A = 0;
14530   int __pyx_lineno = 0;
14531   const char *__pyx_filename = NULL;
14532   int __pyx_clineno = 0;
14533   PyObject *__pyx_r = 0;
14534   __Pyx_RefNannyDeclarations
14535   __Pyx_RefNannySetupContext("f_a (wrapper)", 0);
14536   {
14537     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_A,0};
14538     PyObject* values[3] = {0,0,0};
14539     if (unlikely(__pyx_kwds)) {
14540       Py_ssize_t kw_args;
14541       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14542       switch (pos_args) {
14543         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14544         CYTHON_FALLTHROUGH;
14545         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14546         CYTHON_FALLTHROUGH;
14547         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14548         CYTHON_FALLTHROUGH;
14549         case  0: break;
14550         default: goto __pyx_L5_argtuple_error;
14551       }
14552       kw_args = PyDict_Size(__pyx_kwds);
14553       switch (pos_args) {
14554         case  0:
14555         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
14556         else goto __pyx_L5_argtuple_error;
14557         CYTHON_FALLTHROUGH;
14558         case  1:
14559         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
14560         else {
14561           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 1); __PYX_ERR(0, 440, __pyx_L3_error)
14562         }
14563         CYTHON_FALLTHROUGH;
14564         case  2:
14565         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
14566         else {
14567           __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, 2); __PYX_ERR(0, 440, __pyx_L3_error)
14568         }
14569       }
14570       if (unlikely(kw_args > 0)) {
14571         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f_a") < 0)) __PYX_ERR(0, 440, __pyx_L3_error)
14572       }
14573     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14574       goto __pyx_L5_argtuple_error;
14575     } else {
14576       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14577       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14578       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14579     }
14580     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L3_error)
14581     __pyx_v_m = ((PyArrayObject *)values[1]);
14582     __pyx_v_A = ((PyArrayObject *)values[2]);
14583   }
14584   goto __pyx_L4_argument_unpacking_done;
14585   __pyx_L5_argtuple_error:;
14586   __Pyx_RaiseArgtupleInvalid("f_a", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 440, __pyx_L3_error)
14587   __pyx_L3_error:;
14588   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
14589   __Pyx_RefNannyFinishContext();
14590   return NULL;
14591   __pyx_L4_argument_unpacking_done:;
14592   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 440, __pyx_L1_error)
14593   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_A), __pyx_ptype_5numpy_ndarray, 1, "A", 0))) __PYX_ERR(0, 440, __pyx_L1_error)
14594   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_A);
14595 
14596   /* function exit code */
14597   goto __pyx_L0;
14598   __pyx_L1_error:;
14599   __pyx_r = NULL;
14600   __pyx_L0:;
14601   __Pyx_RefNannyFinishContext();
14602   return __pyx_r;
14603 }
14604 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_A)14605 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_A) {
14606   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
14607   __Pyx_Buffer __pyx_pybuffer_A;
14608   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
14609   __Pyx_Buffer __pyx_pybuffer_m;
14610   PyObject *__pyx_r = NULL;
14611   __Pyx_RefNannyDeclarations
14612   PyObject *__pyx_t_1 = NULL;
14613   int __pyx_lineno = 0;
14614   const char *__pyx_filename = NULL;
14615   int __pyx_clineno = 0;
14616   __Pyx_RefNannySetupContext("f_a", 0);
14617   __pyx_pybuffer_m.pybuffer.buf = NULL;
14618   __pyx_pybuffer_m.refcount = 0;
14619   __pyx_pybuffernd_m.data = NULL;
14620   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
14621   __pyx_pybuffer_A.pybuffer.buf = NULL;
14622   __pyx_pybuffer_A.refcount = 0;
14623   __pyx_pybuffernd_A.data = NULL;
14624   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
14625   {
14626     __Pyx_BufFmt_StackElem __pyx_stack[1];
14627     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error)
14628   }
14629   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
14630   {
14631     __Pyx_BufFmt_StackElem __pyx_stack[1];
14632     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_v_A, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 440, __pyx_L1_error)
14633   }
14634   __pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
14635   __Pyx_XDECREF(__pyx_r);
14636   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_f_a(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m), ((PyArrayObject *)__pyx_v_A), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error)
14637   __Pyx_GOTREF(__pyx_t_1);
14638   __pyx_r = __pyx_t_1;
14639   __pyx_t_1 = 0;
14640   goto __pyx_L0;
14641 
14642   /* function exit code */
14643   __pyx_L1_error:;
14644   __Pyx_XDECREF(__pyx_t_1);
14645   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14646     __Pyx_PyThreadState_declare
14647     __Pyx_PyThreadState_assign
14648     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14649     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
14650     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
14651   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14652   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.f_a", __pyx_clineno, __pyx_lineno, __pyx_filename);
14653   __pyx_r = NULL;
14654   goto __pyx_L2;
14655   __pyx_L0:;
14656   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
14657   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
14658   __pyx_L2:;
14659   __Pyx_XGIVEREF(__pyx_r);
14660   __Pyx_RefNannyFinishContext();
14661   return __pyx_r;
14662 }
14663 
14664 /* "GPy/models/state_space_cython.pyx":446
14665  *             return np.dot(A, m) # default dynamic model
14666  *
14667  *         cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
14668  *             """
14669  *             For reusing this object e.g. in smoother computation. It makes sence
14670  */
14671 
14672 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_skip_dispatch,struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset * __pyx_optional_args)14673 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset *__pyx_optional_args) {
14674   int __pyx_v_compute_derivatives = ((int)0);
14675   PyObject *__pyx_r = NULL;
14676   __Pyx_RefNannyDeclarations
14677   PyObject *__pyx_t_1 = NULL;
14678   PyObject *__pyx_t_2 = NULL;
14679   PyObject *__pyx_t_3 = NULL;
14680   PyObject *__pyx_t_4 = NULL;
14681   PyObject *__pyx_t_5 = NULL;
14682   int __pyx_lineno = 0;
14683   const char *__pyx_filename = NULL;
14684   int __pyx_clineno = 0;
14685   __Pyx_RefNannySetupContext("reset", 0);
14686   if (__pyx_optional_args) {
14687     if (__pyx_optional_args->__pyx_n > 0) {
14688       __pyx_v_compute_derivatives = __pyx_optional_args->compute_derivatives;
14689     }
14690   }
14691   /* Check if called by wrapper */
14692   if (unlikely(__pyx_skip_dispatch)) ;
14693   /* Check if overridden in Python */
14694   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
14695     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14696     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14697     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
14698       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14699       #endif
14700       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
14701       __Pyx_GOTREF(__pyx_t_1);
14702       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset)) {
14703         __Pyx_XDECREF(__pyx_r);
14704         __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_compute_derivatives); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
14705         __Pyx_GOTREF(__pyx_t_3);
14706         __Pyx_INCREF(__pyx_t_1);
14707         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
14708         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14709           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
14710           if (likely(__pyx_t_5)) {
14711             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
14712             __Pyx_INCREF(__pyx_t_5);
14713             __Pyx_INCREF(function);
14714             __Pyx_DECREF_SET(__pyx_t_4, function);
14715           }
14716         }
14717         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
14718         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14719         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14720         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
14721         __Pyx_GOTREF(__pyx_t_2);
14722         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14723         __pyx_r = __pyx_t_2;
14724         __pyx_t_2 = 0;
14725         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14726         goto __pyx_L0;
14727       }
14728       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14729       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14730       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
14731       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
14732         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14733       }
14734       #endif
14735       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14736       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14737     }
14738     #endif
14739   }
14740 
14741   /* "GPy/models/state_space_cython.pyx":452
14742  *             time steps.
14743  *             """
14744  *             return self             # <<<<<<<<<<<<<<
14745  *
14746  *         cpdef Ak(self,int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P):
14747  */
14748   __Pyx_XDECREF(__pyx_r);
14749   __Pyx_INCREF(((PyObject *)__pyx_v_self));
14750   __pyx_r = ((PyObject *)__pyx_v_self);
14751   goto __pyx_L0;
14752 
14753   /* "GPy/models/state_space_cython.pyx":446
14754  *             return np.dot(A, m) # default dynamic model
14755  *
14756  *         cpdef reset(self, bint compute_derivatives=False):             # <<<<<<<<<<<<<<
14757  *             """
14758  *             For reusing this object e.g. in smoother computation. It makes sence
14759  */
14760 
14761   /* function exit code */
14762   __pyx_L1_error:;
14763   __Pyx_XDECREF(__pyx_t_1);
14764   __Pyx_XDECREF(__pyx_t_2);
14765   __Pyx_XDECREF(__pyx_t_3);
14766   __Pyx_XDECREF(__pyx_t_4);
14767   __Pyx_XDECREF(__pyx_t_5);
14768   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
14769   __pyx_r = 0;
14770   __pyx_L0:;
14771   __Pyx_XGIVEREF(__pyx_r);
14772   __Pyx_RefNannyFinishContext();
14773   return __pyx_r;
14774 }
14775 
14776 /* Python wrapper */
14777 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14778 static char __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset[] = "\n            For reusing this object e.g. in smoother computation. It makes sence\n            because necessary matrices have been already computed for all\n            time steps.\n            ";
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)14779 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14780   int __pyx_v_compute_derivatives;
14781   int __pyx_lineno = 0;
14782   const char *__pyx_filename = NULL;
14783   int __pyx_clineno = 0;
14784   PyObject *__pyx_r = 0;
14785   __Pyx_RefNannyDeclarations
14786   __Pyx_RefNannySetupContext("reset (wrapper)", 0);
14787   {
14788     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_compute_derivatives,0};
14789     PyObject* values[1] = {0};
14790     if (unlikely(__pyx_kwds)) {
14791       Py_ssize_t kw_args;
14792       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14793       switch (pos_args) {
14794         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14795         CYTHON_FALLTHROUGH;
14796         case  0: break;
14797         default: goto __pyx_L5_argtuple_error;
14798       }
14799       kw_args = PyDict_Size(__pyx_kwds);
14800       switch (pos_args) {
14801         case  0:
14802         if (kw_args > 0) {
14803           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compute_derivatives);
14804           if (value) { values[0] = value; kw_args--; }
14805         }
14806       }
14807       if (unlikely(kw_args > 0)) {
14808         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset") < 0)) __PYX_ERR(0, 446, __pyx_L3_error)
14809       }
14810     } else {
14811       switch (PyTuple_GET_SIZE(__pyx_args)) {
14812         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14813         CYTHON_FALLTHROUGH;
14814         case  0: break;
14815         default: goto __pyx_L5_argtuple_error;
14816       }
14817     }
14818     if (values[0]) {
14819       __pyx_v_compute_derivatives = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_compute_derivatives == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error)
14820     } else {
14821       __pyx_v_compute_derivatives = ((int)0);
14822     }
14823   }
14824   goto __pyx_L4_argument_unpacking_done;
14825   __pyx_L5_argtuple_error:;
14826   __Pyx_RaiseArgtupleInvalid("reset", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 446, __pyx_L3_error)
14827   __pyx_L3_error:;
14828   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
14829   __Pyx_RefNannyFinishContext();
14830   return NULL;
14831   __pyx_L4_argument_unpacking_done:;
14832   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), __pyx_v_compute_derivatives);
14833 
14834   /* function exit code */
14835   __Pyx_RefNannyFinishContext();
14836   return __pyx_r;
14837 }
14838 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_compute_derivatives)14839 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_compute_derivatives) {
14840   PyObject *__pyx_r = NULL;
14841   __Pyx_RefNannyDeclarations
14842   PyObject *__pyx_t_1 = NULL;
14843   struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset __pyx_t_2;
14844   int __pyx_lineno = 0;
14845   const char *__pyx_filename = NULL;
14846   int __pyx_clineno = 0;
14847   __Pyx_RefNannySetupContext("reset", 0);
14848   __Pyx_XDECREF(__pyx_r);
14849   __pyx_t_2.__pyx_n = 1;
14850   __pyx_t_2.compute_derivatives = __pyx_v_compute_derivatives;
14851   __pyx_t_1 = __pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython->__pyx_base.__pyx_base.reset(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_self), 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 446, __pyx_L1_error)
14852   __Pyx_GOTREF(__pyx_t_1);
14853   __pyx_r = __pyx_t_1;
14854   __pyx_t_1 = 0;
14855   goto __pyx_L0;
14856 
14857   /* function exit code */
14858   __pyx_L1_error:;
14859   __Pyx_XDECREF(__pyx_t_1);
14860   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
14861   __pyx_r = NULL;
14862   __pyx_L0:;
14863   __Pyx_XGIVEREF(__pyx_r);
14864   __Pyx_RefNannyFinishContext();
14865   return __pyx_r;
14866 }
14867 
14868 /* "GPy/models/state_space_cython.pyx":454
14869  *             return self
14870  *
14871  *         cpdef Ak(self,int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P):             # <<<<<<<<<<<<<<
14872  *             self.last_k = k
14873  *             return self.As[:,:, <int>self.reconstruct_indices[k]]
14874  */
14875 
14876 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,CYTHON_UNUSED PyArrayObject * __pyx_v_m,CYTHON_UNUSED PyArrayObject * __pyx_v_P,int __pyx_skip_dispatch)14877 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, CYTHON_UNUSED PyArrayObject *__pyx_v_m, CYTHON_UNUSED PyArrayObject *__pyx_v_P, int __pyx_skip_dispatch) {
14878   __Pyx_LocalBuf_ND __pyx_pybuffernd_P;
14879   __Pyx_Buffer __pyx_pybuffer_P;
14880   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
14881   __Pyx_Buffer __pyx_pybuffer_m;
14882   PyObject *__pyx_r = NULL;
14883   __Pyx_RefNannyDeclarations
14884   PyObject *__pyx_t_1 = NULL;
14885   PyObject *__pyx_t_2 = NULL;
14886   PyObject *__pyx_t_3 = NULL;
14887   PyObject *__pyx_t_4 = NULL;
14888   PyObject *__pyx_t_5 = NULL;
14889   int __pyx_t_6;
14890   PyObject *__pyx_t_7 = NULL;
14891   int __pyx_lineno = 0;
14892   const char *__pyx_filename = NULL;
14893   int __pyx_clineno = 0;
14894   __Pyx_RefNannySetupContext("Ak", 0);
14895   __pyx_pybuffer_m.pybuffer.buf = NULL;
14896   __pyx_pybuffer_m.refcount = 0;
14897   __pyx_pybuffernd_m.data = NULL;
14898   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
14899   __pyx_pybuffer_P.pybuffer.buf = NULL;
14900   __pyx_pybuffer_P.refcount = 0;
14901   __pyx_pybuffernd_P.data = NULL;
14902   __pyx_pybuffernd_P.rcbuffer = &__pyx_pybuffer_P;
14903   {
14904     __Pyx_BufFmt_StackElem __pyx_stack[1];
14905     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 454, __pyx_L1_error)
14906   }
14907   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
14908   {
14909     __Pyx_BufFmt_StackElem __pyx_stack[1];
14910     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P.rcbuffer->pybuffer, (PyObject*)__pyx_v_P, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 454, __pyx_L1_error)
14911   }
14912   __pyx_pybuffernd_P.diminfo[0].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P.diminfo[0].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P.diminfo[1].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P.diminfo[1].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[1];
14913   /* Check if called by wrapper */
14914   if (unlikely(__pyx_skip_dispatch)) ;
14915   /* Check if overridden in Python */
14916   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
14917     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14918     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14919     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
14920       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14921       #endif
14922       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Ak); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
14923       __Pyx_GOTREF(__pyx_t_1);
14924       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak)) {
14925         __Pyx_XDECREF(__pyx_r);
14926         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
14927         __Pyx_GOTREF(__pyx_t_3);
14928         __Pyx_INCREF(__pyx_t_1);
14929         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
14930         __pyx_t_6 = 0;
14931         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
14932           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
14933           if (likely(__pyx_t_5)) {
14934             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
14935             __Pyx_INCREF(__pyx_t_5);
14936             __Pyx_INCREF(function);
14937             __Pyx_DECREF_SET(__pyx_t_4, function);
14938             __pyx_t_6 = 1;
14939           }
14940         }
14941         #if CYTHON_FAST_PYCALL
14942         if (PyFunction_Check(__pyx_t_4)) {
14943           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_P)};
14944           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
14945           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14946           __Pyx_GOTREF(__pyx_t_2);
14947           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14948         } else
14949         #endif
14950         #if CYTHON_FAST_PYCCALL
14951         if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
14952           PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_3, ((PyObject *)__pyx_v_m), ((PyObject *)__pyx_v_P)};
14953           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
14954           __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
14955           __Pyx_GOTREF(__pyx_t_2);
14956           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14957         } else
14958         #endif
14959         {
14960           __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error)
14961           __Pyx_GOTREF(__pyx_t_7);
14962           if (__pyx_t_5) {
14963             __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
14964           }
14965           __Pyx_GIVEREF(__pyx_t_3);
14966           PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
14967           __Pyx_INCREF(((PyObject *)__pyx_v_m));
14968           __Pyx_GIVEREF(((PyObject *)__pyx_v_m));
14969           PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_m));
14970           __Pyx_INCREF(((PyObject *)__pyx_v_P));
14971           __Pyx_GIVEREF(((PyObject *)__pyx_v_P));
14972           PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, ((PyObject *)__pyx_v_P));
14973           __pyx_t_3 = 0;
14974           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
14975           __Pyx_GOTREF(__pyx_t_2);
14976           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14977         }
14978         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14979         __pyx_r = __pyx_t_2;
14980         __pyx_t_2 = 0;
14981         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14982         goto __pyx_L0;
14983       }
14984       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14985       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
14986       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
14987       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
14988         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
14989       }
14990       #endif
14991       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14992       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
14993     }
14994     #endif
14995   }
14996 
14997   /* "GPy/models/state_space_cython.pyx":455
14998  *
14999  *         cpdef Ak(self,int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P):
15000  *             self.last_k = k             # <<<<<<<<<<<<<<
15001  *             return self.As[:,:, <int>self.reconstruct_indices[k]]
15002  *
15003  */
15004   __pyx_v_self->last_k = __pyx_v_k;
15005 
15006   /* "GPy/models/state_space_cython.pyx":456
15007  *         cpdef Ak(self,int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P):
15008  *             self.last_k = k
15009  *             return self.As[:,:, <int>self.reconstruct_indices[k]]             # <<<<<<<<<<<<<<
15010  *
15011  *         cpdef Qk(self,int k):
15012  */
15013   __Pyx_XDECREF(__pyx_r);
15014   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
15015   __Pyx_GOTREF(__pyx_t_1);
15016   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 456, __pyx_L1_error)
15017   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15018   __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
15019   __Pyx_GOTREF(__pyx_t_1);
15020   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
15021   __Pyx_GOTREF(__pyx_t_2);
15022   __Pyx_INCREF(__pyx_slice__10);
15023   __Pyx_GIVEREF(__pyx_slice__10);
15024   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__10);
15025   __Pyx_INCREF(__pyx_slice__10);
15026   __Pyx_GIVEREF(__pyx_slice__10);
15027   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__10);
15028   __Pyx_GIVEREF(__pyx_t_1);
15029   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
15030   __pyx_t_1 = 0;
15031   __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->As), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
15032   __Pyx_GOTREF(__pyx_t_1);
15033   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15034   __pyx_r = __pyx_t_1;
15035   __pyx_t_1 = 0;
15036   goto __pyx_L0;
15037 
15038   /* "GPy/models/state_space_cython.pyx":454
15039  *             return self
15040  *
15041  *         cpdef Ak(self,int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P):             # <<<<<<<<<<<<<<
15042  *             self.last_k = k
15043  *             return self.As[:,:, <int>self.reconstruct_indices[k]]
15044  */
15045 
15046   /* function exit code */
15047   __pyx_L1_error:;
15048   __Pyx_XDECREF(__pyx_t_1);
15049   __Pyx_XDECREF(__pyx_t_2);
15050   __Pyx_XDECREF(__pyx_t_3);
15051   __Pyx_XDECREF(__pyx_t_4);
15052   __Pyx_XDECREF(__pyx_t_5);
15053   __Pyx_XDECREF(__pyx_t_7);
15054   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15055     __Pyx_PyThreadState_declare
15056     __Pyx_PyThreadState_assign
15057     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15058     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
15059     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
15060   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15061   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
15062   __pyx_r = 0;
15063   goto __pyx_L2;
15064   __pyx_L0:;
15065   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
15066   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
15067   __pyx_L2:;
15068   __Pyx_XGIVEREF(__pyx_r);
15069   __Pyx_RefNannyFinishContext();
15070   return __pyx_r;
15071 }
15072 
15073 /* Python wrapper */
15074 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)15075 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15076   int __pyx_v_k;
15077   PyArrayObject *__pyx_v_m = 0;
15078   PyArrayObject *__pyx_v_P = 0;
15079   int __pyx_lineno = 0;
15080   const char *__pyx_filename = NULL;
15081   int __pyx_clineno = 0;
15082   PyObject *__pyx_r = 0;
15083   __Pyx_RefNannyDeclarations
15084   __Pyx_RefNannySetupContext("Ak (wrapper)", 0);
15085   {
15086     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_m,&__pyx_n_s_P,0};
15087     PyObject* values[3] = {0,0,0};
15088     if (unlikely(__pyx_kwds)) {
15089       Py_ssize_t kw_args;
15090       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15091       switch (pos_args) {
15092         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15093         CYTHON_FALLTHROUGH;
15094         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15095         CYTHON_FALLTHROUGH;
15096         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15097         CYTHON_FALLTHROUGH;
15098         case  0: break;
15099         default: goto __pyx_L5_argtuple_error;
15100       }
15101       kw_args = PyDict_Size(__pyx_kwds);
15102       switch (pos_args) {
15103         case  0:
15104         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
15105         else goto __pyx_L5_argtuple_error;
15106         CYTHON_FALLTHROUGH;
15107         case  1:
15108         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m)) != 0)) kw_args--;
15109         else {
15110           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 1); __PYX_ERR(0, 454, __pyx_L3_error)
15111         }
15112         CYTHON_FALLTHROUGH;
15113         case  2:
15114         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P)) != 0)) kw_args--;
15115         else {
15116           __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, 2); __PYX_ERR(0, 454, __pyx_L3_error)
15117         }
15118       }
15119       if (unlikely(kw_args > 0)) {
15120         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Ak") < 0)) __PYX_ERR(0, 454, __pyx_L3_error)
15121       }
15122     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
15123       goto __pyx_L5_argtuple_error;
15124     } else {
15125       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15126       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15127       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15128     }
15129     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L3_error)
15130     __pyx_v_m = ((PyArrayObject *)values[1]);
15131     __pyx_v_P = ((PyArrayObject *)values[2]);
15132   }
15133   goto __pyx_L4_argument_unpacking_done;
15134   __pyx_L5_argtuple_error:;
15135   __Pyx_RaiseArgtupleInvalid("Ak", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 454, __pyx_L3_error)
15136   __pyx_L3_error:;
15137   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
15138   __Pyx_RefNannyFinishContext();
15139   return NULL;
15140   __pyx_L4_argument_unpacking_done:;
15141   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m), __pyx_ptype_5numpy_ndarray, 1, "m", 0))) __PYX_ERR(0, 454, __pyx_L1_error)
15142   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P), __pyx_ptype_5numpy_ndarray, 1, "P", 0))) __PYX_ERR(0, 454, __pyx_L1_error)
15143   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_6Ak(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_m, __pyx_v_P);
15144 
15145   /* function exit code */
15146   goto __pyx_L0;
15147   __pyx_L1_error:;
15148   __pyx_r = NULL;
15149   __pyx_L0:;
15150   __Pyx_RefNannyFinishContext();
15151   return __pyx_r;
15152 }
15153 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_6Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,PyArrayObject * __pyx_v_m,PyArrayObject * __pyx_v_P)15154 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_6Ak(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, PyArrayObject *__pyx_v_m, PyArrayObject *__pyx_v_P) {
15155   __Pyx_LocalBuf_ND __pyx_pybuffernd_P;
15156   __Pyx_Buffer __pyx_pybuffer_P;
15157   __Pyx_LocalBuf_ND __pyx_pybuffernd_m;
15158   __Pyx_Buffer __pyx_pybuffer_m;
15159   PyObject *__pyx_r = NULL;
15160   __Pyx_RefNannyDeclarations
15161   PyObject *__pyx_t_1 = NULL;
15162   int __pyx_lineno = 0;
15163   const char *__pyx_filename = NULL;
15164   int __pyx_clineno = 0;
15165   __Pyx_RefNannySetupContext("Ak", 0);
15166   __pyx_pybuffer_m.pybuffer.buf = NULL;
15167   __pyx_pybuffer_m.refcount = 0;
15168   __pyx_pybuffernd_m.data = NULL;
15169   __pyx_pybuffernd_m.rcbuffer = &__pyx_pybuffer_m;
15170   __pyx_pybuffer_P.pybuffer.buf = NULL;
15171   __pyx_pybuffer_P.refcount = 0;
15172   __pyx_pybuffernd_P.data = NULL;
15173   __pyx_pybuffernd_P.rcbuffer = &__pyx_pybuffer_P;
15174   {
15175     __Pyx_BufFmt_StackElem __pyx_stack[1];
15176     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 454, __pyx_L1_error)
15177   }
15178   __pyx_pybuffernd_m.diminfo[0].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m.diminfo[0].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m.diminfo[1].strides = __pyx_pybuffernd_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m.diminfo[1].shape = __pyx_pybuffernd_m.rcbuffer->pybuffer.shape[1];
15179   {
15180     __Pyx_BufFmt_StackElem __pyx_stack[1];
15181     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P.rcbuffer->pybuffer, (PyObject*)__pyx_v_P, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 454, __pyx_L1_error)
15182   }
15183   __pyx_pybuffernd_P.diminfo[0].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P.diminfo[0].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P.diminfo[1].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P.diminfo[1].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[1];
15184   __Pyx_XDECREF(__pyx_r);
15185   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Ak(__pyx_v_self, __pyx_v_k, ((PyArrayObject *)__pyx_v_m), ((PyArrayObject *)__pyx_v_P), 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
15186   __Pyx_GOTREF(__pyx_t_1);
15187   __pyx_r = __pyx_t_1;
15188   __pyx_t_1 = 0;
15189   goto __pyx_L0;
15190 
15191   /* function exit code */
15192   __pyx_L1_error:;
15193   __Pyx_XDECREF(__pyx_t_1);
15194   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15195     __Pyx_PyThreadState_declare
15196     __Pyx_PyThreadState_assign
15197     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15198     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
15199     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
15200   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15201   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Ak", __pyx_clineno, __pyx_lineno, __pyx_filename);
15202   __pyx_r = NULL;
15203   goto __pyx_L2;
15204   __pyx_L0:;
15205   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
15206   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m.rcbuffer->pybuffer);
15207   __pyx_L2:;
15208   __Pyx_XGIVEREF(__pyx_r);
15209   __Pyx_RefNannyFinishContext();
15210   return __pyx_r;
15211 }
15212 
15213 /* "GPy/models/state_space_cython.pyx":458
15214  *             return self.As[:,:, <int>self.reconstruct_indices[k]]
15215  *
15216  *         cpdef Qk(self,int k):             # <<<<<<<<<<<<<<
15217  *             self.last_k = k
15218  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]
15219  */
15220 
15221 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)15222 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
15223   PyObject *__pyx_r = NULL;
15224   __Pyx_RefNannyDeclarations
15225   PyObject *__pyx_t_1 = NULL;
15226   PyObject *__pyx_t_2 = NULL;
15227   PyObject *__pyx_t_3 = NULL;
15228   PyObject *__pyx_t_4 = NULL;
15229   PyObject *__pyx_t_5 = NULL;
15230   int __pyx_t_6;
15231   int __pyx_lineno = 0;
15232   const char *__pyx_filename = NULL;
15233   int __pyx_clineno = 0;
15234   __Pyx_RefNannySetupContext("Qk", 0);
15235   /* Check if called by wrapper */
15236   if (unlikely(__pyx_skip_dispatch)) ;
15237   /* Check if overridden in Python */
15238   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
15239     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15240     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15241     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
15242       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15243       #endif
15244       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Qk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
15245       __Pyx_GOTREF(__pyx_t_1);
15246       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk)) {
15247         __Pyx_XDECREF(__pyx_r);
15248         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
15249         __Pyx_GOTREF(__pyx_t_3);
15250         __Pyx_INCREF(__pyx_t_1);
15251         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
15252         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15253           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
15254           if (likely(__pyx_t_5)) {
15255             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15256             __Pyx_INCREF(__pyx_t_5);
15257             __Pyx_INCREF(function);
15258             __Pyx_DECREF_SET(__pyx_t_4, function);
15259           }
15260         }
15261         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
15262         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15263         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15264         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error)
15265         __Pyx_GOTREF(__pyx_t_2);
15266         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15267         __pyx_r = __pyx_t_2;
15268         __pyx_t_2 = 0;
15269         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15270         goto __pyx_L0;
15271       }
15272       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15273       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15274       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
15275       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
15276         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15277       }
15278       #endif
15279       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15280       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15281     }
15282     #endif
15283   }
15284 
15285   /* "GPy/models/state_space_cython.pyx":459
15286  *
15287  *         cpdef Qk(self,int k):
15288  *             self.last_k = k             # <<<<<<<<<<<<<<
15289  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]
15290  *
15291  */
15292   __pyx_v_self->last_k = __pyx_v_k;
15293 
15294   /* "GPy/models/state_space_cython.pyx":460
15295  *         cpdef Qk(self,int k):
15296  *             self.last_k = k
15297  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]             # <<<<<<<<<<<<<<
15298  *
15299  *         cpdef dAk(self, int k):
15300  */
15301   __Pyx_XDECREF(__pyx_r);
15302   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
15303   __Pyx_GOTREF(__pyx_t_1);
15304   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
15305   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15306   __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
15307   __Pyx_GOTREF(__pyx_t_1);
15308   __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
15309   __Pyx_GOTREF(__pyx_t_2);
15310   __Pyx_INCREF(__pyx_slice__10);
15311   __Pyx_GIVEREF(__pyx_slice__10);
15312   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__10);
15313   __Pyx_INCREF(__pyx_slice__10);
15314   __Pyx_GIVEREF(__pyx_slice__10);
15315   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__10);
15316   __Pyx_GIVEREF(__pyx_t_1);
15317   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
15318   __pyx_t_1 = 0;
15319   __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Qs), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
15320   __Pyx_GOTREF(__pyx_t_1);
15321   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15322   __pyx_r = __pyx_t_1;
15323   __pyx_t_1 = 0;
15324   goto __pyx_L0;
15325 
15326   /* "GPy/models/state_space_cython.pyx":458
15327  *             return self.As[:,:, <int>self.reconstruct_indices[k]]
15328  *
15329  *         cpdef Qk(self,int k):             # <<<<<<<<<<<<<<
15330  *             self.last_k = k
15331  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]
15332  */
15333 
15334   /* function exit code */
15335   __pyx_L1_error:;
15336   __Pyx_XDECREF(__pyx_t_1);
15337   __Pyx_XDECREF(__pyx_t_2);
15338   __Pyx_XDECREF(__pyx_t_3);
15339   __Pyx_XDECREF(__pyx_t_4);
15340   __Pyx_XDECREF(__pyx_t_5);
15341   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15342   __pyx_r = 0;
15343   __pyx_L0:;
15344   __Pyx_XGIVEREF(__pyx_r);
15345   __Pyx_RefNannyFinishContext();
15346   return __pyx_r;
15347 }
15348 
15349 /* Python wrapper */
15350 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)15351 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
15352   int __pyx_v_k;
15353   int __pyx_lineno = 0;
15354   const char *__pyx_filename = NULL;
15355   int __pyx_clineno = 0;
15356   PyObject *__pyx_r = 0;
15357   __Pyx_RefNannyDeclarations
15358   __Pyx_RefNannySetupContext("Qk (wrapper)", 0);
15359   assert(__pyx_arg_k); {
15360     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error)
15361   }
15362   goto __pyx_L4_argument_unpacking_done;
15363   __pyx_L3_error:;
15364   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15365   __Pyx_RefNannyFinishContext();
15366   return NULL;
15367   __pyx_L4_argument_unpacking_done:;
15368   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_8Qk(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), ((int)__pyx_v_k));
15369 
15370   /* function exit code */
15371   __Pyx_RefNannyFinishContext();
15372   return __pyx_r;
15373 }
15374 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_8Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k)15375 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_8Qk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k) {
15376   PyObject *__pyx_r = NULL;
15377   __Pyx_RefNannyDeclarations
15378   PyObject *__pyx_t_1 = NULL;
15379   int __pyx_lineno = 0;
15380   const char *__pyx_filename = NULL;
15381   int __pyx_clineno = 0;
15382   __Pyx_RefNannySetupContext("Qk", 0);
15383   __Pyx_XDECREF(__pyx_r);
15384   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Qk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
15385   __Pyx_GOTREF(__pyx_t_1);
15386   __pyx_r = __pyx_t_1;
15387   __pyx_t_1 = 0;
15388   goto __pyx_L0;
15389 
15390   /* function exit code */
15391   __pyx_L1_error:;
15392   __Pyx_XDECREF(__pyx_t_1);
15393   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Qk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15394   __pyx_r = NULL;
15395   __pyx_L0:;
15396   __Pyx_XGIVEREF(__pyx_r);
15397   __Pyx_RefNannyFinishContext();
15398   return __pyx_r;
15399 }
15400 
15401 /* "GPy/models/state_space_cython.pyx":462
15402  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]
15403  *
15404  *         cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
15405  *             self.last_k = k
15406  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]
15407  */
15408 
15409 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)15410 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
15411   PyObject *__pyx_r = NULL;
15412   __Pyx_RefNannyDeclarations
15413   PyObject *__pyx_t_1 = NULL;
15414   PyObject *__pyx_t_2 = NULL;
15415   PyObject *__pyx_t_3 = NULL;
15416   PyObject *__pyx_t_4 = NULL;
15417   PyObject *__pyx_t_5 = NULL;
15418   int __pyx_t_6;
15419   int __pyx_lineno = 0;
15420   const char *__pyx_filename = NULL;
15421   int __pyx_clineno = 0;
15422   __Pyx_RefNannySetupContext("dAk", 0);
15423   /* Check if called by wrapper */
15424   if (unlikely(__pyx_skip_dispatch)) ;
15425   /* Check if overridden in Python */
15426   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
15427     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15428     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15429     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
15430       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15431       #endif
15432       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dAk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
15433       __Pyx_GOTREF(__pyx_t_1);
15434       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk)) {
15435         __Pyx_XDECREF(__pyx_r);
15436         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error)
15437         __Pyx_GOTREF(__pyx_t_3);
15438         __Pyx_INCREF(__pyx_t_1);
15439         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
15440         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15441           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
15442           if (likely(__pyx_t_5)) {
15443             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15444             __Pyx_INCREF(__pyx_t_5);
15445             __Pyx_INCREF(function);
15446             __Pyx_DECREF_SET(__pyx_t_4, function);
15447           }
15448         }
15449         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
15450         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15451         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15452         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
15453         __Pyx_GOTREF(__pyx_t_2);
15454         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15455         __pyx_r = __pyx_t_2;
15456         __pyx_t_2 = 0;
15457         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15458         goto __pyx_L0;
15459       }
15460       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15461       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15462       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
15463       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
15464         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15465       }
15466       #endif
15467       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15468       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15469     }
15470     #endif
15471   }
15472 
15473   /* "GPy/models/state_space_cython.pyx":463
15474  *
15475  *         cpdef dAk(self, int k):
15476  *             self.last_k = k             # <<<<<<<<<<<<<<
15477  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]
15478  *
15479  */
15480   __pyx_v_self->last_k = __pyx_v_k;
15481 
15482   /* "GPy/models/state_space_cython.pyx":464
15483  *         cpdef dAk(self, int k):
15484  *             self.last_k = k
15485  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]             # <<<<<<<<<<<<<<
15486  *
15487  *         cpdef dQk(self, int k):
15488  */
15489   __Pyx_XDECREF(__pyx_r);
15490   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
15491   __Pyx_GOTREF(__pyx_t_1);
15492   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L1_error)
15493   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15494   __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
15495   __Pyx_GOTREF(__pyx_t_1);
15496   __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
15497   __Pyx_GOTREF(__pyx_t_2);
15498   __Pyx_INCREF(__pyx_slice__10);
15499   __Pyx_GIVEREF(__pyx_slice__10);
15500   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__10);
15501   __Pyx_INCREF(__pyx_slice__10);
15502   __Pyx_GIVEREF(__pyx_slice__10);
15503   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__10);
15504   __Pyx_INCREF(__pyx_slice__10);
15505   __Pyx_GIVEREF(__pyx_slice__10);
15506   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_slice__10);
15507   __Pyx_GIVEREF(__pyx_t_1);
15508   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
15509   __pyx_t_1 = 0;
15510   __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dAs), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
15511   __Pyx_GOTREF(__pyx_t_1);
15512   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15513   __pyx_r = __pyx_t_1;
15514   __pyx_t_1 = 0;
15515   goto __pyx_L0;
15516 
15517   /* "GPy/models/state_space_cython.pyx":462
15518  *             return self.Qs[:,:, <int>self.reconstruct_indices[k]]
15519  *
15520  *         cpdef dAk(self, int k):             # <<<<<<<<<<<<<<
15521  *             self.last_k = k
15522  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]
15523  */
15524 
15525   /* function exit code */
15526   __pyx_L1_error:;
15527   __Pyx_XDECREF(__pyx_t_1);
15528   __Pyx_XDECREF(__pyx_t_2);
15529   __Pyx_XDECREF(__pyx_t_3);
15530   __Pyx_XDECREF(__pyx_t_4);
15531   __Pyx_XDECREF(__pyx_t_5);
15532   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15533   __pyx_r = 0;
15534   __pyx_L0:;
15535   __Pyx_XGIVEREF(__pyx_r);
15536   __Pyx_RefNannyFinishContext();
15537   return __pyx_r;
15538 }
15539 
15540 /* Python wrapper */
15541 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)15542 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
15543   int __pyx_v_k;
15544   int __pyx_lineno = 0;
15545   const char *__pyx_filename = NULL;
15546   int __pyx_clineno = 0;
15547   PyObject *__pyx_r = 0;
15548   __Pyx_RefNannyDeclarations
15549   __Pyx_RefNannySetupContext("dAk (wrapper)", 0);
15550   assert(__pyx_arg_k); {
15551     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L3_error)
15552   }
15553   goto __pyx_L4_argument_unpacking_done;
15554   __pyx_L3_error:;
15555   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15556   __Pyx_RefNannyFinishContext();
15557   return NULL;
15558   __pyx_L4_argument_unpacking_done:;
15559   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_10dAk(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), ((int)__pyx_v_k));
15560 
15561   /* function exit code */
15562   __Pyx_RefNannyFinishContext();
15563   return __pyx_r;
15564 }
15565 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_10dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k)15566 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_10dAk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k) {
15567   PyObject *__pyx_r = NULL;
15568   __Pyx_RefNannyDeclarations
15569   PyObject *__pyx_t_1 = NULL;
15570   int __pyx_lineno = 0;
15571   const char *__pyx_filename = NULL;
15572   int __pyx_clineno = 0;
15573   __Pyx_RefNannySetupContext("dAk", 0);
15574   __Pyx_XDECREF(__pyx_r);
15575   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dAk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
15576   __Pyx_GOTREF(__pyx_t_1);
15577   __pyx_r = __pyx_t_1;
15578   __pyx_t_1 = 0;
15579   goto __pyx_L0;
15580 
15581   /* function exit code */
15582   __pyx_L1_error:;
15583   __Pyx_XDECREF(__pyx_t_1);
15584   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dAk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15585   __pyx_r = NULL;
15586   __pyx_L0:;
15587   __Pyx_XGIVEREF(__pyx_r);
15588   __Pyx_RefNannyFinishContext();
15589   return __pyx_r;
15590 }
15591 
15592 /* "GPy/models/state_space_cython.pyx":466
15593  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]
15594  *
15595  *         cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
15596  *             self.last_k = k
15597  *             return self.dQs[:,:, :, <int>self.reconstruct_indices[k]]
15598  */
15599 
15600 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)15601 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
15602   PyObject *__pyx_r = NULL;
15603   __Pyx_RefNannyDeclarations
15604   PyObject *__pyx_t_1 = NULL;
15605   PyObject *__pyx_t_2 = NULL;
15606   PyObject *__pyx_t_3 = NULL;
15607   PyObject *__pyx_t_4 = NULL;
15608   PyObject *__pyx_t_5 = NULL;
15609   int __pyx_t_6;
15610   int __pyx_lineno = 0;
15611   const char *__pyx_filename = NULL;
15612   int __pyx_clineno = 0;
15613   __Pyx_RefNannySetupContext("dQk", 0);
15614   /* Check if called by wrapper */
15615   if (unlikely(__pyx_skip_dispatch)) ;
15616   /* Check if overridden in Python */
15617   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
15618     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15619     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15620     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
15621       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15622       #endif
15623       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_dQk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
15624       __Pyx_GOTREF(__pyx_t_1);
15625       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk)) {
15626         __Pyx_XDECREF(__pyx_r);
15627         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
15628         __Pyx_GOTREF(__pyx_t_3);
15629         __Pyx_INCREF(__pyx_t_1);
15630         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
15631         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15632           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
15633           if (likely(__pyx_t_5)) {
15634             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15635             __Pyx_INCREF(__pyx_t_5);
15636             __Pyx_INCREF(function);
15637             __Pyx_DECREF_SET(__pyx_t_4, function);
15638           }
15639         }
15640         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
15641         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15642         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15643         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
15644         __Pyx_GOTREF(__pyx_t_2);
15645         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15646         __pyx_r = __pyx_t_2;
15647         __pyx_t_2 = 0;
15648         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15649         goto __pyx_L0;
15650       }
15651       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15652       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15653       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
15654       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
15655         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15656       }
15657       #endif
15658       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15659       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15660     }
15661     #endif
15662   }
15663 
15664   /* "GPy/models/state_space_cython.pyx":467
15665  *
15666  *         cpdef dQk(self, int k):
15667  *             self.last_k = k             # <<<<<<<<<<<<<<
15668  *             return self.dQs[:,:, :, <int>self.reconstruct_indices[k]]
15669  *
15670  */
15671   __pyx_v_self->last_k = __pyx_v_k;
15672 
15673   /* "GPy/models/state_space_cython.pyx":468
15674  *         cpdef dQk(self, int k):
15675  *             self.last_k = k
15676  *             return self.dQs[:,:, :, <int>self.reconstruct_indices[k]]             # <<<<<<<<<<<<<<
15677  *
15678  *
15679  */
15680   __Pyx_XDECREF(__pyx_r);
15681   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
15682   __Pyx_GOTREF(__pyx_t_1);
15683   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 468, __pyx_L1_error)
15684   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15685   __pyx_t_1 = __Pyx_PyInt_From_int(((int)__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
15686   __Pyx_GOTREF(__pyx_t_1);
15687   __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
15688   __Pyx_GOTREF(__pyx_t_2);
15689   __Pyx_INCREF(__pyx_slice__10);
15690   __Pyx_GIVEREF(__pyx_slice__10);
15691   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_slice__10);
15692   __Pyx_INCREF(__pyx_slice__10);
15693   __Pyx_GIVEREF(__pyx_slice__10);
15694   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice__10);
15695   __Pyx_INCREF(__pyx_slice__10);
15696   __Pyx_GIVEREF(__pyx_slice__10);
15697   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_slice__10);
15698   __Pyx_GIVEREF(__pyx_t_1);
15699   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
15700   __pyx_t_1 = 0;
15701   __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->dQs), __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
15702   __Pyx_GOTREF(__pyx_t_1);
15703   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15704   __pyx_r = __pyx_t_1;
15705   __pyx_t_1 = 0;
15706   goto __pyx_L0;
15707 
15708   /* "GPy/models/state_space_cython.pyx":466
15709  *             return self.dAs[:,:, :, <int>self.reconstruct_indices[k]]
15710  *
15711  *         cpdef dQk(self, int k):             # <<<<<<<<<<<<<<
15712  *             self.last_k = k
15713  *             return self.dQs[:,:, :, <int>self.reconstruct_indices[k]]
15714  */
15715 
15716   /* function exit code */
15717   __pyx_L1_error:;
15718   __Pyx_XDECREF(__pyx_t_1);
15719   __Pyx_XDECREF(__pyx_t_2);
15720   __Pyx_XDECREF(__pyx_t_3);
15721   __Pyx_XDECREF(__pyx_t_4);
15722   __Pyx_XDECREF(__pyx_t_5);
15723   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15724   __pyx_r = 0;
15725   __pyx_L0:;
15726   __Pyx_XGIVEREF(__pyx_r);
15727   __Pyx_RefNannyFinishContext();
15728   return __pyx_r;
15729 }
15730 
15731 /* Python wrapper */
15732 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)15733 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
15734   int __pyx_v_k;
15735   int __pyx_lineno = 0;
15736   const char *__pyx_filename = NULL;
15737   int __pyx_clineno = 0;
15738   PyObject *__pyx_r = 0;
15739   __Pyx_RefNannyDeclarations
15740   __Pyx_RefNannySetupContext("dQk (wrapper)", 0);
15741   assert(__pyx_arg_k); {
15742     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error)
15743   }
15744   goto __pyx_L4_argument_unpacking_done;
15745   __pyx_L3_error:;
15746   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15747   __Pyx_RefNannyFinishContext();
15748   return NULL;
15749   __pyx_L4_argument_unpacking_done:;
15750   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_12dQk(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), ((int)__pyx_v_k));
15751 
15752   /* function exit code */
15753   __Pyx_RefNannyFinishContext();
15754   return __pyx_r;
15755 }
15756 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_12dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k)15757 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_12dQk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k) {
15758   PyObject *__pyx_r = NULL;
15759   __Pyx_RefNannyDeclarations
15760   PyObject *__pyx_t_1 = NULL;
15761   int __pyx_lineno = 0;
15762   const char *__pyx_filename = NULL;
15763   int __pyx_clineno = 0;
15764   __Pyx_RefNannySetupContext("dQk", 0);
15765   __Pyx_XDECREF(__pyx_r);
15766   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dQk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 466, __pyx_L1_error)
15767   __Pyx_GOTREF(__pyx_t_1);
15768   __pyx_r = __pyx_t_1;
15769   __pyx_t_1 = 0;
15770   goto __pyx_L0;
15771 
15772   /* function exit code */
15773   __pyx_L1_error:;
15774   __Pyx_XDECREF(__pyx_t_1);
15775   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.dQk", __pyx_clineno, __pyx_lineno, __pyx_filename);
15776   __pyx_r = NULL;
15777   __pyx_L0:;
15778   __Pyx_XGIVEREF(__pyx_r);
15779   __Pyx_RefNannyFinishContext();
15780   return __pyx_r;
15781 }
15782 
15783 /* "GPy/models/state_space_cython.pyx":471
15784  *
15785  *
15786  *         cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
15787  *             """
15788  *             Square root of the noise matrix Q
15789  */
15790 
15791 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch)15792 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch) {
15793   int __pyx_v_matrix_index;
15794   PyArrayObject *__pyx_v_square_root = 0;
15795   PyArrayObject *__pyx_v_U = 0;
15796   PyArrayObject *__pyx_v_S = 0;
15797   PyArrayObject *__pyx_v_Vh = 0;
15798   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
15799   __Pyx_Buffer __pyx_pybuffer_S;
15800   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
15801   __Pyx_Buffer __pyx_pybuffer_U;
15802   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
15803   __Pyx_Buffer __pyx_pybuffer_Vh;
15804   __Pyx_LocalBuf_ND __pyx_pybuffernd_square_root;
15805   __Pyx_Buffer __pyx_pybuffer_square_root;
15806   PyObject *__pyx_r = NULL;
15807   __Pyx_RefNannyDeclarations
15808   PyObject *__pyx_t_1 = NULL;
15809   PyObject *__pyx_t_2 = NULL;
15810   PyObject *__pyx_t_3 = NULL;
15811   PyObject *__pyx_t_4 = NULL;
15812   PyObject *__pyx_t_5 = NULL;
15813   int __pyx_t_6;
15814   int __pyx_t_7;
15815   int __pyx_t_8;
15816   PyArrayObject *__pyx_t_9 = NULL;
15817   PyObject *__pyx_t_10 = NULL;
15818   PyObject *__pyx_t_11 = NULL;
15819   PyObject *__pyx_t_12 = NULL;
15820   PyObject *(*__pyx_t_13)(PyObject *);
15821   PyArrayObject *__pyx_t_14 = NULL;
15822   PyArrayObject *__pyx_t_15 = NULL;
15823   PyArrayObject *__pyx_t_16 = NULL;
15824   int __pyx_lineno = 0;
15825   const char *__pyx_filename = NULL;
15826   int __pyx_clineno = 0;
15827   __Pyx_RefNannySetupContext("Q_srk", 0);
15828   __pyx_pybuffer_square_root.pybuffer.buf = NULL;
15829   __pyx_pybuffer_square_root.refcount = 0;
15830   __pyx_pybuffernd_square_root.data = NULL;
15831   __pyx_pybuffernd_square_root.rcbuffer = &__pyx_pybuffer_square_root;
15832   __pyx_pybuffer_U.pybuffer.buf = NULL;
15833   __pyx_pybuffer_U.refcount = 0;
15834   __pyx_pybuffernd_U.data = NULL;
15835   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
15836   __pyx_pybuffer_S.pybuffer.buf = NULL;
15837   __pyx_pybuffer_S.refcount = 0;
15838   __pyx_pybuffernd_S.data = NULL;
15839   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
15840   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
15841   __pyx_pybuffer_Vh.refcount = 0;
15842   __pyx_pybuffernd_Vh.data = NULL;
15843   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
15844   /* Check if called by wrapper */
15845   if (unlikely(__pyx_skip_dispatch)) ;
15846   /* Check if overridden in Python */
15847   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
15848     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15849     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15850     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
15851       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15852       #endif
15853       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_srk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
15854       __Pyx_GOTREF(__pyx_t_1);
15855       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk)) {
15856         __Pyx_XDECREF(__pyx_r);
15857         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L1_error)
15858         __Pyx_GOTREF(__pyx_t_3);
15859         __Pyx_INCREF(__pyx_t_1);
15860         __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
15861         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
15862           __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
15863           if (likely(__pyx_t_5)) {
15864             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
15865             __Pyx_INCREF(__pyx_t_5);
15866             __Pyx_INCREF(function);
15867             __Pyx_DECREF_SET(__pyx_t_4, function);
15868           }
15869         }
15870         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
15871         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
15872         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15873         if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
15874         __Pyx_GOTREF(__pyx_t_2);
15875         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15876         __pyx_r = __pyx_t_2;
15877         __pyx_t_2 = 0;
15878         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15879         goto __pyx_L0;
15880       }
15881       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15882       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
15883       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
15884       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
15885         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
15886       }
15887       #endif
15888       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15889       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
15890     }
15891     #endif
15892   }
15893 
15894   /* "GPy/models/state_space_cython.pyx":476
15895  *             """
15896  *
15897  *             cdef int matrix_index = <int>self.reconstruct_indices[k]             # <<<<<<<<<<<<<<
15898  *             cdef np.ndarray[DTYPE_t, ndim=2] square_root
15899  *
15900  */
15901   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 476, __pyx_L1_error)
15902   __Pyx_GOTREF(__pyx_t_1);
15903   __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 476, __pyx_L1_error)
15904   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15905   __pyx_v_matrix_index = ((int)__pyx_t_6);
15906 
15907   /* "GPy/models/state_space_cython.pyx":484
15908  *
15909  *
15910  *             if matrix_index in self.Q_square_root_dict:             # <<<<<<<<<<<<<<
15911  *                 square_root = self.Q_square_root_dict[matrix_index]
15912  *             else:
15913  */
15914   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
15915   __Pyx_GOTREF(__pyx_t_1);
15916   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_square_root_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
15917   __Pyx_GOTREF(__pyx_t_2);
15918   __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 484, __pyx_L1_error)
15919   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15920   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15921   __pyx_t_8 = (__pyx_t_7 != 0);
15922   if (__pyx_t_8) {
15923 
15924     /* "GPy/models/state_space_cython.pyx":485
15925  *
15926  *             if matrix_index in self.Q_square_root_dict:
15927  *                 square_root = self.Q_square_root_dict[matrix_index]             # <<<<<<<<<<<<<<
15928  *             else:
15929  *                 if matrix_index not in self.Q_svd_dict:
15930  */
15931     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_square_root_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error)
15932     __Pyx_GOTREF(__pyx_t_2);
15933     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_matrix_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
15934     __Pyx_GOTREF(__pyx_t_1);
15935     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15936     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 485, __pyx_L1_error)
15937     __pyx_t_9 = ((PyArrayObject *)__pyx_t_1);
15938     {
15939       __Pyx_BufFmt_StackElem __pyx_stack[1];
15940       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
15941       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
15942       if (unlikely(__pyx_t_6 < 0)) {
15943         PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
15944         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
15945           Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
15946           __Pyx_RaiseBufferFallbackError();
15947         } else {
15948           PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
15949         }
15950         __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
15951       }
15952       __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
15953       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
15954     }
15955     __pyx_t_9 = 0;
15956     __pyx_v_square_root = ((PyArrayObject *)__pyx_t_1);
15957     __pyx_t_1 = 0;
15958 
15959     /* "GPy/models/state_space_cython.pyx":484
15960  *
15961  *
15962  *             if matrix_index in self.Q_square_root_dict:             # <<<<<<<<<<<<<<
15963  *                 square_root = self.Q_square_root_dict[matrix_index]
15964  *             else:
15965  */
15966     goto __pyx_L3;
15967   }
15968 
15969   /* "GPy/models/state_space_cython.pyx":487
15970  *                 square_root = self.Q_square_root_dict[matrix_index]
15971  *             else:
15972  *                 if matrix_index not in self.Q_svd_dict:             # <<<<<<<<<<<<<<
15973  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
15974  *                                         full_matrices=False, compute_uv=True,
15975  */
15976   /*else*/ {
15977     __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
15978     __Pyx_GOTREF(__pyx_t_1);
15979     if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
15980       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
15981       __PYX_ERR(0, 487, __pyx_L1_error)
15982     }
15983     __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_self->Q_svd_dict, Py_NE)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
15984     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15985     __pyx_t_7 = (__pyx_t_8 != 0);
15986     if (__pyx_t_7) {
15987 
15988       /* "GPy/models/state_space_cython.pyx":488
15989  *             else:
15990  *                 if matrix_index not in self.Q_svd_dict:
15991  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],             # <<<<<<<<<<<<<<
15992  *                                         full_matrices=False, compute_uv=True,
15993  *                                         overwrite_a=False, check_finite=False)
15994  */
15995       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
15996       __Pyx_GOTREF(__pyx_t_1);
15997       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_linalg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
15998       __Pyx_GOTREF(__pyx_t_2);
15999       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16000       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
16001       __Pyx_GOTREF(__pyx_t_1);
16002       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16003       __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
16004       __Pyx_GOTREF(__pyx_t_2);
16005       __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
16006       __Pyx_GOTREF(__pyx_t_4);
16007       __Pyx_INCREF(__pyx_slice__10);
16008       __Pyx_GIVEREF(__pyx_slice__10);
16009       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_slice__10);
16010       __Pyx_INCREF(__pyx_slice__10);
16011       __Pyx_GIVEREF(__pyx_slice__10);
16012       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
16013       __Pyx_GIVEREF(__pyx_t_2);
16014       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
16015       __pyx_t_2 = 0;
16016       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Qs), __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
16017       __Pyx_GOTREF(__pyx_t_2);
16018       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16019       __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
16020       __Pyx_GOTREF(__pyx_t_4);
16021       __Pyx_GIVEREF(__pyx_t_2);
16022       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
16023       __pyx_t_2 = 0;
16024 
16025       /* "GPy/models/state_space_cython.pyx":489
16026  *                 if matrix_index not in self.Q_svd_dict:
16027  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16028  *                                         full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
16029  *                                         overwrite_a=False, check_finite=False)
16030  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16031  */
16032       __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
16033       __Pyx_GOTREF(__pyx_t_2);
16034       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
16035       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
16036 
16037       /* "GPy/models/state_space_cython.pyx":490
16038  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16039  *                                         full_matrices=False, compute_uv=True,
16040  *                                         overwrite_a=False, check_finite=False)             # <<<<<<<<<<<<<<
16041  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16042  *                 else:
16043  */
16044       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
16045       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_check_finite, Py_False) < 0) __PYX_ERR(0, 489, __pyx_L1_error)
16046 
16047       /* "GPy/models/state_space_cython.pyx":488
16048  *             else:
16049  *                 if matrix_index not in self.Q_svd_dict:
16050  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],             # <<<<<<<<<<<<<<
16051  *                                         full_matrices=False, compute_uv=True,
16052  *                                         overwrite_a=False, check_finite=False)
16053  */
16054       __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error)
16055       __Pyx_GOTREF(__pyx_t_3);
16056       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16057       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16058       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16059       if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
16060         PyObject* sequence = __pyx_t_3;
16061         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16062         if (unlikely(size != 3)) {
16063           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
16064           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16065           __PYX_ERR(0, 488, __pyx_L1_error)
16066         }
16067         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16068         if (likely(PyTuple_CheckExact(sequence))) {
16069           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
16070           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
16071           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
16072         } else {
16073           __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
16074           __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
16075           __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
16076         }
16077         __Pyx_INCREF(__pyx_t_2);
16078         __Pyx_INCREF(__pyx_t_4);
16079         __Pyx_INCREF(__pyx_t_1);
16080         #else
16081         __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
16082         __Pyx_GOTREF(__pyx_t_2);
16083         __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error)
16084         __Pyx_GOTREF(__pyx_t_4);
16085         __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
16086         __Pyx_GOTREF(__pyx_t_1);
16087         #endif
16088         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16089       } else {
16090         Py_ssize_t index = -1;
16091         __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error)
16092         __Pyx_GOTREF(__pyx_t_5);
16093         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16094         __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
16095         index = 0; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
16096         __Pyx_GOTREF(__pyx_t_2);
16097         index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
16098         __Pyx_GOTREF(__pyx_t_4);
16099         index = 2; __pyx_t_1 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
16100         __Pyx_GOTREF(__pyx_t_1);
16101         if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
16102         __pyx_t_13 = NULL;
16103         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16104         goto __pyx_L6_unpacking_done;
16105         __pyx_L5_unpacking_failed:;
16106         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16107         __pyx_t_13 = NULL;
16108         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
16109         __PYX_ERR(0, 488, __pyx_L1_error)
16110         __pyx_L6_unpacking_done:;
16111       }
16112       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 488, __pyx_L1_error)
16113       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 488, __pyx_L1_error)
16114       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 488, __pyx_L1_error)
16115       __pyx_t_14 = ((PyArrayObject *)__pyx_t_2);
16116       {
16117         __Pyx_BufFmt_StackElem __pyx_stack[1];
16118         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
16119         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16120         if (unlikely(__pyx_t_6 < 0)) {
16121           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
16122           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16123             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
16124             __Pyx_RaiseBufferFallbackError();
16125           } else {
16126             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
16127           }
16128           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
16129         }
16130         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
16131         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
16132       }
16133       __pyx_t_14 = 0;
16134       __pyx_v_U = ((PyArrayObject *)__pyx_t_2);
16135       __pyx_t_2 = 0;
16136       __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
16137       {
16138         __Pyx_BufFmt_StackElem __pyx_stack[1];
16139         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
16140         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16141         if (unlikely(__pyx_t_6 < 0)) {
16142           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
16143           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16144             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
16145             __Pyx_RaiseBufferFallbackError();
16146           } else {
16147             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16148           }
16149           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
16150         }
16151         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
16152         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
16153       }
16154       __pyx_t_15 = 0;
16155       __pyx_v_S = ((PyArrayObject *)__pyx_t_4);
16156       __pyx_t_4 = 0;
16157       __pyx_t_16 = ((PyArrayObject *)__pyx_t_1);
16158       {
16159         __Pyx_BufFmt_StackElem __pyx_stack[1];
16160         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
16161         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16162         if (unlikely(__pyx_t_6 < 0)) {
16163           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
16164           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16165             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
16166             __Pyx_RaiseBufferFallbackError();
16167           } else {
16168             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
16169           }
16170           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
16171         }
16172         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
16173         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 488, __pyx_L1_error)
16174       }
16175       __pyx_t_16 = 0;
16176       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_1);
16177       __pyx_t_1 = 0;
16178 
16179       /* "GPy/models/state_space_cython.pyx":491
16180  *                                         full_matrices=False, compute_uv=True,
16181  *                                         overwrite_a=False, check_finite=False)
16182  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)             # <<<<<<<<<<<<<<
16183  *                 else:
16184  *                     U,S,Vh = self.Q_svd_dict[matrix_index]
16185  */
16186       __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
16187       __Pyx_GOTREF(__pyx_t_3);
16188       __Pyx_INCREF(((PyObject *)__pyx_v_U));
16189       __Pyx_GIVEREF(((PyObject *)__pyx_v_U));
16190       PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_U));
16191       __Pyx_INCREF(((PyObject *)__pyx_v_S));
16192       __Pyx_GIVEREF(((PyObject *)__pyx_v_S));
16193       PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_S));
16194       __Pyx_INCREF(((PyObject *)__pyx_v_Vh));
16195       __Pyx_GIVEREF(((PyObject *)__pyx_v_Vh));
16196       PyTuple_SET_ITEM(__pyx_t_3, 2, ((PyObject *)__pyx_v_Vh));
16197       if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
16198         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16199         __PYX_ERR(0, 491, __pyx_L1_error)
16200       }
16201       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error)
16202       __Pyx_GOTREF(__pyx_t_1);
16203       if (unlikely(PyDict_SetItem(__pyx_v_self->Q_svd_dict, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 491, __pyx_L1_error)
16204       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16205       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16206 
16207       /* "GPy/models/state_space_cython.pyx":487
16208  *                 square_root = self.Q_square_root_dict[matrix_index]
16209  *             else:
16210  *                 if matrix_index not in self.Q_svd_dict:             # <<<<<<<<<<<<<<
16211  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16212  *                                         full_matrices=False, compute_uv=True,
16213  */
16214       goto __pyx_L4;
16215     }
16216 
16217     /* "GPy/models/state_space_cython.pyx":493
16218  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16219  *                 else:
16220  *                     U,S,Vh = self.Q_svd_dict[matrix_index]             # <<<<<<<<<<<<<<
16221  *
16222  *                 square_root = U * np.sqrt(S)
16223  */
16224     /*else*/ {
16225       if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
16226         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16227         __PYX_ERR(0, 493, __pyx_L1_error)
16228       }
16229       __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
16230       __Pyx_GOTREF(__pyx_t_3);
16231       __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->Q_svd_dict, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
16232       __Pyx_GOTREF(__pyx_t_1);
16233       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16234       if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
16235         PyObject* sequence = __pyx_t_1;
16236         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16237         if (unlikely(size != 3)) {
16238           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
16239           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16240           __PYX_ERR(0, 493, __pyx_L1_error)
16241         }
16242         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16243         if (likely(PyTuple_CheckExact(sequence))) {
16244           __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
16245           __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
16246           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
16247         } else {
16248           __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
16249           __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
16250           __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
16251         }
16252         __Pyx_INCREF(__pyx_t_3);
16253         __Pyx_INCREF(__pyx_t_4);
16254         __Pyx_INCREF(__pyx_t_2);
16255         #else
16256         __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 493, __pyx_L1_error)
16257         __Pyx_GOTREF(__pyx_t_3);
16258         __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error)
16259         __Pyx_GOTREF(__pyx_t_4);
16260         __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
16261         __Pyx_GOTREF(__pyx_t_2);
16262         #endif
16263         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16264       } else {
16265         Py_ssize_t index = -1;
16266         __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 493, __pyx_L1_error)
16267         __Pyx_GOTREF(__pyx_t_5);
16268         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16269         __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext;
16270         index = 0; __pyx_t_3 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
16271         __Pyx_GOTREF(__pyx_t_3);
16272         index = 1; __pyx_t_4 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
16273         __Pyx_GOTREF(__pyx_t_4);
16274         index = 2; __pyx_t_2 = __pyx_t_13(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
16275         __Pyx_GOTREF(__pyx_t_2);
16276         if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_5), 3) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
16277         __pyx_t_13 = NULL;
16278         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16279         goto __pyx_L8_unpacking_done;
16280         __pyx_L7_unpacking_failed:;
16281         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16282         __pyx_t_13 = NULL;
16283         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
16284         __PYX_ERR(0, 493, __pyx_L1_error)
16285         __pyx_L8_unpacking_done:;
16286       }
16287       if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 493, __pyx_L1_error)
16288       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 493, __pyx_L1_error)
16289       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 493, __pyx_L1_error)
16290       __pyx_t_14 = ((PyArrayObject *)__pyx_t_3);
16291       {
16292         __Pyx_BufFmt_StackElem __pyx_stack[1];
16293         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
16294         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16295         if (unlikely(__pyx_t_6 < 0)) {
16296           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
16297           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16298             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
16299             __Pyx_RaiseBufferFallbackError();
16300           } else {
16301             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16302           }
16303           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
16304         }
16305         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
16306         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
16307       }
16308       __pyx_t_14 = 0;
16309       __pyx_v_U = ((PyArrayObject *)__pyx_t_3);
16310       __pyx_t_3 = 0;
16311       __pyx_t_15 = ((PyArrayObject *)__pyx_t_4);
16312       {
16313         __Pyx_BufFmt_StackElem __pyx_stack[1];
16314         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
16315         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16316         if (unlikely(__pyx_t_6 < 0)) {
16317           PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
16318           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16319             Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
16320             __Pyx_RaiseBufferFallbackError();
16321           } else {
16322             PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
16323           }
16324           __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
16325         }
16326         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
16327         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
16328       }
16329       __pyx_t_15 = 0;
16330       __pyx_v_S = ((PyArrayObject *)__pyx_t_4);
16331       __pyx_t_4 = 0;
16332       __pyx_t_16 = ((PyArrayObject *)__pyx_t_2);
16333       {
16334         __Pyx_BufFmt_StackElem __pyx_stack[1];
16335         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
16336         __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16337         if (unlikely(__pyx_t_6 < 0)) {
16338           PyErr_Fetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
16339           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16340             Py_XDECREF(__pyx_t_10); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12);
16341             __Pyx_RaiseBufferFallbackError();
16342           } else {
16343             PyErr_Restore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
16344           }
16345           __pyx_t_10 = __pyx_t_11 = __pyx_t_12 = 0;
16346         }
16347         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
16348         if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
16349       }
16350       __pyx_t_16 = 0;
16351       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_2);
16352       __pyx_t_2 = 0;
16353     }
16354     __pyx_L4:;
16355 
16356     /* "GPy/models/state_space_cython.pyx":495
16357  *                     U,S,Vh = self.Q_svd_dict[matrix_index]
16358  *
16359  *                 square_root = U * np.sqrt(S)             # <<<<<<<<<<<<<<
16360  *                 self.Q_square_root_dict[matrix_index] = square_root
16361  *
16362  */
16363     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
16364     __Pyx_GOTREF(__pyx_t_2);
16365     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
16366     __Pyx_GOTREF(__pyx_t_4);
16367     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16368     __pyx_t_2 = NULL;
16369     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
16370       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
16371       if (likely(__pyx_t_2)) {
16372         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
16373         __Pyx_INCREF(__pyx_t_2);
16374         __Pyx_INCREF(function);
16375         __Pyx_DECREF_SET(__pyx_t_4, function);
16376       }
16377     }
16378     __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_S));
16379     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
16380     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
16381     __Pyx_GOTREF(__pyx_t_1);
16382     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16383     __pyx_t_4 = PyNumber_Multiply(((PyObject *)__pyx_v_U), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
16384     __Pyx_GOTREF(__pyx_t_4);
16385     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16386     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 495, __pyx_L1_error)
16387     __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
16388     {
16389       __Pyx_BufFmt_StackElem __pyx_stack[1];
16390       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
16391       __pyx_t_6 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16392       if (unlikely(__pyx_t_6 < 0)) {
16393         PyErr_Fetch(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
16394         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer, (PyObject*)__pyx_v_square_root, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16395           Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_10);
16396           __Pyx_RaiseBufferFallbackError();
16397         } else {
16398           PyErr_Restore(__pyx_t_12, __pyx_t_11, __pyx_t_10);
16399         }
16400         __pyx_t_12 = __pyx_t_11 = __pyx_t_10 = 0;
16401       }
16402       __pyx_pybuffernd_square_root.diminfo[0].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_square_root.diminfo[0].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_square_root.diminfo[1].strides = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_square_root.diminfo[1].shape = __pyx_pybuffernd_square_root.rcbuffer->pybuffer.shape[1];
16403       if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
16404     }
16405     __pyx_t_9 = 0;
16406     __pyx_v_square_root = ((PyArrayObject *)__pyx_t_4);
16407     __pyx_t_4 = 0;
16408 
16409     /* "GPy/models/state_space_cython.pyx":496
16410  *
16411  *                 square_root = U * np.sqrt(S)
16412  *                 self.Q_square_root_dict[matrix_index] = square_root             # <<<<<<<<<<<<<<
16413  *
16414  *             return square_root
16415  */
16416     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_square_root_dict); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
16417     __Pyx_GOTREF(__pyx_t_4);
16418     if (unlikely(__Pyx_SetItemInt(__pyx_t_4, __pyx_v_matrix_index, ((PyObject *)__pyx_v_square_root), int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 496, __pyx_L1_error)
16419     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16420   }
16421   __pyx_L3:;
16422 
16423   /* "GPy/models/state_space_cython.pyx":498
16424  *                 self.Q_square_root_dict[matrix_index] = square_root
16425  *
16426  *             return square_root             # <<<<<<<<<<<<<<
16427  *
16428  *
16429  */
16430   __Pyx_XDECREF(__pyx_r);
16431   __Pyx_INCREF(((PyObject *)__pyx_v_square_root));
16432   __pyx_r = ((PyObject *)__pyx_v_square_root);
16433   goto __pyx_L0;
16434 
16435   /* "GPy/models/state_space_cython.pyx":471
16436  *
16437  *
16438  *         cpdef Q_srk(self, int k):             # <<<<<<<<<<<<<<
16439  *             """
16440  *             Square root of the noise matrix Q
16441  */
16442 
16443   /* function exit code */
16444   __pyx_L1_error:;
16445   __Pyx_XDECREF(__pyx_t_1);
16446   __Pyx_XDECREF(__pyx_t_2);
16447   __Pyx_XDECREF(__pyx_t_3);
16448   __Pyx_XDECREF(__pyx_t_4);
16449   __Pyx_XDECREF(__pyx_t_5);
16450   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16451     __Pyx_PyThreadState_declare
16452     __Pyx_PyThreadState_assign
16453     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16454     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
16455     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
16456     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
16457     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
16458   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16459   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
16460   __pyx_r = 0;
16461   goto __pyx_L2;
16462   __pyx_L0:;
16463   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
16464   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
16465   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
16466   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_square_root.rcbuffer->pybuffer);
16467   __pyx_L2:;
16468   __Pyx_XDECREF((PyObject *)__pyx_v_square_root);
16469   __Pyx_XDECREF((PyObject *)__pyx_v_U);
16470   __Pyx_XDECREF((PyObject *)__pyx_v_S);
16471   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
16472   __Pyx_XGIVEREF(__pyx_r);
16473   __Pyx_RefNannyFinishContext();
16474   return __pyx_r;
16475 }
16476 
16477 /* Python wrapper */
16478 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k); /*proto*/
16479 static char __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk[] = "\n            Square root of the noise matrix Q\n            ";
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk(PyObject * __pyx_v_self,PyObject * __pyx_arg_k)16480 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk(PyObject *__pyx_v_self, PyObject *__pyx_arg_k) {
16481   int __pyx_v_k;
16482   int __pyx_lineno = 0;
16483   const char *__pyx_filename = NULL;
16484   int __pyx_clineno = 0;
16485   PyObject *__pyx_r = 0;
16486   __Pyx_RefNannyDeclarations
16487   __Pyx_RefNannySetupContext("Q_srk (wrapper)", 0);
16488   assert(__pyx_arg_k); {
16489     __pyx_v_k = __Pyx_PyInt_As_int(__pyx_arg_k); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L3_error)
16490   }
16491   goto __pyx_L4_argument_unpacking_done;
16492   __pyx_L3_error:;
16493   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
16494   __Pyx_RefNannyFinishContext();
16495   return NULL;
16496   __pyx_L4_argument_unpacking_done:;
16497   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), ((int)__pyx_v_k));
16498 
16499   /* function exit code */
16500   __Pyx_RefNannyFinishContext();
16501   return __pyx_r;
16502 }
16503 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k)16504 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k) {
16505   PyObject *__pyx_r = NULL;
16506   __Pyx_RefNannyDeclarations
16507   PyObject *__pyx_t_1 = NULL;
16508   int __pyx_lineno = 0;
16509   const char *__pyx_filename = NULL;
16510   int __pyx_clineno = 0;
16511   __Pyx_RefNannySetupContext("Q_srk", 0);
16512   __Pyx_XDECREF(__pyx_r);
16513   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_srk(__pyx_v_self, __pyx_v_k, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
16514   __Pyx_GOTREF(__pyx_t_1);
16515   __pyx_r = __pyx_t_1;
16516   __pyx_t_1 = 0;
16517   goto __pyx_L0;
16518 
16519   /* function exit code */
16520   __pyx_L1_error:;
16521   __Pyx_XDECREF(__pyx_t_1);
16522   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_srk", __pyx_clineno, __pyx_lineno, __pyx_filename);
16523   __pyx_r = NULL;
16524   __pyx_L0:;
16525   __Pyx_XGIVEREF(__pyx_r);
16526   __Pyx_RefNannyFinishContext();
16527   return __pyx_r;
16528 }
16529 
16530 /* "GPy/models/state_space_cython.pyx":501
16531  *
16532  *
16533  *         cpdef Q_inverse(self, int k, float jitter=0.0):             # <<<<<<<<<<<<<<
16534  *             """
16535  *             Square root of the noise matrix Q
16536  */
16537 
16538 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,int __pyx_skip_dispatch,struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse * __pyx_optional_args)16539 static PyObject *__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse *__pyx_optional_args) {
16540   float __pyx_v_jitter = ((float)0.0);
16541   int __pyx_v_matrix_index;
16542   PyArrayObject *__pyx_v_U = 0;
16543   PyArrayObject *__pyx_v_S = 0;
16544   PyArrayObject *__pyx_v_Vh = 0;
16545   PyObject *__pyx_v_Q_inverse = NULL;
16546   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
16547   __Pyx_Buffer __pyx_pybuffer_S;
16548   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
16549   __Pyx_Buffer __pyx_pybuffer_U;
16550   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
16551   __Pyx_Buffer __pyx_pybuffer_Vh;
16552   PyObject *__pyx_r = NULL;
16553   __Pyx_RefNannyDeclarations
16554   PyObject *__pyx_t_1 = NULL;
16555   PyObject *__pyx_t_2 = NULL;
16556   PyObject *__pyx_t_3 = NULL;
16557   PyObject *__pyx_t_4 = NULL;
16558   PyObject *__pyx_t_5 = NULL;
16559   PyObject *__pyx_t_6 = NULL;
16560   int __pyx_t_7;
16561   PyObject *__pyx_t_8 = NULL;
16562   int __pyx_t_9;
16563   int __pyx_t_10;
16564   PyObject *(*__pyx_t_11)(PyObject *);
16565   PyArrayObject *__pyx_t_12 = NULL;
16566   PyObject *__pyx_t_13 = NULL;
16567   PyObject *__pyx_t_14 = NULL;
16568   PyObject *__pyx_t_15 = NULL;
16569   PyArrayObject *__pyx_t_16 = NULL;
16570   PyArrayObject *__pyx_t_17 = NULL;
16571   int __pyx_lineno = 0;
16572   const char *__pyx_filename = NULL;
16573   int __pyx_clineno = 0;
16574   __Pyx_RefNannySetupContext("Q_inverse", 0);
16575   if (__pyx_optional_args) {
16576     if (__pyx_optional_args->__pyx_n > 0) {
16577       __pyx_v_jitter = __pyx_optional_args->jitter;
16578     }
16579   }
16580   __pyx_pybuffer_U.pybuffer.buf = NULL;
16581   __pyx_pybuffer_U.refcount = 0;
16582   __pyx_pybuffernd_U.data = NULL;
16583   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
16584   __pyx_pybuffer_S.pybuffer.buf = NULL;
16585   __pyx_pybuffer_S.refcount = 0;
16586   __pyx_pybuffernd_S.data = NULL;
16587   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
16588   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
16589   __pyx_pybuffer_Vh.refcount = 0;
16590   __pyx_pybuffernd_Vh.data = NULL;
16591   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
16592   /* Check if called by wrapper */
16593   if (unlikely(__pyx_skip_dispatch)) ;
16594   /* Check if overridden in Python */
16595   else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
16596     #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16597     static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
16598     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
16599       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
16600       #endif
16601       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_inverse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
16602       __Pyx_GOTREF(__pyx_t_1);
16603       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse)) {
16604         __Pyx_XDECREF(__pyx_r);
16605         __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
16606         __Pyx_GOTREF(__pyx_t_3);
16607         __pyx_t_4 = PyFloat_FromDouble(__pyx_v_jitter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
16608         __Pyx_GOTREF(__pyx_t_4);
16609         __Pyx_INCREF(__pyx_t_1);
16610         __pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
16611         __pyx_t_7 = 0;
16612         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
16613           __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
16614           if (likely(__pyx_t_6)) {
16615             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
16616             __Pyx_INCREF(__pyx_t_6);
16617             __Pyx_INCREF(function);
16618             __Pyx_DECREF_SET(__pyx_t_5, function);
16619             __pyx_t_7 = 1;
16620           }
16621         }
16622         #if CYTHON_FAST_PYCALL
16623         if (PyFunction_Check(__pyx_t_5)) {
16624           PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
16625           __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
16626           __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16627           __Pyx_GOTREF(__pyx_t_2);
16628           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16629           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16630         } else
16631         #endif
16632         #if CYTHON_FAST_PYCCALL
16633         if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
16634           PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
16635           __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
16636           __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
16637           __Pyx_GOTREF(__pyx_t_2);
16638           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16639           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16640         } else
16641         #endif
16642         {
16643           __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 501, __pyx_L1_error)
16644           __Pyx_GOTREF(__pyx_t_8);
16645           if (__pyx_t_6) {
16646             __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
16647           }
16648           __Pyx_GIVEREF(__pyx_t_3);
16649           PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
16650           __Pyx_GIVEREF(__pyx_t_4);
16651           PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
16652           __pyx_t_3 = 0;
16653           __pyx_t_4 = 0;
16654           __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
16655           __Pyx_GOTREF(__pyx_t_2);
16656           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16657         }
16658         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16659         __pyx_r = __pyx_t_2;
16660         __pyx_t_2 = 0;
16661         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16662         goto __pyx_L0;
16663       }
16664       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16665       __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
16666       __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
16667       if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
16668         __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
16669       }
16670       #endif
16671       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16672       #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
16673     }
16674     #endif
16675   }
16676 
16677   /* "GPy/models/state_space_cython.pyx":506
16678  *             """
16679  *
16680  *             cdef int matrix_index = <int>self.reconstruct_indices[k]             # <<<<<<<<<<<<<<
16681  *             cdef np.ndarray[DTYPE_t, ndim=2] square_root
16682  *
16683  */
16684   __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self->reconstruct_indices), __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
16685   __Pyx_GOTREF(__pyx_t_1);
16686   __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L1_error)
16687   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16688   __pyx_v_matrix_index = ((int)__pyx_t_7);
16689 
16690   /* "GPy/models/state_space_cython.pyx":514
16691  *
16692  *
16693  *             if matrix_index in self.Q_inverse_dict:             # <<<<<<<<<<<<<<
16694  *                 Q_inverse = self.Q_inverse_dict[matrix_index]
16695  *             else:
16696  */
16697   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error)
16698   __Pyx_GOTREF(__pyx_t_1);
16699   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_inverse_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
16700   __Pyx_GOTREF(__pyx_t_2);
16701   __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 514, __pyx_L1_error)
16702   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16703   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16704   __pyx_t_10 = (__pyx_t_9 != 0);
16705   if (__pyx_t_10) {
16706 
16707     /* "GPy/models/state_space_cython.pyx":515
16708  *
16709  *             if matrix_index in self.Q_inverse_dict:
16710  *                 Q_inverse = self.Q_inverse_dict[matrix_index]             # <<<<<<<<<<<<<<
16711  *             else:
16712  *                 if matrix_index not in self.Q_svd_dict:
16713  */
16714     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_inverse_dict); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
16715     __Pyx_GOTREF(__pyx_t_2);
16716     __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, __pyx_v_matrix_index, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
16717     __Pyx_GOTREF(__pyx_t_1);
16718     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16719     __pyx_v_Q_inverse = __pyx_t_1;
16720     __pyx_t_1 = 0;
16721 
16722     /* "GPy/models/state_space_cython.pyx":514
16723  *
16724  *
16725  *             if matrix_index in self.Q_inverse_dict:             # <<<<<<<<<<<<<<
16726  *                 Q_inverse = self.Q_inverse_dict[matrix_index]
16727  *             else:
16728  */
16729     goto __pyx_L3;
16730   }
16731 
16732   /* "GPy/models/state_space_cython.pyx":517
16733  *                 Q_inverse = self.Q_inverse_dict[matrix_index]
16734  *             else:
16735  *                 if matrix_index not in self.Q_svd_dict:             # <<<<<<<<<<<<<<
16736  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16737  *                                         full_matrices=False, compute_uv=True,
16738  */
16739   /*else*/ {
16740     __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
16741     __Pyx_GOTREF(__pyx_t_1);
16742     if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
16743       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
16744       __PYX_ERR(0, 517, __pyx_L1_error)
16745     }
16746     __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_t_1, __pyx_v_self->Q_svd_dict, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 517, __pyx_L1_error)
16747     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16748     __pyx_t_9 = (__pyx_t_10 != 0);
16749     if (__pyx_t_9) {
16750 
16751       /* "GPy/models/state_space_cython.pyx":518
16752  *             else:
16753  *                 if matrix_index not in self.Q_svd_dict:
16754  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],             # <<<<<<<<<<<<<<
16755  *                                         full_matrices=False, compute_uv=True,
16756  *                                         overwrite_a=False, check_finite=False)
16757  */
16758       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
16759       __Pyx_GOTREF(__pyx_t_1);
16760       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_linalg); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
16761       __Pyx_GOTREF(__pyx_t_2);
16762       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16763       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
16764       __Pyx_GOTREF(__pyx_t_1);
16765       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16766       __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
16767       __Pyx_GOTREF(__pyx_t_2);
16768       __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error)
16769       __Pyx_GOTREF(__pyx_t_5);
16770       __Pyx_INCREF(__pyx_slice__10);
16771       __Pyx_GIVEREF(__pyx_slice__10);
16772       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__10);
16773       __Pyx_INCREF(__pyx_slice__10);
16774       __Pyx_GIVEREF(__pyx_slice__10);
16775       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__10);
16776       __Pyx_GIVEREF(__pyx_t_2);
16777       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
16778       __pyx_t_2 = 0;
16779       __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self->Qs), __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
16780       __Pyx_GOTREF(__pyx_t_2);
16781       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16782       __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error)
16783       __Pyx_GOTREF(__pyx_t_5);
16784       __Pyx_GIVEREF(__pyx_t_2);
16785       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
16786       __pyx_t_2 = 0;
16787 
16788       /* "GPy/models/state_space_cython.pyx":519
16789  *                 if matrix_index not in self.Q_svd_dict:
16790  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16791  *                                         full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
16792  *                                         overwrite_a=False, check_finite=False)
16793  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16794  */
16795       __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error)
16796       __Pyx_GOTREF(__pyx_t_2);
16797       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
16798       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
16799 
16800       /* "GPy/models/state_space_cython.pyx":520
16801  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16802  *                                         full_matrices=False, compute_uv=True,
16803  *                                         overwrite_a=False, check_finite=False)             # <<<<<<<<<<<<<<
16804  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16805  *                 else:
16806  */
16807       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
16808       if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_check_finite, Py_False) < 0) __PYX_ERR(0, 519, __pyx_L1_error)
16809 
16810       /* "GPy/models/state_space_cython.pyx":518
16811  *             else:
16812  *                 if matrix_index not in self.Q_svd_dict:
16813  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],             # <<<<<<<<<<<<<<
16814  *                                         full_matrices=False, compute_uv=True,
16815  *                                         overwrite_a=False, check_finite=False)
16816  */
16817       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
16818       __Pyx_GOTREF(__pyx_t_8);
16819       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16820       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
16821       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
16822       if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
16823         PyObject* sequence = __pyx_t_8;
16824         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
16825         if (unlikely(size != 3)) {
16826           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
16827           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
16828           __PYX_ERR(0, 518, __pyx_L1_error)
16829         }
16830         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16831         if (likely(PyTuple_CheckExact(sequence))) {
16832           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
16833           __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
16834           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 2);
16835         } else {
16836           __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
16837           __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
16838           __pyx_t_1 = PyList_GET_ITEM(sequence, 2);
16839         }
16840         __Pyx_INCREF(__pyx_t_2);
16841         __Pyx_INCREF(__pyx_t_5);
16842         __Pyx_INCREF(__pyx_t_1);
16843         #else
16844         __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
16845         __Pyx_GOTREF(__pyx_t_2);
16846         __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 518, __pyx_L1_error)
16847         __Pyx_GOTREF(__pyx_t_5);
16848         __pyx_t_1 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
16849         __Pyx_GOTREF(__pyx_t_1);
16850         #endif
16851         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16852       } else {
16853         Py_ssize_t index = -1;
16854         __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 518, __pyx_L1_error)
16855         __Pyx_GOTREF(__pyx_t_4);
16856         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16857         __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
16858         index = 0; __pyx_t_2 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L5_unpacking_failed;
16859         __Pyx_GOTREF(__pyx_t_2);
16860         index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
16861         __Pyx_GOTREF(__pyx_t_5);
16862         index = 2; __pyx_t_1 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
16863         __Pyx_GOTREF(__pyx_t_1);
16864         if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 3) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
16865         __pyx_t_11 = NULL;
16866         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16867         goto __pyx_L6_unpacking_done;
16868         __pyx_L5_unpacking_failed:;
16869         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16870         __pyx_t_11 = NULL;
16871         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
16872         __PYX_ERR(0, 518, __pyx_L1_error)
16873         __pyx_L6_unpacking_done:;
16874       }
16875       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 518, __pyx_L1_error)
16876       if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 518, __pyx_L1_error)
16877       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 518, __pyx_L1_error)
16878       __pyx_t_12 = ((PyArrayObject *)__pyx_t_2);
16879       {
16880         __Pyx_BufFmt_StackElem __pyx_stack[1];
16881         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
16882         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16883         if (unlikely(__pyx_t_7 < 0)) {
16884           PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
16885           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16886             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
16887             __Pyx_RaiseBufferFallbackError();
16888           } else {
16889             PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
16890           }
16891           __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
16892         }
16893         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
16894         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
16895       }
16896       __pyx_t_12 = 0;
16897       __pyx_v_U = ((PyArrayObject *)__pyx_t_2);
16898       __pyx_t_2 = 0;
16899       __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
16900       {
16901         __Pyx_BufFmt_StackElem __pyx_stack[1];
16902         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
16903         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
16904         if (unlikely(__pyx_t_7 < 0)) {
16905           PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
16906           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
16907             Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
16908             __Pyx_RaiseBufferFallbackError();
16909           } else {
16910             PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
16911           }
16912           __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
16913         }
16914         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
16915         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
16916       }
16917       __pyx_t_16 = 0;
16918       __pyx_v_S = ((PyArrayObject *)__pyx_t_5);
16919       __pyx_t_5 = 0;
16920       __pyx_t_17 = ((PyArrayObject *)__pyx_t_1);
16921       {
16922         __Pyx_BufFmt_StackElem __pyx_stack[1];
16923         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
16924         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
16925         if (unlikely(__pyx_t_7 < 0)) {
16926           PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
16927           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
16928             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
16929             __Pyx_RaiseBufferFallbackError();
16930           } else {
16931             PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
16932           }
16933           __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
16934         }
16935         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
16936         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
16937       }
16938       __pyx_t_17 = 0;
16939       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_1);
16940       __pyx_t_1 = 0;
16941 
16942       /* "GPy/models/state_space_cython.pyx":521
16943  *                                         full_matrices=False, compute_uv=True,
16944  *                                         overwrite_a=False, check_finite=False)
16945  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)             # <<<<<<<<<<<<<<
16946  *                 else:
16947  *                     U,S,Vh = self.Q_svd_dict[matrix_index]
16948  */
16949       __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 521, __pyx_L1_error)
16950       __Pyx_GOTREF(__pyx_t_8);
16951       __Pyx_INCREF(((PyObject *)__pyx_v_U));
16952       __Pyx_GIVEREF(((PyObject *)__pyx_v_U));
16953       PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_v_U));
16954       __Pyx_INCREF(((PyObject *)__pyx_v_S));
16955       __Pyx_GIVEREF(((PyObject *)__pyx_v_S));
16956       PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_v_S));
16957       __Pyx_INCREF(((PyObject *)__pyx_v_Vh));
16958       __Pyx_GIVEREF(((PyObject *)__pyx_v_Vh));
16959       PyTuple_SET_ITEM(__pyx_t_8, 2, ((PyObject *)__pyx_v_Vh));
16960       if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
16961         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16962         __PYX_ERR(0, 521, __pyx_L1_error)
16963       }
16964       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
16965       __Pyx_GOTREF(__pyx_t_1);
16966       if (unlikely(PyDict_SetItem(__pyx_v_self->Q_svd_dict, __pyx_t_1, __pyx_t_8) < 0)) __PYX_ERR(0, 521, __pyx_L1_error)
16967       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16968       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16969 
16970       /* "GPy/models/state_space_cython.pyx":517
16971  *                 Q_inverse = self.Q_inverse_dict[matrix_index]
16972  *             else:
16973  *                 if matrix_index not in self.Q_svd_dict:             # <<<<<<<<<<<<<<
16974  *                     U,S,Vh = sp.linalg.svd( self.Qs[:,:, matrix_index],
16975  *                                         full_matrices=False, compute_uv=True,
16976  */
16977       goto __pyx_L4;
16978     }
16979 
16980     /* "GPy/models/state_space_cython.pyx":523
16981  *                     self.Q_svd_dict[matrix_index] = (U,S,Vh)
16982  *                 else:
16983  *                     U,S,Vh = self.Q_svd_dict[matrix_index]             # <<<<<<<<<<<<<<
16984  *
16985  *                 Q_inverse = Q_inverse = np.dot( Vh.T * ( 1.0/(S + jitter)) , U.T )
16986  */
16987     /*else*/ {
16988       if (unlikely(__pyx_v_self->Q_svd_dict == Py_None)) {
16989         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
16990         __PYX_ERR(0, 523, __pyx_L1_error)
16991       }
16992       __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_matrix_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
16993       __Pyx_GOTREF(__pyx_t_8);
16994       __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_self->Q_svd_dict, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
16995       __Pyx_GOTREF(__pyx_t_1);
16996       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
16997       if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
16998         PyObject* sequence = __pyx_t_1;
16999         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
17000         if (unlikely(size != 3)) {
17001           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
17002           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
17003           __PYX_ERR(0, 523, __pyx_L1_error)
17004         }
17005         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17006         if (likely(PyTuple_CheckExact(sequence))) {
17007           __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
17008           __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
17009           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
17010         } else {
17011           __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
17012           __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
17013           __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
17014         }
17015         __Pyx_INCREF(__pyx_t_8);
17016         __Pyx_INCREF(__pyx_t_5);
17017         __Pyx_INCREF(__pyx_t_2);
17018         #else
17019         __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
17020         __Pyx_GOTREF(__pyx_t_8);
17021         __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
17022         __Pyx_GOTREF(__pyx_t_5);
17023         __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
17024         __Pyx_GOTREF(__pyx_t_2);
17025         #endif
17026         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17027       } else {
17028         Py_ssize_t index = -1;
17029         __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
17030         __Pyx_GOTREF(__pyx_t_4);
17031         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17032         __pyx_t_11 = Py_TYPE(__pyx_t_4)->tp_iternext;
17033         index = 0; __pyx_t_8 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_8)) goto __pyx_L7_unpacking_failed;
17034         __Pyx_GOTREF(__pyx_t_8);
17035         index = 1; __pyx_t_5 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L7_unpacking_failed;
17036         __Pyx_GOTREF(__pyx_t_5);
17037         index = 2; __pyx_t_2 = __pyx_t_11(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
17038         __Pyx_GOTREF(__pyx_t_2);
17039         if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_4), 3) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
17040         __pyx_t_11 = NULL;
17041         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17042         goto __pyx_L8_unpacking_done;
17043         __pyx_L7_unpacking_failed:;
17044         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17045         __pyx_t_11 = NULL;
17046         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
17047         __PYX_ERR(0, 523, __pyx_L1_error)
17048         __pyx_L8_unpacking_done:;
17049       }
17050       if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 523, __pyx_L1_error)
17051       if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 523, __pyx_L1_error)
17052       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 523, __pyx_L1_error)
17053       __pyx_t_12 = ((PyArrayObject *)__pyx_t_8);
17054       {
17055         __Pyx_BufFmt_StackElem __pyx_stack[1];
17056         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
17057         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_12, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
17058         if (unlikely(__pyx_t_7 < 0)) {
17059           PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
17060           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
17061             Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
17062             __Pyx_RaiseBufferFallbackError();
17063           } else {
17064             PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
17065           }
17066           __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
17067         }
17068         __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
17069         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
17070       }
17071       __pyx_t_12 = 0;
17072       __pyx_v_U = ((PyArrayObject *)__pyx_t_8);
17073       __pyx_t_8 = 0;
17074       __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
17075       {
17076         __Pyx_BufFmt_StackElem __pyx_stack[1];
17077         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
17078         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
17079         if (unlikely(__pyx_t_7 < 0)) {
17080           PyErr_Fetch(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
17081           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
17082             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_15);
17083             __Pyx_RaiseBufferFallbackError();
17084           } else {
17085             PyErr_Restore(__pyx_t_13, __pyx_t_14, __pyx_t_15);
17086           }
17087           __pyx_t_13 = __pyx_t_14 = __pyx_t_15 = 0;
17088         }
17089         __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
17090         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
17091       }
17092       __pyx_t_16 = 0;
17093       __pyx_v_S = ((PyArrayObject *)__pyx_t_5);
17094       __pyx_t_5 = 0;
17095       __pyx_t_17 = ((PyArrayObject *)__pyx_t_2);
17096       {
17097         __Pyx_BufFmt_StackElem __pyx_stack[1];
17098         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
17099         __pyx_t_7 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
17100         if (unlikely(__pyx_t_7 < 0)) {
17101           PyErr_Fetch(&__pyx_t_15, &__pyx_t_14, &__pyx_t_13);
17102           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
17103             Py_XDECREF(__pyx_t_15); Py_XDECREF(__pyx_t_14); Py_XDECREF(__pyx_t_13);
17104             __Pyx_RaiseBufferFallbackError();
17105           } else {
17106             PyErr_Restore(__pyx_t_15, __pyx_t_14, __pyx_t_13);
17107           }
17108           __pyx_t_15 = __pyx_t_14 = __pyx_t_13 = 0;
17109         }
17110         __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
17111         if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 523, __pyx_L1_error)
17112       }
17113       __pyx_t_17 = 0;
17114       __pyx_v_Vh = ((PyArrayObject *)__pyx_t_2);
17115       __pyx_t_2 = 0;
17116     }
17117     __pyx_L4:;
17118 
17119     /* "GPy/models/state_space_cython.pyx":525
17120  *                     U,S,Vh = self.Q_svd_dict[matrix_index]
17121  *
17122  *                 Q_inverse = Q_inverse = np.dot( Vh.T * ( 1.0/(S + jitter)) , U.T )             # <<<<<<<<<<<<<<
17123  *                 self.Q_inverse_dict[matrix_index] = Q_inverse
17124  *
17125  */
17126     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
17127     __Pyx_GOTREF(__pyx_t_2);
17128     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 525, __pyx_L1_error)
17129     __Pyx_GOTREF(__pyx_t_5);
17130     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17131     __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Vh), __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
17132     __Pyx_GOTREF(__pyx_t_2);
17133     __pyx_t_8 = PyFloat_FromDouble(__pyx_v_jitter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
17134     __Pyx_GOTREF(__pyx_t_8);
17135     __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_v_S), __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
17136     __Pyx_GOTREF(__pyx_t_4);
17137     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17138     __pyx_t_8 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_4, 1.0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
17139     __Pyx_GOTREF(__pyx_t_8);
17140     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17141     __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 525, __pyx_L1_error)
17142     __Pyx_GOTREF(__pyx_t_4);
17143     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17144     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17145     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U), __pyx_n_s_T); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
17146     __Pyx_GOTREF(__pyx_t_8);
17147     __pyx_t_2 = NULL;
17148     __pyx_t_7 = 0;
17149     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
17150       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
17151       if (likely(__pyx_t_2)) {
17152         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
17153         __Pyx_INCREF(__pyx_t_2);
17154         __Pyx_INCREF(function);
17155         __Pyx_DECREF_SET(__pyx_t_5, function);
17156         __pyx_t_7 = 1;
17157       }
17158     }
17159     #if CYTHON_FAST_PYCALL
17160     if (PyFunction_Check(__pyx_t_5)) {
17161       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_8};
17162       __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
17163       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17164       __Pyx_GOTREF(__pyx_t_1);
17165       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17166       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17167     } else
17168     #endif
17169     #if CYTHON_FAST_PYCCALL
17170     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
17171       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_8};
17172       __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
17173       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
17174       __Pyx_GOTREF(__pyx_t_1);
17175       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17176       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
17177     } else
17178     #endif
17179     {
17180       __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error)
17181       __Pyx_GOTREF(__pyx_t_3);
17182       if (__pyx_t_2) {
17183         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
17184       }
17185       __Pyx_GIVEREF(__pyx_t_4);
17186       PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_t_4);
17187       __Pyx_GIVEREF(__pyx_t_8);
17188       PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_8);
17189       __pyx_t_4 = 0;
17190       __pyx_t_8 = 0;
17191       __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
17192       __Pyx_GOTREF(__pyx_t_1);
17193       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17194     }
17195     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
17196     __Pyx_INCREF(__pyx_t_1);
17197     __pyx_v_Q_inverse = __pyx_t_1;
17198     __Pyx_INCREF(__pyx_t_1);
17199     __Pyx_DECREF_SET(__pyx_v_Q_inverse, __pyx_t_1);
17200     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17201 
17202     /* "GPy/models/state_space_cython.pyx":526
17203  *
17204  *                 Q_inverse = Q_inverse = np.dot( Vh.T * ( 1.0/(S + jitter)) , U.T )
17205  *                 self.Q_inverse_dict[matrix_index] = Q_inverse             # <<<<<<<<<<<<<<
17206  *
17207  *             return Q_inverse
17208  */
17209     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_Q_inverse_dict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
17210     __Pyx_GOTREF(__pyx_t_1);
17211     if (unlikely(__Pyx_SetItemInt(__pyx_t_1, __pyx_v_matrix_index, __pyx_v_Q_inverse, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 526, __pyx_L1_error)
17212     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17213   }
17214   __pyx_L3:;
17215 
17216   /* "GPy/models/state_space_cython.pyx":528
17217  *                 self.Q_inverse_dict[matrix_index] = Q_inverse
17218  *
17219  *             return Q_inverse             # <<<<<<<<<<<<<<
17220  *
17221  * #        def return_last(self):
17222  */
17223   __Pyx_XDECREF(__pyx_r);
17224   __Pyx_INCREF(__pyx_v_Q_inverse);
17225   __pyx_r = __pyx_v_Q_inverse;
17226   goto __pyx_L0;
17227 
17228   /* "GPy/models/state_space_cython.pyx":501
17229  *
17230  *
17231  *         cpdef Q_inverse(self, int k, float jitter=0.0):             # <<<<<<<<<<<<<<
17232  *             """
17233  *             Square root of the noise matrix Q
17234  */
17235 
17236   /* function exit code */
17237   __pyx_L1_error:;
17238   __Pyx_XDECREF(__pyx_t_1);
17239   __Pyx_XDECREF(__pyx_t_2);
17240   __Pyx_XDECREF(__pyx_t_3);
17241   __Pyx_XDECREF(__pyx_t_4);
17242   __Pyx_XDECREF(__pyx_t_5);
17243   __Pyx_XDECREF(__pyx_t_6);
17244   __Pyx_XDECREF(__pyx_t_8);
17245   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17246     __Pyx_PyThreadState_declare
17247     __Pyx_PyThreadState_assign
17248     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17249     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
17250     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
17251     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
17252   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17253   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_inverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
17254   __pyx_r = 0;
17255   goto __pyx_L2;
17256   __pyx_L0:;
17257   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
17258   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
17259   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
17260   __pyx_L2:;
17261   __Pyx_XDECREF((PyObject *)__pyx_v_U);
17262   __Pyx_XDECREF((PyObject *)__pyx_v_S);
17263   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
17264   __Pyx_XDECREF(__pyx_v_Q_inverse);
17265   __Pyx_XGIVEREF(__pyx_r);
17266   __Pyx_RefNannyFinishContext();
17267   return __pyx_r;
17268 }
17269 
17270 /* Python wrapper */
17271 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17272 static char __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse[] = "\n            Square root of the noise matrix Q\n            ";
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17273 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17274   int __pyx_v_k;
17275   float __pyx_v_jitter;
17276   int __pyx_lineno = 0;
17277   const char *__pyx_filename = NULL;
17278   int __pyx_clineno = 0;
17279   PyObject *__pyx_r = 0;
17280   __Pyx_RefNannyDeclarations
17281   __Pyx_RefNannySetupContext("Q_inverse (wrapper)", 0);
17282   {
17283     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_jitter,0};
17284     PyObject* values[2] = {0,0};
17285     if (unlikely(__pyx_kwds)) {
17286       Py_ssize_t kw_args;
17287       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17288       switch (pos_args) {
17289         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17290         CYTHON_FALLTHROUGH;
17291         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17292         CYTHON_FALLTHROUGH;
17293         case  0: break;
17294         default: goto __pyx_L5_argtuple_error;
17295       }
17296       kw_args = PyDict_Size(__pyx_kwds);
17297       switch (pos_args) {
17298         case  0:
17299         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
17300         else goto __pyx_L5_argtuple_error;
17301         CYTHON_FALLTHROUGH;
17302         case  1:
17303         if (kw_args > 0) {
17304           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_jitter);
17305           if (value) { values[1] = value; kw_args--; }
17306         }
17307       }
17308       if (unlikely(kw_args > 0)) {
17309         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Q_inverse") < 0)) __PYX_ERR(0, 501, __pyx_L3_error)
17310       }
17311     } else {
17312       switch (PyTuple_GET_SIZE(__pyx_args)) {
17313         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17314         CYTHON_FALLTHROUGH;
17315         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17316         break;
17317         default: goto __pyx_L5_argtuple_error;
17318       }
17319     }
17320     __pyx_v_k = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_k == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error)
17321     if (values[1]) {
17322       __pyx_v_jitter = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_jitter == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L3_error)
17323     } else {
17324       __pyx_v_jitter = ((float)0.0);
17325     }
17326   }
17327   goto __pyx_L4_argument_unpacking_done;
17328   __pyx_L5_argtuple_error:;
17329   __Pyx_RaiseArgtupleInvalid("Q_inverse", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 501, __pyx_L3_error)
17330   __pyx_L3_error:;
17331   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_inverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
17332   __Pyx_RefNannyFinishContext();
17333   return NULL;
17334   __pyx_L4_argument_unpacking_done:;
17335   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), __pyx_v_k, __pyx_v_jitter);
17336 
17337   /* function exit code */
17338   __Pyx_RefNannyFinishContext();
17339   return __pyx_r;
17340 }
17341 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,int __pyx_v_k,float __pyx_v_jitter)17342 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, int __pyx_v_k, float __pyx_v_jitter) {
17343   PyObject *__pyx_r = NULL;
17344   __Pyx_RefNannyDeclarations
17345   PyObject *__pyx_t_1 = NULL;
17346   struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse __pyx_t_2;
17347   int __pyx_lineno = 0;
17348   const char *__pyx_filename = NULL;
17349   int __pyx_clineno = 0;
17350   __Pyx_RefNannySetupContext("Q_inverse", 0);
17351   __Pyx_XDECREF(__pyx_r);
17352   __pyx_t_2.__pyx_n = 1;
17353   __pyx_t_2.jitter = __pyx_v_jitter;
17354   __pyx_t_1 = __pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython->Q_inverse(__pyx_v_self, __pyx_v_k, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
17355   __Pyx_GOTREF(__pyx_t_1);
17356   __pyx_r = __pyx_t_1;
17357   __pyx_t_1 = 0;
17358   goto __pyx_L0;
17359 
17360   /* function exit code */
17361   __pyx_L1_error:;
17362   __Pyx_XDECREF(__pyx_t_1);
17363   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.Q_inverse", __pyx_clineno, __pyx_lineno, __pyx_filename);
17364   __pyx_r = NULL;
17365   __pyx_L0:;
17366   __Pyx_XGIVEREF(__pyx_r);
17367   __Pyx_RefNannyFinishContext();
17368   return __pyx_r;
17369 }
17370 
17371 /* "(tree fragment)":1
17372  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17373  *     cdef tuple state
17374  *     cdef object _dict
17375  */
17376 
17377 /* Python wrapper */
17378 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_19__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)17379 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_19__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17380   PyObject *__pyx_r = 0;
17381   __Pyx_RefNannyDeclarations
17382   __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17383   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_18__reduce_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self));
17384 
17385   /* function exit code */
17386   __Pyx_RefNannyFinishContext();
17387   return __pyx_r;
17388 }
17389 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_18__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self)17390 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_18__reduce_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self) {
17391   PyObject *__pyx_v_state = 0;
17392   PyObject *__pyx_v__dict = 0;
17393   int __pyx_v_use_setstate;
17394   PyObject *__pyx_r = NULL;
17395   __Pyx_RefNannyDeclarations
17396   PyObject *__pyx_t_1 = NULL;
17397   PyObject *__pyx_t_2 = NULL;
17398   PyObject *__pyx_t_3 = NULL;
17399   PyObject *__pyx_t_4 = NULL;
17400   int __pyx_t_5;
17401   int __pyx_t_6;
17402   int __pyx_t_7;
17403   int __pyx_lineno = 0;
17404   const char *__pyx_filename = NULL;
17405   int __pyx_clineno = 0;
17406   __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17407 
17408   /* "(tree fragment)":5
17409  *     cdef object _dict
17410  *     cdef bint use_setstate
17411  *     state = (self.As, self.Q, self.Q_square_root, self.Q_svd_dict, self.Q_time_var_index, self.Qs, self.dAs, self.dQ, self.dQs, self.index, self.last_k, self.reconstruct_indices, self.svd_each_time)             # <<<<<<<<<<<<<<
17412  *     _dict = getattr(self, '__dict__', None)
17413  *     if _dict is not None:
17414  */
17415   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->__pyx_base.Q_time_var_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
17416   __Pyx_GOTREF(__pyx_t_1);
17417   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->last_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
17418   __Pyx_GOTREF(__pyx_t_2);
17419   __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->__pyx_base.svd_each_time); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
17420   __Pyx_GOTREF(__pyx_t_3);
17421   __pyx_t_4 = PyTuple_New(13); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
17422   __Pyx_GOTREF(__pyx_t_4);
17423   __Pyx_INCREF(((PyObject *)__pyx_v_self->As));
17424   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->As));
17425   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->As));
17426   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.Q));
17427   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.Q));
17428   PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->__pyx_base.Q));
17429   __Pyx_INCREF(__pyx_v_self->__pyx_base.Q_square_root);
17430   __Pyx_GIVEREF(__pyx_v_self->__pyx_base.Q_square_root);
17431   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->__pyx_base.Q_square_root);
17432   __Pyx_INCREF(__pyx_v_self->Q_svd_dict);
17433   __Pyx_GIVEREF(__pyx_v_self->Q_svd_dict);
17434   PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_self->Q_svd_dict);
17435   __Pyx_GIVEREF(__pyx_t_1);
17436   PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_1);
17437   __Pyx_INCREF(((PyObject *)__pyx_v_self->Qs));
17438   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->Qs));
17439   PyTuple_SET_ITEM(__pyx_t_4, 5, ((PyObject *)__pyx_v_self->Qs));
17440   __Pyx_INCREF(((PyObject *)__pyx_v_self->dAs));
17441   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dAs));
17442   PyTuple_SET_ITEM(__pyx_t_4, 6, ((PyObject *)__pyx_v_self->dAs));
17443   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.dQ));
17444   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.dQ));
17445   PyTuple_SET_ITEM(__pyx_t_4, 7, ((PyObject *)__pyx_v_self->__pyx_base.dQ));
17446   __Pyx_INCREF(((PyObject *)__pyx_v_self->dQs));
17447   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dQs));
17448   PyTuple_SET_ITEM(__pyx_t_4, 8, ((PyObject *)__pyx_v_self->dQs));
17449   __Pyx_INCREF(((PyObject *)__pyx_v_self->__pyx_base.index));
17450   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->__pyx_base.index));
17451   PyTuple_SET_ITEM(__pyx_t_4, 9, ((PyObject *)__pyx_v_self->__pyx_base.index));
17452   __Pyx_GIVEREF(__pyx_t_2);
17453   PyTuple_SET_ITEM(__pyx_t_4, 10, __pyx_t_2);
17454   __Pyx_INCREF(((PyObject *)__pyx_v_self->reconstruct_indices));
17455   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->reconstruct_indices));
17456   PyTuple_SET_ITEM(__pyx_t_4, 11, ((PyObject *)__pyx_v_self->reconstruct_indices));
17457   __Pyx_GIVEREF(__pyx_t_3);
17458   PyTuple_SET_ITEM(__pyx_t_4, 12, __pyx_t_3);
17459   __pyx_t_1 = 0;
17460   __pyx_t_2 = 0;
17461   __pyx_t_3 = 0;
17462   __pyx_v_state = ((PyObject*)__pyx_t_4);
17463   __pyx_t_4 = 0;
17464 
17465   /* "(tree fragment)":6
17466  *     cdef bint use_setstate
17467  *     state = (self.As, self.Q, self.Q_square_root, self.Q_svd_dict, self.Q_time_var_index, self.Qs, self.dAs, self.dQ, self.dQs, self.index, self.last_k, self.reconstruct_indices, self.svd_each_time)
17468  *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
17469  *     if _dict is not None:
17470  *         state += (_dict,)
17471  */
17472   __pyx_t_4 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
17473   __Pyx_GOTREF(__pyx_t_4);
17474   __pyx_v__dict = __pyx_t_4;
17475   __pyx_t_4 = 0;
17476 
17477   /* "(tree fragment)":7
17478  *     state = (self.As, self.Q, self.Q_square_root, self.Q_svd_dict, self.Q_time_var_index, self.Qs, self.dAs, self.dQ, self.dQs, self.index, self.last_k, self.reconstruct_indices, self.svd_each_time)
17479  *     _dict = getattr(self, '__dict__', None)
17480  *     if _dict is not None:             # <<<<<<<<<<<<<<
17481  *         state += (_dict,)
17482  *         use_setstate = True
17483  */
17484   __pyx_t_5 = (__pyx_v__dict != Py_None);
17485   __pyx_t_6 = (__pyx_t_5 != 0);
17486   if (__pyx_t_6) {
17487 
17488     /* "(tree fragment)":8
17489  *     _dict = getattr(self, '__dict__', None)
17490  *     if _dict is not None:
17491  *         state += (_dict,)             # <<<<<<<<<<<<<<
17492  *         use_setstate = True
17493  *     else:
17494  */
17495     __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
17496     __Pyx_GOTREF(__pyx_t_4);
17497     __Pyx_INCREF(__pyx_v__dict);
17498     __Pyx_GIVEREF(__pyx_v__dict);
17499     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v__dict);
17500     __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
17501     __Pyx_GOTREF(__pyx_t_3);
17502     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
17503     __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_3));
17504     __pyx_t_3 = 0;
17505 
17506     /* "(tree fragment)":9
17507  *     if _dict is not None:
17508  *         state += (_dict,)
17509  *         use_setstate = True             # <<<<<<<<<<<<<<
17510  *     else:
17511  *         use_setstate = self.As is not None or self.Q is not None or self.Q_square_root is not None or self.Q_svd_dict is not None or self.Qs is not None or self.dAs is not None or self.dQ is not None or self.dQs is not None or self.index is not None or self.reconstruct_indices is not None
17512  */
17513     __pyx_v_use_setstate = 1;
17514 
17515     /* "(tree fragment)":7
17516  *     state = (self.As, self.Q, self.Q_square_root, self.Q_svd_dict, self.Q_time_var_index, self.Qs, self.dAs, self.dQ, self.dQs, self.index, self.last_k, self.reconstruct_indices, self.svd_each_time)
17517  *     _dict = getattr(self, '__dict__', None)
17518  *     if _dict is not None:             # <<<<<<<<<<<<<<
17519  *         state += (_dict,)
17520  *         use_setstate = True
17521  */
17522     goto __pyx_L3;
17523   }
17524 
17525   /* "(tree fragment)":11
17526  *         use_setstate = True
17527  *     else:
17528  *         use_setstate = self.As is not None or self.Q is not None or self.Q_square_root is not None or self.Q_svd_dict is not None or self.Qs is not None or self.dAs is not None or self.dQ is not None or self.dQs is not None or self.index is not None or self.reconstruct_indices is not None             # <<<<<<<<<<<<<<
17529  *     if use_setstate:
17530  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, None), state
17531  */
17532   /*else*/ {
17533     __pyx_t_5 = (((PyObject *)__pyx_v_self->As) != Py_None);
17534     __pyx_t_7 = (__pyx_t_5 != 0);
17535     if (!__pyx_t_7) {
17536     } else {
17537       __pyx_t_6 = __pyx_t_7;
17538       goto __pyx_L4_bool_binop_done;
17539     }
17540     __pyx_t_7 = (((PyObject *)__pyx_v_self->__pyx_base.Q) != Py_None);
17541     __pyx_t_5 = (__pyx_t_7 != 0);
17542     if (!__pyx_t_5) {
17543     } else {
17544       __pyx_t_6 = __pyx_t_5;
17545       goto __pyx_L4_bool_binop_done;
17546     }
17547     __pyx_t_5 = (__pyx_v_self->__pyx_base.Q_square_root != ((PyObject*)Py_None));
17548     __pyx_t_7 = (__pyx_t_5 != 0);
17549     if (!__pyx_t_7) {
17550     } else {
17551       __pyx_t_6 = __pyx_t_7;
17552       goto __pyx_L4_bool_binop_done;
17553     }
17554     __pyx_t_7 = (__pyx_v_self->Q_svd_dict != ((PyObject*)Py_None));
17555     __pyx_t_5 = (__pyx_t_7 != 0);
17556     if (!__pyx_t_5) {
17557     } else {
17558       __pyx_t_6 = __pyx_t_5;
17559       goto __pyx_L4_bool_binop_done;
17560     }
17561     __pyx_t_5 = (((PyObject *)__pyx_v_self->Qs) != Py_None);
17562     __pyx_t_7 = (__pyx_t_5 != 0);
17563     if (!__pyx_t_7) {
17564     } else {
17565       __pyx_t_6 = __pyx_t_7;
17566       goto __pyx_L4_bool_binop_done;
17567     }
17568     __pyx_t_7 = (((PyObject *)__pyx_v_self->dAs) != Py_None);
17569     __pyx_t_5 = (__pyx_t_7 != 0);
17570     if (!__pyx_t_5) {
17571     } else {
17572       __pyx_t_6 = __pyx_t_5;
17573       goto __pyx_L4_bool_binop_done;
17574     }
17575     __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.dQ) != Py_None);
17576     __pyx_t_7 = (__pyx_t_5 != 0);
17577     if (!__pyx_t_7) {
17578     } else {
17579       __pyx_t_6 = __pyx_t_7;
17580       goto __pyx_L4_bool_binop_done;
17581     }
17582     __pyx_t_7 = (((PyObject *)__pyx_v_self->dQs) != Py_None);
17583     __pyx_t_5 = (__pyx_t_7 != 0);
17584     if (!__pyx_t_5) {
17585     } else {
17586       __pyx_t_6 = __pyx_t_5;
17587       goto __pyx_L4_bool_binop_done;
17588     }
17589     __pyx_t_5 = (((PyObject *)__pyx_v_self->__pyx_base.index) != Py_None);
17590     __pyx_t_7 = (__pyx_t_5 != 0);
17591     if (!__pyx_t_7) {
17592     } else {
17593       __pyx_t_6 = __pyx_t_7;
17594       goto __pyx_L4_bool_binop_done;
17595     }
17596     __pyx_t_7 = (((PyObject *)__pyx_v_self->reconstruct_indices) != Py_None);
17597     __pyx_t_5 = (__pyx_t_7 != 0);
17598     __pyx_t_6 = __pyx_t_5;
17599     __pyx_L4_bool_binop_done:;
17600     __pyx_v_use_setstate = __pyx_t_6;
17601   }
17602   __pyx_L3:;
17603 
17604   /* "(tree fragment)":12
17605  *     else:
17606  *         use_setstate = self.As is not None or self.Q is not None or self.Q_square_root is not None or self.Q_svd_dict is not None or self.Qs is not None or self.dAs is not None or self.dQ is not None or self.dQs is not None or self.index is not None or self.reconstruct_indices is not None
17607  *     if use_setstate:             # <<<<<<<<<<<<<<
17608  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, None), state
17609  *     else:
17610  */
17611   __pyx_t_6 = (__pyx_v_use_setstate != 0);
17612   if (__pyx_t_6) {
17613 
17614     /* "(tree fragment)":13
17615  *         use_setstate = self.As is not None or self.Q is not None or self.Q_square_root is not None or self.Q_svd_dict is not None or self.Qs is not None or self.dAs is not None or self.dQ is not None or self.dQs is not None or self.index is not None or self.reconstruct_indices is not None
17616  *     if use_setstate:
17617  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, None), state             # <<<<<<<<<<<<<<
17618  *     else:
17619  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, state)
17620  */
17621     __Pyx_XDECREF(__pyx_r);
17622     __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_AQcompute_batch_C); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
17623     __Pyx_GOTREF(__pyx_t_3);
17624     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
17625     __Pyx_GOTREF(__pyx_t_4);
17626     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17627     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17628     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17629     __Pyx_INCREF(__pyx_int_21422583);
17630     __Pyx_GIVEREF(__pyx_int_21422583);
17631     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_21422583);
17632     __Pyx_INCREF(Py_None);
17633     __Pyx_GIVEREF(Py_None);
17634     PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None);
17635     __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
17636     __Pyx_GOTREF(__pyx_t_2);
17637     __Pyx_GIVEREF(__pyx_t_3);
17638     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
17639     __Pyx_GIVEREF(__pyx_t_4);
17640     PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
17641     __Pyx_INCREF(__pyx_v_state);
17642     __Pyx_GIVEREF(__pyx_v_state);
17643     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
17644     __pyx_t_3 = 0;
17645     __pyx_t_4 = 0;
17646     __pyx_r = __pyx_t_2;
17647     __pyx_t_2 = 0;
17648     goto __pyx_L0;
17649 
17650     /* "(tree fragment)":12
17651  *     else:
17652  *         use_setstate = self.As is not None or self.Q is not None or self.Q_square_root is not None or self.Q_svd_dict is not None or self.Qs is not None or self.dAs is not None or self.dQ is not None or self.dQs is not None or self.index is not None or self.reconstruct_indices is not None
17653  *     if use_setstate:             # <<<<<<<<<<<<<<
17654  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, None), state
17655  *     else:
17656  */
17657   }
17658 
17659   /* "(tree fragment)":15
17660  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, None), state
17661  *     else:
17662  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, state)             # <<<<<<<<<<<<<<
17663  * def __setstate_cython__(self, __pyx_state):
17664  *     __pyx_unpickle_AQcompute_batch_Cython__set_state(self, __pyx_state)
17665  */
17666   /*else*/ {
17667     __Pyx_XDECREF(__pyx_r);
17668     __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_AQcompute_batch_C); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
17669     __Pyx_GOTREF(__pyx_t_2);
17670     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
17671     __Pyx_GOTREF(__pyx_t_4);
17672     __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17673     __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17674     PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
17675     __Pyx_INCREF(__pyx_int_21422583);
17676     __Pyx_GIVEREF(__pyx_int_21422583);
17677     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_21422583);
17678     __Pyx_INCREF(__pyx_v_state);
17679     __Pyx_GIVEREF(__pyx_v_state);
17680     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_state);
17681     __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
17682     __Pyx_GOTREF(__pyx_t_3);
17683     __Pyx_GIVEREF(__pyx_t_2);
17684     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
17685     __Pyx_GIVEREF(__pyx_t_4);
17686     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
17687     __pyx_t_2 = 0;
17688     __pyx_t_4 = 0;
17689     __pyx_r = __pyx_t_3;
17690     __pyx_t_3 = 0;
17691     goto __pyx_L0;
17692   }
17693 
17694   /* "(tree fragment)":1
17695  * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
17696  *     cdef tuple state
17697  *     cdef object _dict
17698  */
17699 
17700   /* function exit code */
17701   __pyx_L1_error:;
17702   __Pyx_XDECREF(__pyx_t_1);
17703   __Pyx_XDECREF(__pyx_t_2);
17704   __Pyx_XDECREF(__pyx_t_3);
17705   __Pyx_XDECREF(__pyx_t_4);
17706   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17707   __pyx_r = NULL;
17708   __pyx_L0:;
17709   __Pyx_XDECREF(__pyx_v_state);
17710   __Pyx_XDECREF(__pyx_v__dict);
17711   __Pyx_XGIVEREF(__pyx_r);
17712   __Pyx_RefNannyFinishContext();
17713   return __pyx_r;
17714 }
17715 
17716 /* "(tree fragment)":16
17717  *     else:
17718  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, state)
17719  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17720  *     __pyx_unpickle_AQcompute_batch_Cython__set_state(self, __pyx_state)
17721  */
17722 
17723 /* Python wrapper */
17724 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_21__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)17725 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_21__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17726   PyObject *__pyx_r = 0;
17727   __Pyx_RefNannyDeclarations
17728   __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17729   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_20__setstate_cython__(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17730 
17731   /* function exit code */
17732   __Pyx_RefNannyFinishContext();
17733   return __pyx_r;
17734 }
17735 
__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_20__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v_self,PyObject * __pyx_v___pyx_state)17736 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_20__setstate_cython__(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17737   PyObject *__pyx_r = NULL;
17738   __Pyx_RefNannyDeclarations
17739   PyObject *__pyx_t_1 = NULL;
17740   int __pyx_lineno = 0;
17741   const char *__pyx_filename = NULL;
17742   int __pyx_clineno = 0;
17743   __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17744 
17745   /* "(tree fragment)":17
17746  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, state)
17747  * def __setstate_cython__(self, __pyx_state):
17748  *     __pyx_unpickle_AQcompute_batch_Cython__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
17749  */
17750   if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
17751   __pyx_t_1 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_AQcompute_batch_Cython__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
17752   __Pyx_GOTREF(__pyx_t_1);
17753   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17754 
17755   /* "(tree fragment)":16
17756  *     else:
17757  *         return __pyx_unpickle_AQcompute_batch_Cython, (type(self), 0x146e1f7, state)
17758  * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
17759  *     __pyx_unpickle_AQcompute_batch_Cython__set_state(self, __pyx_state)
17760  */
17761 
17762   /* function exit code */
17763   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17764   goto __pyx_L0;
17765   __pyx_L1_error:;
17766   __Pyx_XDECREF(__pyx_t_1);
17767   __Pyx_AddTraceback("GPy.models.state_space_cython.AQcompute_batch_Cython.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17768   __pyx_r = NULL;
17769   __pyx_L0:;
17770   __Pyx_XGIVEREF(__pyx_r);
17771   __Pyx_RefNannyFinishContext();
17772   return __pyx_r;
17773 }
17774 
17775 /* "GPy/models/state_space_cython.pyx":547
17776  *
17777  * @cython.boundscheck(False)
17778  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,             # <<<<<<<<<<<<<<
17779  *                                 Dynamic_Callables_Cython p_dynamic_callables,
17780  *                                 bint calc_grad_log_likelihood=False,
17781  */
17782 
17783 /* Python wrapper */
17784 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
17785 static char __pyx_doc_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython[] = "\n    Desctrete prediction function        \n    \n    Input:\n        k:int\n            Iteration No. Starts at 0. Total number of iterations equal to the \n            number of measurements.\n          \n        p_m: matrix of size (state_dim, time_series_no)\n            Mean value from the previous step. For \"multiple time series mode\" \n            it is matrix, second dimension of which correspond to different\n            time series.\n            \n        p_P: tuple (Prev_cov, S, V)\n            Covariance matrix from the previous step and its SVD decomposition.\n            Prev_cov = V * S * V.T The tuple is (Prev_cov, S, V)                \n            \n        p_a: function (k, x_{k-1}, A_{k}). Dynamic function.        \n            k (iteration number), starts at 0\n            x_{k-1} State from the previous step\n            A_{k} Jacobian matrices of f_a. In the linear case it is exactly A_{k}.\n        \n        p_f_A: function (k, m, P) return Jacobian of dynamic function, it is\n            passed into p_a.\n            k (iteration number), starts at 0\n            m: point where Jacobian is evaluated\n            P: parameter for Jacobian, usually covariance matrix.\n    \n        p_f_Q: function (k). Returns noise matrix of dynamic model on iteration k.\n            k (iteration number). starts at 0\n        \n        p_f_Qsr: function (k). Returns square root of noise matrix of the \n            dynamic model on iteration k. k (iteration number). starts at 0\n            \n        calc_grad_log_likelihood: boolean\n            Whether to calculate gradient of the marginal likelihood \n            of the state-space model. If true then the next parameter must \n            provide the extra parameters for gradient calculation.\n            \n        p_dm: 3D array (state_dim, time_series_no, parameters_no)\n            Mean derivatives from the previous step. For \"multiple time series mode\" \n            it is 3D array, second dimension"" of which correspond to different\n            time series.\n            \n        p_dP: 3D array (state_dim, state_dim, parameters_no)\n            Mean derivatives from the previous step\n            \n        grad_calc_params_1: List or None\n        List with derivatives. The first component is 'f_dA' - function(k)\n        which returns the derivative of A. The second element is 'f_dQ'\n         - function(k). Function which returns the derivative of Q.\n         \n    Output:\n    ----------------------------\n    m_pred, P_pred, dm_pred, dP_pred: metrices, 3D objects\n        Results of the prediction steps.        \n        \n    ";
17786 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython = {"_kalman_prediction_step_SVD_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython};
__pyx_pw_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)17787 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17788   long __pyx_v_k;
17789   PyArrayObject *__pyx_v_p_m = 0;
17790   PyObject *__pyx_v_p_P = 0;
17791   struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables = 0;
17792   int __pyx_v_calc_grad_log_likelihood;
17793   PyArrayObject *__pyx_v_p_dm = 0;
17794   PyArrayObject *__pyx_v_p_dP = 0;
17795   int __pyx_lineno = 0;
17796   const char *__pyx_filename = NULL;
17797   int __pyx_clineno = 0;
17798   PyObject *__pyx_r = 0;
17799   __Pyx_RefNannyDeclarations
17800   __Pyx_RefNannySetupContext("_kalman_prediction_step_SVD_Cython (wrapper)", 0);
17801   {
17802     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_p_m,&__pyx_n_s_p_P,&__pyx_n_s_p_dynamic_callables,&__pyx_n_s_calc_grad_log_likelihood,&__pyx_n_s_p_dm,&__pyx_n_s_p_dP,0};
17803     PyObject* values[7] = {0,0,0,0,0,0,0};
17804 
17805     /* "GPy/models/state_space_cython.pyx":550
17806  *                                 Dynamic_Callables_Cython p_dynamic_callables,
17807  *                                 bint calc_grad_log_likelihood=False,
17808  *                                 np.ndarray[DTYPE_t, ndim=3] p_dm = None,             # <<<<<<<<<<<<<<
17809  *                                 np.ndarray[DTYPE_t, ndim=3] p_dP = None):
17810  *     """
17811  */
17812     values[5] = (PyObject *)((PyArrayObject *)Py_None);
17813 
17814     /* "GPy/models/state_space_cython.pyx":551
17815  *                                 bint calc_grad_log_likelihood=False,
17816  *                                 np.ndarray[DTYPE_t, ndim=3] p_dm = None,
17817  *                                 np.ndarray[DTYPE_t, ndim=3] p_dP = None):             # <<<<<<<<<<<<<<
17818  *     """
17819  *     Desctrete prediction function
17820  */
17821     values[6] = (PyObject *)((PyArrayObject *)Py_None);
17822     if (unlikely(__pyx_kwds)) {
17823       Py_ssize_t kw_args;
17824       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17825       switch (pos_args) {
17826         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17827         CYTHON_FALLTHROUGH;
17828         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17829         CYTHON_FALLTHROUGH;
17830         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17831         CYTHON_FALLTHROUGH;
17832         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17833         CYTHON_FALLTHROUGH;
17834         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17835         CYTHON_FALLTHROUGH;
17836         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17837         CYTHON_FALLTHROUGH;
17838         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17839         CYTHON_FALLTHROUGH;
17840         case  0: break;
17841         default: goto __pyx_L5_argtuple_error;
17842       }
17843       kw_args = PyDict_Size(__pyx_kwds);
17844       switch (pos_args) {
17845         case  0:
17846         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
17847         else goto __pyx_L5_argtuple_error;
17848         CYTHON_FALLTHROUGH;
17849         case  1:
17850         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_m)) != 0)) kw_args--;
17851         else {
17852           __Pyx_RaiseArgtupleInvalid("_kalman_prediction_step_SVD_Cython", 0, 4, 7, 1); __PYX_ERR(0, 547, __pyx_L3_error)
17853         }
17854         CYTHON_FALLTHROUGH;
17855         case  2:
17856         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_P)) != 0)) kw_args--;
17857         else {
17858           __Pyx_RaiseArgtupleInvalid("_kalman_prediction_step_SVD_Cython", 0, 4, 7, 2); __PYX_ERR(0, 547, __pyx_L3_error)
17859         }
17860         CYTHON_FALLTHROUGH;
17861         case  3:
17862         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dynamic_callables)) != 0)) kw_args--;
17863         else {
17864           __Pyx_RaiseArgtupleInvalid("_kalman_prediction_step_SVD_Cython", 0, 4, 7, 3); __PYX_ERR(0, 547, __pyx_L3_error)
17865         }
17866         CYTHON_FALLTHROUGH;
17867         case  4:
17868         if (kw_args > 0) {
17869           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calc_grad_log_likelihood);
17870           if (value) { values[4] = value; kw_args--; }
17871         }
17872         CYTHON_FALLTHROUGH;
17873         case  5:
17874         if (kw_args > 0) {
17875           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dm);
17876           if (value) { values[5] = value; kw_args--; }
17877         }
17878         CYTHON_FALLTHROUGH;
17879         case  6:
17880         if (kw_args > 0) {
17881           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dP);
17882           if (value) { values[6] = value; kw_args--; }
17883         }
17884       }
17885       if (unlikely(kw_args > 0)) {
17886         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kalman_prediction_step_SVD_Cython") < 0)) __PYX_ERR(0, 547, __pyx_L3_error)
17887       }
17888     } else {
17889       switch (PyTuple_GET_SIZE(__pyx_args)) {
17890         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17891         CYTHON_FALLTHROUGH;
17892         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17893         CYTHON_FALLTHROUGH;
17894         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17895         CYTHON_FALLTHROUGH;
17896         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17897         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17898         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17899         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17900         break;
17901         default: goto __pyx_L5_argtuple_error;
17902       }
17903     }
17904     __pyx_v_k = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L3_error)
17905     __pyx_v_p_m = ((PyArrayObject *)values[1]);
17906     __pyx_v_p_P = ((PyObject*)values[2]);
17907     __pyx_v_p_dynamic_callables = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)values[3]);
17908     if (values[4]) {
17909       __pyx_v_calc_grad_log_likelihood = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_calc_grad_log_likelihood == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L3_error)
17910     } else {
17911 
17912       /* "GPy/models/state_space_cython.pyx":549
17913  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,
17914  *                                 Dynamic_Callables_Cython p_dynamic_callables,
17915  *                                 bint calc_grad_log_likelihood=False,             # <<<<<<<<<<<<<<
17916  *                                 np.ndarray[DTYPE_t, ndim=3] p_dm = None,
17917  *                                 np.ndarray[DTYPE_t, ndim=3] p_dP = None):
17918  */
17919       __pyx_v_calc_grad_log_likelihood = ((int)0);
17920     }
17921     __pyx_v_p_dm = ((PyArrayObject *)values[5]);
17922     __pyx_v_p_dP = ((PyArrayObject *)values[6]);
17923   }
17924   goto __pyx_L4_argument_unpacking_done;
17925   __pyx_L5_argtuple_error:;
17926   __Pyx_RaiseArgtupleInvalid("_kalman_prediction_step_SVD_Cython", 0, 4, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 547, __pyx_L3_error)
17927   __pyx_L3_error:;
17928   __Pyx_AddTraceback("GPy.models.state_space_cython._kalman_prediction_step_SVD_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
17929   __Pyx_RefNannyFinishContext();
17930   return NULL;
17931   __pyx_L4_argument_unpacking_done:;
17932   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_m), __pyx_ptype_5numpy_ndarray, 1, "p_m", 0))) __PYX_ERR(0, 547, __pyx_L1_error)
17933   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_P), (&PyTuple_Type), 1, "p_P", 1))) __PYX_ERR(0, 547, __pyx_L1_error)
17934   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dynamic_callables), __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython, 1, "p_dynamic_callables", 0))) __PYX_ERR(0, 548, __pyx_L1_error)
17935   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dm), __pyx_ptype_5numpy_ndarray, 1, "p_dm", 0))) __PYX_ERR(0, 550, __pyx_L1_error)
17936   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dP), __pyx_ptype_5numpy_ndarray, 1, "p_dP", 0))) __PYX_ERR(0, 551, __pyx_L1_error)
17937   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython(__pyx_self, __pyx_v_k, __pyx_v_p_m, __pyx_v_p_P, __pyx_v_p_dynamic_callables, __pyx_v_calc_grad_log_likelihood, __pyx_v_p_dm, __pyx_v_p_dP);
17938 
17939   /* "GPy/models/state_space_cython.pyx":547
17940  *
17941  * @cython.boundscheck(False)
17942  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,             # <<<<<<<<<<<<<<
17943  *                                 Dynamic_Callables_Cython p_dynamic_callables,
17944  *                                 bint calc_grad_log_likelihood=False,
17945  */
17946 
17947   /* function exit code */
17948   goto __pyx_L0;
17949   __pyx_L1_error:;
17950   __pyx_r = NULL;
17951   __pyx_L0:;
17952   __Pyx_RefNannyFinishContext();
17953   return __pyx_r;
17954 }
17955 
__pyx_pf_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython(CYTHON_UNUSED PyObject * __pyx_self,long __pyx_v_k,PyArrayObject * __pyx_v_p_m,PyObject * __pyx_v_p_P,struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_p_dynamic_callables,int __pyx_v_calc_grad_log_likelihood,PyArrayObject * __pyx_v_p_dm,PyArrayObject * __pyx_v_p_dP)17956 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython__kalman_prediction_step_SVD_Cython(CYTHON_UNUSED PyObject *__pyx_self, long __pyx_v_k, PyArrayObject *__pyx_v_p_m, PyObject *__pyx_v_p_P, struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables, int __pyx_v_calc_grad_log_likelihood, PyArrayObject *__pyx_v_p_dm, PyArrayObject *__pyx_v_p_dP) {
17957   PyArrayObject *__pyx_v_Prev_cov = 0;
17958   PyArrayObject *__pyx_v_S_old = 0;
17959   PyArrayObject *__pyx_v_V_old = 0;
17960   PyArrayObject *__pyx_v_A = 0;
17961   CYTHON_UNUSED PyArrayObject *__pyx_v_Q = 0;
17962   PyArrayObject *__pyx_v_Q_sr = 0;
17963   PyArrayObject *__pyx_v_m_pred = 0;
17964   PyArrayObject *__pyx_v_svd_1_matr = 0;
17965   PyObject *__pyx_v_res = NULL;
17966   CYTHON_UNUSED PyArrayObject *__pyx_v_U = 0;
17967   PyArrayObject *__pyx_v_S = 0;
17968   PyArrayObject *__pyx_v_Vh = 0;
17969   PyArrayObject *__pyx_v_V_new = 0;
17970   PyArrayObject *__pyx_v_S_new = 0;
17971   PyArrayObject *__pyx_v_P_pred = 0;
17972   PyArrayObject *__pyx_v_dA_all_params = 0;
17973   PyArrayObject *__pyx_v_dQ_all_params = 0;
17974   PyArrayObject *__pyx_v_dm_pred = 0;
17975   PyArrayObject *__pyx_v_dP_pred = 0;
17976   int __pyx_v_param_number;
17977   int __pyx_v_j;
17978   PyObject *__pyx_v_ret = 0;
17979   PyArrayObject *__pyx_v_dA = 0;
17980   PyArrayObject *__pyx_v_dQ = 0;
17981   __Pyx_LocalBuf_ND __pyx_pybuffernd_A;
17982   __Pyx_Buffer __pyx_pybuffer_A;
17983   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
17984   __Pyx_Buffer __pyx_pybuffer_P_pred;
17985   __Pyx_LocalBuf_ND __pyx_pybuffernd_Prev_cov;
17986   __Pyx_Buffer __pyx_pybuffer_Prev_cov;
17987   __Pyx_LocalBuf_ND __pyx_pybuffernd_Q;
17988   __Pyx_Buffer __pyx_pybuffer_Q;
17989   __Pyx_LocalBuf_ND __pyx_pybuffernd_Q_sr;
17990   __Pyx_Buffer __pyx_pybuffer_Q_sr;
17991   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
17992   __Pyx_Buffer __pyx_pybuffer_S;
17993   __Pyx_LocalBuf_ND __pyx_pybuffernd_S_new;
17994   __Pyx_Buffer __pyx_pybuffer_S_new;
17995   __Pyx_LocalBuf_ND __pyx_pybuffernd_S_old;
17996   __Pyx_Buffer __pyx_pybuffer_S_old;
17997   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
17998   __Pyx_Buffer __pyx_pybuffer_U;
17999   __Pyx_LocalBuf_ND __pyx_pybuffernd_V_new;
18000   __Pyx_Buffer __pyx_pybuffer_V_new;
18001   __Pyx_LocalBuf_ND __pyx_pybuffernd_V_old;
18002   __Pyx_Buffer __pyx_pybuffer_V_old;
18003   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
18004   __Pyx_Buffer __pyx_pybuffer_Vh;
18005   __Pyx_LocalBuf_ND __pyx_pybuffernd_dA;
18006   __Pyx_Buffer __pyx_pybuffer_dA;
18007   __Pyx_LocalBuf_ND __pyx_pybuffernd_dA_all_params;
18008   __Pyx_Buffer __pyx_pybuffer_dA_all_params;
18009   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_pred;
18010   __Pyx_Buffer __pyx_pybuffer_dP_pred;
18011   __Pyx_LocalBuf_ND __pyx_pybuffernd_dQ;
18012   __Pyx_Buffer __pyx_pybuffer_dQ;
18013   __Pyx_LocalBuf_ND __pyx_pybuffernd_dQ_all_params;
18014   __Pyx_Buffer __pyx_pybuffer_dQ_all_params;
18015   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_pred;
18016   __Pyx_Buffer __pyx_pybuffer_dm_pred;
18017   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
18018   __Pyx_Buffer __pyx_pybuffer_m_pred;
18019   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_dP;
18020   __Pyx_Buffer __pyx_pybuffer_p_dP;
18021   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_dm;
18022   __Pyx_Buffer __pyx_pybuffer_p_dm;
18023   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_m;
18024   __Pyx_Buffer __pyx_pybuffer_p_m;
18025   __Pyx_LocalBuf_ND __pyx_pybuffernd_svd_1_matr;
18026   __Pyx_Buffer __pyx_pybuffer_svd_1_matr;
18027   PyObject *__pyx_r = NULL;
18028   __Pyx_RefNannyDeclarations
18029   PyObject *__pyx_t_1 = NULL;
18030   PyArrayObject *__pyx_t_2 = NULL;
18031   PyArrayObject *__pyx_t_3 = NULL;
18032   PyArrayObject *__pyx_t_4 = NULL;
18033   PyArrayObject *__pyx_t_5 = NULL;
18034   PyObject *__pyx_t_6 = NULL;
18035   PyObject *__pyx_t_7 = NULL;
18036   PyObject *__pyx_t_8 = NULL;
18037   PyObject *__pyx_t_9 = NULL;
18038   PyObject *__pyx_t_10 = NULL;
18039   int __pyx_t_11;
18040   PyObject *__pyx_t_12 = NULL;
18041   PyArrayObject *__pyx_t_13 = NULL;
18042   PyArrayObject *__pyx_t_14 = NULL;
18043   PyArrayObject *__pyx_t_15 = NULL;
18044   PyArrayObject *__pyx_t_16 = NULL;
18045   PyArrayObject *__pyx_t_17 = NULL;
18046   PyArrayObject *__pyx_t_18 = NULL;
18047   PyArrayObject *__pyx_t_19 = NULL;
18048   int __pyx_t_20;
18049   PyArrayObject *__pyx_t_21 = NULL;
18050   PyObject *__pyx_t_22 = NULL;
18051   PyObject *__pyx_t_23 = NULL;
18052   PyObject *__pyx_t_24 = NULL;
18053   PyArrayObject *__pyx_t_25 = NULL;
18054   PyArrayObject *__pyx_t_26 = NULL;
18055   PyArrayObject *__pyx_t_27 = NULL;
18056   int __pyx_t_28;
18057   int __pyx_t_29;
18058   PyArrayObject *__pyx_t_30 = NULL;
18059   int __pyx_t_31;
18060   PyArrayObject *__pyx_t_32 = NULL;
18061   PyObject *__pyx_t_33 = NULL;
18062   PyObject *__pyx_t_34 = NULL;
18063   PyObject *__pyx_t_35 = NULL;
18064   int __pyx_lineno = 0;
18065   const char *__pyx_filename = NULL;
18066   int __pyx_clineno = 0;
18067   __Pyx_RefNannySetupContext("_kalman_prediction_step_SVD_Cython", 0);
18068   __pyx_pybuffer_Prev_cov.pybuffer.buf = NULL;
18069   __pyx_pybuffer_Prev_cov.refcount = 0;
18070   __pyx_pybuffernd_Prev_cov.data = NULL;
18071   __pyx_pybuffernd_Prev_cov.rcbuffer = &__pyx_pybuffer_Prev_cov;
18072   __pyx_pybuffer_S_old.pybuffer.buf = NULL;
18073   __pyx_pybuffer_S_old.refcount = 0;
18074   __pyx_pybuffernd_S_old.data = NULL;
18075   __pyx_pybuffernd_S_old.rcbuffer = &__pyx_pybuffer_S_old;
18076   __pyx_pybuffer_V_old.pybuffer.buf = NULL;
18077   __pyx_pybuffer_V_old.refcount = 0;
18078   __pyx_pybuffernd_V_old.data = NULL;
18079   __pyx_pybuffernd_V_old.rcbuffer = &__pyx_pybuffer_V_old;
18080   __pyx_pybuffer_A.pybuffer.buf = NULL;
18081   __pyx_pybuffer_A.refcount = 0;
18082   __pyx_pybuffernd_A.data = NULL;
18083   __pyx_pybuffernd_A.rcbuffer = &__pyx_pybuffer_A;
18084   __pyx_pybuffer_Q.pybuffer.buf = NULL;
18085   __pyx_pybuffer_Q.refcount = 0;
18086   __pyx_pybuffernd_Q.data = NULL;
18087   __pyx_pybuffernd_Q.rcbuffer = &__pyx_pybuffer_Q;
18088   __pyx_pybuffer_Q_sr.pybuffer.buf = NULL;
18089   __pyx_pybuffer_Q_sr.refcount = 0;
18090   __pyx_pybuffernd_Q_sr.data = NULL;
18091   __pyx_pybuffernd_Q_sr.rcbuffer = &__pyx_pybuffer_Q_sr;
18092   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
18093   __pyx_pybuffer_m_pred.refcount = 0;
18094   __pyx_pybuffernd_m_pred.data = NULL;
18095   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
18096   __pyx_pybuffer_svd_1_matr.pybuffer.buf = NULL;
18097   __pyx_pybuffer_svd_1_matr.refcount = 0;
18098   __pyx_pybuffernd_svd_1_matr.data = NULL;
18099   __pyx_pybuffernd_svd_1_matr.rcbuffer = &__pyx_pybuffer_svd_1_matr;
18100   __pyx_pybuffer_U.pybuffer.buf = NULL;
18101   __pyx_pybuffer_U.refcount = 0;
18102   __pyx_pybuffernd_U.data = NULL;
18103   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
18104   __pyx_pybuffer_S.pybuffer.buf = NULL;
18105   __pyx_pybuffer_S.refcount = 0;
18106   __pyx_pybuffernd_S.data = NULL;
18107   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
18108   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
18109   __pyx_pybuffer_Vh.refcount = 0;
18110   __pyx_pybuffernd_Vh.data = NULL;
18111   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
18112   __pyx_pybuffer_V_new.pybuffer.buf = NULL;
18113   __pyx_pybuffer_V_new.refcount = 0;
18114   __pyx_pybuffernd_V_new.data = NULL;
18115   __pyx_pybuffernd_V_new.rcbuffer = &__pyx_pybuffer_V_new;
18116   __pyx_pybuffer_S_new.pybuffer.buf = NULL;
18117   __pyx_pybuffer_S_new.refcount = 0;
18118   __pyx_pybuffernd_S_new.data = NULL;
18119   __pyx_pybuffernd_S_new.rcbuffer = &__pyx_pybuffer_S_new;
18120   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
18121   __pyx_pybuffer_P_pred.refcount = 0;
18122   __pyx_pybuffernd_P_pred.data = NULL;
18123   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
18124   __pyx_pybuffer_dA_all_params.pybuffer.buf = NULL;
18125   __pyx_pybuffer_dA_all_params.refcount = 0;
18126   __pyx_pybuffernd_dA_all_params.data = NULL;
18127   __pyx_pybuffernd_dA_all_params.rcbuffer = &__pyx_pybuffer_dA_all_params;
18128   __pyx_pybuffer_dQ_all_params.pybuffer.buf = NULL;
18129   __pyx_pybuffer_dQ_all_params.refcount = 0;
18130   __pyx_pybuffernd_dQ_all_params.data = NULL;
18131   __pyx_pybuffernd_dQ_all_params.rcbuffer = &__pyx_pybuffer_dQ_all_params;
18132   __pyx_pybuffer_dm_pred.pybuffer.buf = NULL;
18133   __pyx_pybuffer_dm_pred.refcount = 0;
18134   __pyx_pybuffernd_dm_pred.data = NULL;
18135   __pyx_pybuffernd_dm_pred.rcbuffer = &__pyx_pybuffer_dm_pred;
18136   __pyx_pybuffer_dP_pred.pybuffer.buf = NULL;
18137   __pyx_pybuffer_dP_pred.refcount = 0;
18138   __pyx_pybuffernd_dP_pred.data = NULL;
18139   __pyx_pybuffernd_dP_pred.rcbuffer = &__pyx_pybuffer_dP_pred;
18140   __pyx_pybuffer_dA.pybuffer.buf = NULL;
18141   __pyx_pybuffer_dA.refcount = 0;
18142   __pyx_pybuffernd_dA.data = NULL;
18143   __pyx_pybuffernd_dA.rcbuffer = &__pyx_pybuffer_dA;
18144   __pyx_pybuffer_dQ.pybuffer.buf = NULL;
18145   __pyx_pybuffer_dQ.refcount = 0;
18146   __pyx_pybuffernd_dQ.data = NULL;
18147   __pyx_pybuffernd_dQ.rcbuffer = &__pyx_pybuffer_dQ;
18148   __pyx_pybuffer_p_m.pybuffer.buf = NULL;
18149   __pyx_pybuffer_p_m.refcount = 0;
18150   __pyx_pybuffernd_p_m.data = NULL;
18151   __pyx_pybuffernd_p_m.rcbuffer = &__pyx_pybuffer_p_m;
18152   __pyx_pybuffer_p_dm.pybuffer.buf = NULL;
18153   __pyx_pybuffer_p_dm.refcount = 0;
18154   __pyx_pybuffernd_p_dm.data = NULL;
18155   __pyx_pybuffernd_p_dm.rcbuffer = &__pyx_pybuffer_p_dm;
18156   __pyx_pybuffer_p_dP.pybuffer.buf = NULL;
18157   __pyx_pybuffer_p_dP.refcount = 0;
18158   __pyx_pybuffernd_p_dP.data = NULL;
18159   __pyx_pybuffernd_p_dP.rcbuffer = &__pyx_pybuffer_p_dP;
18160   {
18161     __Pyx_BufFmt_StackElem __pyx_stack[1];
18162     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
18163   }
18164   __pyx_pybuffernd_p_m.diminfo[0].strides = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_m.diminfo[0].shape = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_m.diminfo[1].strides = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_m.diminfo[1].shape = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.shape[1];
18165   {
18166     __Pyx_BufFmt_StackElem __pyx_stack[1];
18167     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_dm, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
18168   }
18169   __pyx_pybuffernd_p_dm.diminfo[0].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_dm.diminfo[0].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_dm.diminfo[1].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_dm.diminfo[1].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p_dm.diminfo[2].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p_dm.diminfo[2].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[2];
18170   {
18171     __Pyx_BufFmt_StackElem __pyx_stack[1];
18172     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_dP, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 547, __pyx_L1_error)
18173   }
18174   __pyx_pybuffernd_p_dP.diminfo[0].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_dP.diminfo[0].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_dP.diminfo[1].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_dP.diminfo[1].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p_dP.diminfo[2].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p_dP.diminfo[2].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[2];
18175 
18176   /* "GPy/models/state_space_cython.pyx":612
18177  *
18178  *     # covariance from the previous step# p_prev_cov = v * S * V.T
18179  *     cdef np.ndarray[DTYPE_t, ndim=2] Prev_cov = p_P[0]             # <<<<<<<<<<<<<<
18180  *     cdef np.ndarray[DTYPE_t, ndim=1] S_old = p_P[1]
18181  *     cdef np.ndarray[DTYPE_t, ndim=2] V_old = p_P[2]
18182  */
18183   if (unlikely(__pyx_v_p_P == Py_None)) {
18184     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18185     __PYX_ERR(0, 612, __pyx_L1_error)
18186   }
18187   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 0)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 0), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 612, __pyx_L1_error)
18188   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 0);
18189   __Pyx_INCREF(__pyx_t_1);
18190   {
18191     __Pyx_BufFmt_StackElem __pyx_stack[1];
18192     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18193       __pyx_v_Prev_cov = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer.buf = NULL;
18194       __PYX_ERR(0, 612, __pyx_L1_error)
18195     } else {__pyx_pybuffernd_Prev_cov.diminfo[0].strides = __pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Prev_cov.diminfo[0].shape = __pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Prev_cov.diminfo[1].strides = __pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Prev_cov.diminfo[1].shape = __pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer.shape[1];
18196     }
18197   }
18198   __pyx_v_Prev_cov = ((PyArrayObject *)__pyx_t_1);
18199   __pyx_t_1 = 0;
18200 
18201   /* "GPy/models/state_space_cython.pyx":613
18202  *     # covariance from the previous step# p_prev_cov = v * S * V.T
18203  *     cdef np.ndarray[DTYPE_t, ndim=2] Prev_cov = p_P[0]
18204  *     cdef np.ndarray[DTYPE_t, ndim=1] S_old = p_P[1]             # <<<<<<<<<<<<<<
18205  *     cdef np.ndarray[DTYPE_t, ndim=2] V_old = p_P[2]
18206  *     #p_prev_cov_tst = np.dot(p_V, (p_S * p_V).T) # reconstructed covariance from the previous step
18207  */
18208   if (unlikely(__pyx_v_p_P == Py_None)) {
18209     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18210     __PYX_ERR(0, 613, __pyx_L1_error)
18211   }
18212   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 1)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 1), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 613, __pyx_L1_error)
18213   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 1);
18214   __Pyx_INCREF(__pyx_t_1);
18215   {
18216     __Pyx_BufFmt_StackElem __pyx_stack[1];
18217     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S_old.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18218       __pyx_v_S_old = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S_old.rcbuffer->pybuffer.buf = NULL;
18219       __PYX_ERR(0, 613, __pyx_L1_error)
18220     } else {__pyx_pybuffernd_S_old.diminfo[0].strides = __pyx_pybuffernd_S_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S_old.diminfo[0].shape = __pyx_pybuffernd_S_old.rcbuffer->pybuffer.shape[0];
18221     }
18222   }
18223   __pyx_v_S_old = ((PyArrayObject *)__pyx_t_1);
18224   __pyx_t_1 = 0;
18225 
18226   /* "GPy/models/state_space_cython.pyx":614
18227  *     cdef np.ndarray[DTYPE_t, ndim=2] Prev_cov = p_P[0]
18228  *     cdef np.ndarray[DTYPE_t, ndim=1] S_old = p_P[1]
18229  *     cdef np.ndarray[DTYPE_t, ndim=2] V_old = p_P[2]             # <<<<<<<<<<<<<<
18230  *     #p_prev_cov_tst = np.dot(p_V, (p_S * p_V).T) # reconstructed covariance from the previous step
18231  *
18232  */
18233   if (unlikely(__pyx_v_p_P == Py_None)) {
18234     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
18235     __PYX_ERR(0, 614, __pyx_L1_error)
18236   }
18237   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 2)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 2), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 614, __pyx_L1_error)
18238   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 2);
18239   __Pyx_INCREF(__pyx_t_1);
18240   {
18241     __Pyx_BufFmt_StackElem __pyx_stack[1];
18242     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_old.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18243       __pyx_v_V_old = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_old.rcbuffer->pybuffer.buf = NULL;
18244       __PYX_ERR(0, 614, __pyx_L1_error)
18245     } else {__pyx_pybuffernd_V_old.diminfo[0].strides = __pyx_pybuffernd_V_old.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_old.diminfo[0].shape = __pyx_pybuffernd_V_old.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_old.diminfo[1].strides = __pyx_pybuffernd_V_old.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_old.diminfo[1].shape = __pyx_pybuffernd_V_old.rcbuffer->pybuffer.shape[1];
18246     }
18247   }
18248   __pyx_v_V_old = ((PyArrayObject *)__pyx_t_1);
18249   __pyx_t_1 = 0;
18250 
18251   /* "GPy/models/state_space_cython.pyx":618
18252  *
18253  *     # index correspond to values from previous iteration.
18254  *     cdef np.ndarray[DTYPE_t, ndim=2] A = p_dynamic_callables.Ak(k,p_m,Prev_cov) # state transition matrix (or Jacobian)             # <<<<<<<<<<<<<<
18255  *     cdef np.ndarray[DTYPE_t, ndim=2] Q = p_dynamic_callables.Qk(k) # state noise matrx. This is necessary for the square root calculation (next step)
18256  *     cdef np.ndarray[DTYPE_t, ndim=2] Q_sr = p_dynamic_callables.Q_srk(k)
18257  */
18258   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->Ak(__pyx_v_p_dynamic_callables, __pyx_v_k, ((PyArrayObject *)__pyx_v_p_m), ((PyArrayObject *)__pyx_v_Prev_cov), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
18259   __Pyx_GOTREF(__pyx_t_1);
18260   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 618, __pyx_L1_error)
18261   __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
18262   {
18263     __Pyx_BufFmt_StackElem __pyx_stack[1];
18264     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_A.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18265       __pyx_v_A = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_A.rcbuffer->pybuffer.buf = NULL;
18266       __PYX_ERR(0, 618, __pyx_L1_error)
18267     } else {__pyx_pybuffernd_A.diminfo[0].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_A.diminfo[0].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_A.diminfo[1].strides = __pyx_pybuffernd_A.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_A.diminfo[1].shape = __pyx_pybuffernd_A.rcbuffer->pybuffer.shape[1];
18268     }
18269   }
18270   __pyx_t_2 = 0;
18271   __pyx_v_A = ((PyArrayObject *)__pyx_t_1);
18272   __pyx_t_1 = 0;
18273 
18274   /* "GPy/models/state_space_cython.pyx":619
18275  *     # index correspond to values from previous iteration.
18276  *     cdef np.ndarray[DTYPE_t, ndim=2] A = p_dynamic_callables.Ak(k,p_m,Prev_cov) # state transition matrix (or Jacobian)
18277  *     cdef np.ndarray[DTYPE_t, ndim=2] Q = p_dynamic_callables.Qk(k) # state noise matrx. This is necessary for the square root calculation (next step)             # <<<<<<<<<<<<<<
18278  *     cdef np.ndarray[DTYPE_t, ndim=2] Q_sr = p_dynamic_callables.Q_srk(k)
18279  *     # Prediction step ->
18280  */
18281   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->Qk(__pyx_v_p_dynamic_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error)
18282   __Pyx_GOTREF(__pyx_t_1);
18283   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 619, __pyx_L1_error)
18284   __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
18285   {
18286     __Pyx_BufFmt_StackElem __pyx_stack[1];
18287     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18288       __pyx_v_Q = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q.rcbuffer->pybuffer.buf = NULL;
18289       __PYX_ERR(0, 619, __pyx_L1_error)
18290     } else {__pyx_pybuffernd_Q.diminfo[0].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q.diminfo[0].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q.diminfo[1].strides = __pyx_pybuffernd_Q.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q.diminfo[1].shape = __pyx_pybuffernd_Q.rcbuffer->pybuffer.shape[1];
18291     }
18292   }
18293   __pyx_t_3 = 0;
18294   __pyx_v_Q = ((PyArrayObject *)__pyx_t_1);
18295   __pyx_t_1 = 0;
18296 
18297   /* "GPy/models/state_space_cython.pyx":620
18298  *     cdef np.ndarray[DTYPE_t, ndim=2] A = p_dynamic_callables.Ak(k,p_m,Prev_cov) # state transition matrix (or Jacobian)
18299  *     cdef np.ndarray[DTYPE_t, ndim=2] Q = p_dynamic_callables.Qk(k) # state noise matrx. This is necessary for the square root calculation (next step)
18300  *     cdef np.ndarray[DTYPE_t, ndim=2] Q_sr = p_dynamic_callables.Q_srk(k)             # <<<<<<<<<<<<<<
18301  *     # Prediction step ->
18302  *     cdef np.ndarray[DTYPE_t, ndim=2] m_pred = p_dynamic_callables.f_a(k, p_m, A) # predicted mean
18303  */
18304   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->Q_srk(__pyx_v_p_dynamic_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
18305   __Pyx_GOTREF(__pyx_t_1);
18306   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 620, __pyx_L1_error)
18307   __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
18308   {
18309     __Pyx_BufFmt_StackElem __pyx_stack[1];
18310     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Q_sr.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18311       __pyx_v_Q_sr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Q_sr.rcbuffer->pybuffer.buf = NULL;
18312       __PYX_ERR(0, 620, __pyx_L1_error)
18313     } else {__pyx_pybuffernd_Q_sr.diminfo[0].strides = __pyx_pybuffernd_Q_sr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Q_sr.diminfo[0].shape = __pyx_pybuffernd_Q_sr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Q_sr.diminfo[1].strides = __pyx_pybuffernd_Q_sr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Q_sr.diminfo[1].shape = __pyx_pybuffernd_Q_sr.rcbuffer->pybuffer.shape[1];
18314     }
18315   }
18316   __pyx_t_4 = 0;
18317   __pyx_v_Q_sr = ((PyArrayObject *)__pyx_t_1);
18318   __pyx_t_1 = 0;
18319 
18320   /* "GPy/models/state_space_cython.pyx":622
18321  *     cdef np.ndarray[DTYPE_t, ndim=2] Q_sr = p_dynamic_callables.Q_srk(k)
18322  *     # Prediction step ->
18323  *     cdef np.ndarray[DTYPE_t, ndim=2] m_pred = p_dynamic_callables.f_a(k, p_m, A) # predicted mean             # <<<<<<<<<<<<<<
18324  *
18325  *     # coavariance prediction have changed:
18326  */
18327   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->f_a(__pyx_v_p_dynamic_callables, __pyx_v_k, ((PyArrayObject *)__pyx_v_p_m), ((PyArrayObject *)__pyx_v_A), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
18328   __Pyx_GOTREF(__pyx_t_1);
18329   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 622, __pyx_L1_error)
18330   __pyx_t_5 = ((PyArrayObject *)__pyx_t_1);
18331   {
18332     __Pyx_BufFmt_StackElem __pyx_stack[1];
18333     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18334       __pyx_v_m_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.buf = NULL;
18335       __PYX_ERR(0, 622, __pyx_L1_error)
18336     } else {__pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
18337     }
18338   }
18339   __pyx_t_5 = 0;
18340   __pyx_v_m_pred = ((PyArrayObject *)__pyx_t_1);
18341   __pyx_t_1 = 0;
18342 
18343   /* "GPy/models/state_space_cython.pyx":625
18344  *
18345  *     # coavariance prediction have changed:
18346  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_1_matr = np.vstack( ( (np.sqrt(S_old)* np.dot(A,V_old)).T , Q_sr.T) )             # <<<<<<<<<<<<<<
18347  *     res = sp.linalg.svd( svd_1_matr,full_matrices=False, compute_uv=True,
18348  *                   overwrite_a=False,check_finite=True)
18349  */
18350   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 625, __pyx_L1_error)
18351   __Pyx_GOTREF(__pyx_t_6);
18352   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_vstack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 625, __pyx_L1_error)
18353   __Pyx_GOTREF(__pyx_t_7);
18354   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18355   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 625, __pyx_L1_error)
18356   __Pyx_GOTREF(__pyx_t_8);
18357   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error)
18358   __Pyx_GOTREF(__pyx_t_9);
18359   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18360   __pyx_t_8 = NULL;
18361   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
18362     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
18363     if (likely(__pyx_t_8)) {
18364       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
18365       __Pyx_INCREF(__pyx_t_8);
18366       __Pyx_INCREF(function);
18367       __Pyx_DECREF_SET(__pyx_t_9, function);
18368     }
18369   }
18370   __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_8, ((PyObject *)__pyx_v_S_old)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_S_old));
18371   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18372   if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 625, __pyx_L1_error)
18373   __Pyx_GOTREF(__pyx_t_6);
18374   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18375   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 625, __pyx_L1_error)
18376   __Pyx_GOTREF(__pyx_t_8);
18377   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error)
18378   __Pyx_GOTREF(__pyx_t_10);
18379   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
18380   __pyx_t_8 = NULL;
18381   __pyx_t_11 = 0;
18382   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
18383     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10);
18384     if (likely(__pyx_t_8)) {
18385       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
18386       __Pyx_INCREF(__pyx_t_8);
18387       __Pyx_INCREF(function);
18388       __Pyx_DECREF_SET(__pyx_t_10, function);
18389       __pyx_t_11 = 1;
18390     }
18391   }
18392   #if CYTHON_FAST_PYCALL
18393   if (PyFunction_Check(__pyx_t_10)) {
18394     PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_V_old)};
18395     __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error)
18396     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18397     __Pyx_GOTREF(__pyx_t_9);
18398   } else
18399   #endif
18400   #if CYTHON_FAST_PYCCALL
18401   if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
18402     PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_A), ((PyObject *)__pyx_v_V_old)};
18403     __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error)
18404     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
18405     __Pyx_GOTREF(__pyx_t_9);
18406   } else
18407   #endif
18408   {
18409     __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 625, __pyx_L1_error)
18410     __Pyx_GOTREF(__pyx_t_12);
18411     if (__pyx_t_8) {
18412       __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_8); __pyx_t_8 = NULL;
18413     }
18414     __Pyx_INCREF(((PyObject *)__pyx_v_A));
18415     __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
18416     PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, ((PyObject *)__pyx_v_A));
18417     __Pyx_INCREF(((PyObject *)__pyx_v_V_old));
18418     __Pyx_GIVEREF(((PyObject *)__pyx_v_V_old));
18419     PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, ((PyObject *)__pyx_v_V_old));
18420     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error)
18421     __Pyx_GOTREF(__pyx_t_9);
18422     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
18423   }
18424   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18425   __pyx_t_10 = PyNumber_Multiply(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error)
18426   __Pyx_GOTREF(__pyx_t_10);
18427   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18428   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
18429   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_T); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 625, __pyx_L1_error)
18430   __Pyx_GOTREF(__pyx_t_9);
18431   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18432   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Q_sr), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 625, __pyx_L1_error)
18433   __Pyx_GOTREF(__pyx_t_10);
18434   __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 625, __pyx_L1_error)
18435   __Pyx_GOTREF(__pyx_t_6);
18436   __Pyx_GIVEREF(__pyx_t_9);
18437   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
18438   __Pyx_GIVEREF(__pyx_t_10);
18439   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10);
18440   __pyx_t_9 = 0;
18441   __pyx_t_10 = 0;
18442   __pyx_t_10 = NULL;
18443   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
18444     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
18445     if (likely(__pyx_t_10)) {
18446       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
18447       __Pyx_INCREF(__pyx_t_10);
18448       __Pyx_INCREF(function);
18449       __Pyx_DECREF_SET(__pyx_t_7, function);
18450     }
18451   }
18452   __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
18453   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
18454   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18455   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
18456   __Pyx_GOTREF(__pyx_t_1);
18457   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18458   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 625, __pyx_L1_error)
18459   __pyx_t_13 = ((PyArrayObject *)__pyx_t_1);
18460   {
18461     __Pyx_BufFmt_StackElem __pyx_stack[1];
18462     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer, (PyObject*)__pyx_t_13, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18463       __pyx_v_svd_1_matr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer.buf = NULL;
18464       __PYX_ERR(0, 625, __pyx_L1_error)
18465     } else {__pyx_pybuffernd_svd_1_matr.diminfo[0].strides = __pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_svd_1_matr.diminfo[0].shape = __pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_svd_1_matr.diminfo[1].strides = __pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_svd_1_matr.diminfo[1].shape = __pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer.shape[1];
18466     }
18467   }
18468   __pyx_t_13 = 0;
18469   __pyx_v_svd_1_matr = ((PyArrayObject *)__pyx_t_1);
18470   __pyx_t_1 = 0;
18471 
18472   /* "GPy/models/state_space_cython.pyx":626
18473  *     # coavariance prediction have changed:
18474  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_1_matr = np.vstack( ( (np.sqrt(S_old)* np.dot(A,V_old)).T , Q_sr.T) )
18475  *     res = sp.linalg.svd( svd_1_matr,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
18476  *                   overwrite_a=False,check_finite=True)
18477  *     # (U,S,Vh)
18478  */
18479   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
18480   __Pyx_GOTREF(__pyx_t_1);
18481   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_linalg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error)
18482   __Pyx_GOTREF(__pyx_t_7);
18483   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18484   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_svd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
18485   __Pyx_GOTREF(__pyx_t_1);
18486   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18487   __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error)
18488   __Pyx_GOTREF(__pyx_t_7);
18489   __Pyx_INCREF(((PyObject *)__pyx_v_svd_1_matr));
18490   __Pyx_GIVEREF(((PyObject *)__pyx_v_svd_1_matr));
18491   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_svd_1_matr));
18492   __pyx_t_6 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 626, __pyx_L1_error)
18493   __Pyx_GOTREF(__pyx_t_6);
18494   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
18495   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
18496 
18497   /* "GPy/models/state_space_cython.pyx":627
18498  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_1_matr = np.vstack( ( (np.sqrt(S_old)* np.dot(A,V_old)).T , Q_sr.T) )
18499  *     res = sp.linalg.svd( svd_1_matr,full_matrices=False, compute_uv=True,
18500  *                   overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
18501  *     # (U,S,Vh)
18502  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]
18503  */
18504   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
18505   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
18506 
18507   /* "GPy/models/state_space_cython.pyx":626
18508  *     # coavariance prediction have changed:
18509  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_1_matr = np.vstack( ( (np.sqrt(S_old)* np.dot(A,V_old)).T , Q_sr.T) )
18510  *     res = sp.linalg.svd( svd_1_matr,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
18511  *                   overwrite_a=False,check_finite=True)
18512  *     # (U,S,Vh)
18513  */
18514   __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 626, __pyx_L1_error)
18515   __Pyx_GOTREF(__pyx_t_10);
18516   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18517   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18518   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18519   __pyx_v_res = __pyx_t_10;
18520   __pyx_t_10 = 0;
18521 
18522   /* "GPy/models/state_space_cython.pyx":629
18523  *                   overwrite_a=False,check_finite=True)
18524  *     # (U,S,Vh)
18525  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]             # <<<<<<<<<<<<<<
18526  *     cdef np.ndarray[DTYPE_t, ndim=1] S = res[1]
18527  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]
18528  */
18529   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L1_error)
18530   __Pyx_GOTREF(__pyx_t_10);
18531   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 629, __pyx_L1_error)
18532   __pyx_t_14 = ((PyArrayObject *)__pyx_t_10);
18533   {
18534     __Pyx_BufFmt_StackElem __pyx_stack[1];
18535     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_14, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18536       __pyx_v_U = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U.rcbuffer->pybuffer.buf = NULL;
18537       __PYX_ERR(0, 629, __pyx_L1_error)
18538     } else {__pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
18539     }
18540   }
18541   __pyx_t_14 = 0;
18542   __pyx_v_U = ((PyArrayObject *)__pyx_t_10);
18543   __pyx_t_10 = 0;
18544 
18545   /* "GPy/models/state_space_cython.pyx":630
18546  *     # (U,S,Vh)
18547  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]
18548  *     cdef np.ndarray[DTYPE_t, ndim=1] S = res[1]             # <<<<<<<<<<<<<<
18549  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]
18550  *     # predicted variance computed by the regular method. For testing
18551  */
18552   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_res, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 630, __pyx_L1_error)
18553   __Pyx_GOTREF(__pyx_t_10);
18554   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 630, __pyx_L1_error)
18555   __pyx_t_15 = ((PyArrayObject *)__pyx_t_10);
18556   {
18557     __Pyx_BufFmt_StackElem __pyx_stack[1];
18558     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18559       __pyx_v_S = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S.rcbuffer->pybuffer.buf = NULL;
18560       __PYX_ERR(0, 630, __pyx_L1_error)
18561     } else {__pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
18562     }
18563   }
18564   __pyx_t_15 = 0;
18565   __pyx_v_S = ((PyArrayObject *)__pyx_t_10);
18566   __pyx_t_10 = 0;
18567 
18568   /* "GPy/models/state_space_cython.pyx":631
18569  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]
18570  *     cdef np.ndarray[DTYPE_t, ndim=1] S = res[1]
18571  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]             # <<<<<<<<<<<<<<
18572  *     # predicted variance computed by the regular method. For testing
18573  *     #P_pred_tst = A.dot(Prev_cov).dot(A.T) + Q
18574  */
18575   __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_res, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 631, __pyx_L1_error)
18576   __Pyx_GOTREF(__pyx_t_10);
18577   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 631, __pyx_L1_error)
18578   __pyx_t_16 = ((PyArrayObject *)__pyx_t_10);
18579   {
18580     __Pyx_BufFmt_StackElem __pyx_stack[1];
18581     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18582       __pyx_v_Vh = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Vh.rcbuffer->pybuffer.buf = NULL;
18583       __PYX_ERR(0, 631, __pyx_L1_error)
18584     } else {__pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
18585     }
18586   }
18587   __pyx_t_16 = 0;
18588   __pyx_v_Vh = ((PyArrayObject *)__pyx_t_10);
18589   __pyx_t_10 = 0;
18590 
18591   /* "GPy/models/state_space_cython.pyx":634
18592  *     # predicted variance computed by the regular method. For testing
18593  *     #P_pred_tst = A.dot(Prev_cov).dot(A.T) + Q
18594  *     cdef np.ndarray[DTYPE_t, ndim=2]  V_new = Vh.T             # <<<<<<<<<<<<<<
18595  *     cdef np.ndarray[DTYPE_t, ndim=1]  S_new = S**2
18596  *
18597  */
18598   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Vh), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 634, __pyx_L1_error)
18599   __Pyx_GOTREF(__pyx_t_10);
18600   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 634, __pyx_L1_error)
18601   __pyx_t_17 = ((PyArrayObject *)__pyx_t_10);
18602   {
18603     __Pyx_BufFmt_StackElem __pyx_stack[1];
18604     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_new.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18605       __pyx_v_V_new = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_new.rcbuffer->pybuffer.buf = NULL;
18606       __PYX_ERR(0, 634, __pyx_L1_error)
18607     } else {__pyx_pybuffernd_V_new.diminfo[0].strides = __pyx_pybuffernd_V_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_new.diminfo[0].shape = __pyx_pybuffernd_V_new.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_new.diminfo[1].strides = __pyx_pybuffernd_V_new.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_new.diminfo[1].shape = __pyx_pybuffernd_V_new.rcbuffer->pybuffer.shape[1];
18608     }
18609   }
18610   __pyx_t_17 = 0;
18611   __pyx_v_V_new = ((PyArrayObject *)__pyx_t_10);
18612   __pyx_t_10 = 0;
18613 
18614   /* "GPy/models/state_space_cython.pyx":635
18615  *     #P_pred_tst = A.dot(Prev_cov).dot(A.T) + Q
18616  *     cdef np.ndarray[DTYPE_t, ndim=2]  V_new = Vh.T
18617  *     cdef np.ndarray[DTYPE_t, ndim=1]  S_new = S**2             # <<<<<<<<<<<<<<
18618  *
18619  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = np.dot(V_new * S_new, V_new.T) # prediction covariance
18620  */
18621   __pyx_t_10 = PyNumber_Power(((PyObject *)__pyx_v_S), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 635, __pyx_L1_error)
18622   __Pyx_GOTREF(__pyx_t_10);
18623   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 635, __pyx_L1_error)
18624   __pyx_t_18 = ((PyArrayObject *)__pyx_t_10);
18625   {
18626     __Pyx_BufFmt_StackElem __pyx_stack[1];
18627     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S_new.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
18628       __pyx_v_S_new = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S_new.rcbuffer->pybuffer.buf = NULL;
18629       __PYX_ERR(0, 635, __pyx_L1_error)
18630     } else {__pyx_pybuffernd_S_new.diminfo[0].strides = __pyx_pybuffernd_S_new.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S_new.diminfo[0].shape = __pyx_pybuffernd_S_new.rcbuffer->pybuffer.shape[0];
18631     }
18632   }
18633   __pyx_t_18 = 0;
18634   __pyx_v_S_new = ((PyArrayObject *)__pyx_t_10);
18635   __pyx_t_10 = 0;
18636 
18637   /* "GPy/models/state_space_cython.pyx":637
18638  *     cdef np.ndarray[DTYPE_t, ndim=1]  S_new = S**2
18639  *
18640  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = np.dot(V_new * S_new, V_new.T) # prediction covariance             # <<<<<<<<<<<<<<
18641  *     #tuple P_pred = (P_pred, S_new, Vh.T)
18642  *     # Prediction step <-
18643  */
18644   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error)
18645   __Pyx_GOTREF(__pyx_t_6);
18646   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 637, __pyx_L1_error)
18647   __Pyx_GOTREF(__pyx_t_7);
18648   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18649   __pyx_t_6 = PyNumber_Multiply(((PyObject *)__pyx_v_V_new), ((PyObject *)__pyx_v_S_new)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 637, __pyx_L1_error)
18650   __Pyx_GOTREF(__pyx_t_6);
18651   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_V_new), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
18652   __Pyx_GOTREF(__pyx_t_1);
18653   __pyx_t_9 = NULL;
18654   __pyx_t_11 = 0;
18655   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
18656     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
18657     if (likely(__pyx_t_9)) {
18658       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
18659       __Pyx_INCREF(__pyx_t_9);
18660       __Pyx_INCREF(function);
18661       __Pyx_DECREF_SET(__pyx_t_7, function);
18662       __pyx_t_11 = 1;
18663     }
18664   }
18665   #if CYTHON_FAST_PYCALL
18666   if (PyFunction_Check(__pyx_t_7)) {
18667     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_1};
18668     __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
18669     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18670     __Pyx_GOTREF(__pyx_t_10);
18671     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18672     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18673   } else
18674   #endif
18675   #if CYTHON_FAST_PYCCALL
18676   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
18677     PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_t_1};
18678     __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
18679     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
18680     __Pyx_GOTREF(__pyx_t_10);
18681     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18682     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18683   } else
18684   #endif
18685   {
18686     __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 637, __pyx_L1_error)
18687     __Pyx_GOTREF(__pyx_t_12);
18688     if (__pyx_t_9) {
18689       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
18690     }
18691     __Pyx_GIVEREF(__pyx_t_6);
18692     PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_6);
18693     __Pyx_GIVEREF(__pyx_t_1);
18694     PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_1);
18695     __pyx_t_6 = 0;
18696     __pyx_t_1 = 0;
18697     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 637, __pyx_L1_error)
18698     __Pyx_GOTREF(__pyx_t_10);
18699     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
18700   }
18701   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18702   if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 637, __pyx_L1_error)
18703   __pyx_t_19 = ((PyArrayObject *)__pyx_t_10);
18704   {
18705     __Pyx_BufFmt_StackElem __pyx_stack[1];
18706     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18707       __pyx_v_P_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.buf = NULL;
18708       __PYX_ERR(0, 637, __pyx_L1_error)
18709     } else {__pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
18710     }
18711   }
18712   __pyx_t_19 = 0;
18713   __pyx_v_P_pred = ((PyArrayObject *)__pyx_t_10);
18714   __pyx_t_10 = 0;
18715 
18716   /* "GPy/models/state_space_cython.pyx":654
18717  *     cdef np.ndarray[DTYPE_t, ndim=2] dA
18718  *     cdef np.ndarray[DTYPE_t, ndim=2] dQ
18719  *     if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
18720  *         dA_all_params = p_dynamic_callables.dAk(k) # derivatives of A wrt parameters
18721  *         dQ_all_params = p_dynamic_callables.dQk(k) # derivatives of Q wrt parameters
18722  */
18723   __pyx_t_20 = (__pyx_v_calc_grad_log_likelihood != 0);
18724   if (__pyx_t_20) {
18725 
18726     /* "GPy/models/state_space_cython.pyx":655
18727  *     cdef np.ndarray[DTYPE_t, ndim=2] dQ
18728  *     if calc_grad_log_likelihood:
18729  *         dA_all_params = p_dynamic_callables.dAk(k) # derivatives of A wrt parameters             # <<<<<<<<<<<<<<
18730  *         dQ_all_params = p_dynamic_callables.dQk(k) # derivatives of Q wrt parameters
18731  *
18732  */
18733     __pyx_t_10 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->dAk(__pyx_v_p_dynamic_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 655, __pyx_L1_error)
18734     __Pyx_GOTREF(__pyx_t_10);
18735     if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 655, __pyx_L1_error)
18736     __pyx_t_21 = ((PyArrayObject *)__pyx_t_10);
18737     {
18738       __Pyx_BufFmt_StackElem __pyx_stack[1];
18739       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer);
18740       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
18741       if (unlikely(__pyx_t_11 < 0)) {
18742         PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
18743         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dA_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
18744           Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
18745           __Pyx_RaiseBufferFallbackError();
18746         } else {
18747           PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
18748         }
18749         __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
18750       }
18751       __pyx_pybuffernd_dA_all_params.diminfo[0].strides = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dA_all_params.diminfo[0].shape = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dA_all_params.diminfo[1].strides = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dA_all_params.diminfo[1].shape = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dA_all_params.diminfo[2].strides = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dA_all_params.diminfo[2].shape = __pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer.shape[2];
18752       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 655, __pyx_L1_error)
18753     }
18754     __pyx_t_21 = 0;
18755     __pyx_v_dA_all_params = ((PyArrayObject *)__pyx_t_10);
18756     __pyx_t_10 = 0;
18757 
18758     /* "GPy/models/state_space_cython.pyx":656
18759  *     if calc_grad_log_likelihood:
18760  *         dA_all_params = p_dynamic_callables.dAk(k) # derivatives of A wrt parameters
18761  *         dQ_all_params = p_dynamic_callables.dQk(k) # derivatives of Q wrt parameters             # <<<<<<<<<<<<<<
18762  *
18763  *         param_number = p_dP.shape[2]
18764  */
18765     __pyx_t_10 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->dQk(__pyx_v_p_dynamic_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 656, __pyx_L1_error)
18766     __Pyx_GOTREF(__pyx_t_10);
18767     if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 656, __pyx_L1_error)
18768     __pyx_t_25 = ((PyArrayObject *)__pyx_t_10);
18769     {
18770       __Pyx_BufFmt_StackElem __pyx_stack[1];
18771       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer);
18772       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
18773       if (unlikely(__pyx_t_11 < 0)) {
18774         PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
18775         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dQ_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
18776           Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
18777           __Pyx_RaiseBufferFallbackError();
18778         } else {
18779           PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
18780         }
18781         __pyx_t_24 = __pyx_t_23 = __pyx_t_22 = 0;
18782       }
18783       __pyx_pybuffernd_dQ_all_params.diminfo[0].strides = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dQ_all_params.diminfo[0].shape = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dQ_all_params.diminfo[1].strides = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dQ_all_params.diminfo[1].shape = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dQ_all_params.diminfo[2].strides = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dQ_all_params.diminfo[2].shape = __pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer.shape[2];
18784       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
18785     }
18786     __pyx_t_25 = 0;
18787     __pyx_v_dQ_all_params = ((PyArrayObject *)__pyx_t_10);
18788     __pyx_t_10 = 0;
18789 
18790     /* "GPy/models/state_space_cython.pyx":658
18791  *         dQ_all_params = p_dynamic_callables.dQk(k) # derivatives of Q wrt parameters
18792  *
18793  *         param_number = p_dP.shape[2]             # <<<<<<<<<<<<<<
18794  *
18795  *         # p_dm, p_dP - derivatives form the previoius step
18796  */
18797     __pyx_v_param_number = (__pyx_v_p_dP->dimensions[2]);
18798 
18799     /* "GPy/models/state_space_cython.pyx":661
18800  *
18801  *         # p_dm, p_dP - derivatives form the previoius step
18802  *         dm_pred = np.empty((p_dm.shape[0], p_dm.shape[1], p_dm.shape[2]), dtype = DTYPE)             # <<<<<<<<<<<<<<
18803  *         dP_pred = np.empty((p_dP.shape[0], p_dP.shape[1], p_dP.shape[2]), dtype = DTYPE)
18804  *
18805  */
18806     __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error)
18807     __Pyx_GOTREF(__pyx_t_10);
18808     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 661, __pyx_L1_error)
18809     __Pyx_GOTREF(__pyx_t_7);
18810     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18811     __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dm->dimensions[0])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 661, __pyx_L1_error)
18812     __Pyx_GOTREF(__pyx_t_10);
18813     __pyx_t_12 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dm->dimensions[1])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error)
18814     __Pyx_GOTREF(__pyx_t_12);
18815     __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dm->dimensions[2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
18816     __Pyx_GOTREF(__pyx_t_1);
18817     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
18818     __Pyx_GOTREF(__pyx_t_6);
18819     __Pyx_GIVEREF(__pyx_t_10);
18820     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10);
18821     __Pyx_GIVEREF(__pyx_t_12);
18822     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_12);
18823     __Pyx_GIVEREF(__pyx_t_1);
18824     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
18825     __pyx_t_10 = 0;
18826     __pyx_t_12 = 0;
18827     __pyx_t_1 = 0;
18828     __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 661, __pyx_L1_error)
18829     __Pyx_GOTREF(__pyx_t_1);
18830     __Pyx_GIVEREF(__pyx_t_6);
18831     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
18832     __pyx_t_6 = 0;
18833     __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 661, __pyx_L1_error)
18834     __Pyx_GOTREF(__pyx_t_6);
18835     __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error)
18836     __Pyx_GOTREF(__pyx_t_12);
18837     if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_12) < 0) __PYX_ERR(0, 661, __pyx_L1_error)
18838     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
18839     __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 661, __pyx_L1_error)
18840     __Pyx_GOTREF(__pyx_t_12);
18841     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18842     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18843     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18844     if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 661, __pyx_L1_error)
18845     __pyx_t_26 = ((PyArrayObject *)__pyx_t_12);
18846     {
18847       __Pyx_BufFmt_StackElem __pyx_stack[1];
18848       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
18849       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
18850       if (unlikely(__pyx_t_11 < 0)) {
18851         PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
18852         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
18853           Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
18854           __Pyx_RaiseBufferFallbackError();
18855         } else {
18856           PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
18857         }
18858         __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
18859       }
18860       __pyx_pybuffernd_dm_pred.diminfo[0].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_pred.diminfo[0].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_pred.diminfo[1].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_pred.diminfo[1].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_pred.diminfo[2].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_pred.diminfo[2].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[2];
18861       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 661, __pyx_L1_error)
18862     }
18863     __pyx_t_26 = 0;
18864     __pyx_v_dm_pred = ((PyArrayObject *)__pyx_t_12);
18865     __pyx_t_12 = 0;
18866 
18867     /* "GPy/models/state_space_cython.pyx":662
18868  *         # p_dm, p_dP - derivatives form the previoius step
18869  *         dm_pred = np.empty((p_dm.shape[0], p_dm.shape[1], p_dm.shape[2]), dtype = DTYPE)
18870  *         dP_pred = np.empty((p_dP.shape[0], p_dP.shape[1], p_dP.shape[2]), dtype = DTYPE)             # <<<<<<<<<<<<<<
18871  *
18872  *         for j in range(param_number):
18873  */
18874     __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 662, __pyx_L1_error)
18875     __Pyx_GOTREF(__pyx_t_12);
18876     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_empty); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
18877     __Pyx_GOTREF(__pyx_t_6);
18878     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
18879     __pyx_t_12 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dP->dimensions[0])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 662, __pyx_L1_error)
18880     __Pyx_GOTREF(__pyx_t_12);
18881     __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dP->dimensions[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
18882     __Pyx_GOTREF(__pyx_t_1);
18883     __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_p_dP->dimensions[2])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error)
18884     __Pyx_GOTREF(__pyx_t_7);
18885     __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error)
18886     __Pyx_GOTREF(__pyx_t_10);
18887     __Pyx_GIVEREF(__pyx_t_12);
18888     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
18889     __Pyx_GIVEREF(__pyx_t_1);
18890     PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_1);
18891     __Pyx_GIVEREF(__pyx_t_7);
18892     PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7);
18893     __pyx_t_12 = 0;
18894     __pyx_t_1 = 0;
18895     __pyx_t_7 = 0;
18896     __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error)
18897     __Pyx_GOTREF(__pyx_t_7);
18898     __Pyx_GIVEREF(__pyx_t_10);
18899     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
18900     __pyx_t_10 = 0;
18901     __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 662, __pyx_L1_error)
18902     __Pyx_GOTREF(__pyx_t_10);
18903     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
18904     __Pyx_GOTREF(__pyx_t_1);
18905     if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 662, __pyx_L1_error)
18906     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
18907     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
18908     __Pyx_GOTREF(__pyx_t_1);
18909     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
18910     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
18911     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18912     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 662, __pyx_L1_error)
18913     __pyx_t_27 = ((PyArrayObject *)__pyx_t_1);
18914     {
18915       __Pyx_BufFmt_StackElem __pyx_stack[1];
18916       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
18917       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
18918       if (unlikely(__pyx_t_11 < 0)) {
18919         PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
18920         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
18921           Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
18922           __Pyx_RaiseBufferFallbackError();
18923         } else {
18924           PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
18925         }
18926         __pyx_t_24 = __pyx_t_23 = __pyx_t_22 = 0;
18927       }
18928       __pyx_pybuffernd_dP_pred.diminfo[0].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_pred.diminfo[0].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_pred.diminfo[1].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_pred.diminfo[1].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_pred.diminfo[2].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_pred.diminfo[2].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[2];
18929       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 662, __pyx_L1_error)
18930     }
18931     __pyx_t_27 = 0;
18932     __pyx_v_dP_pred = ((PyArrayObject *)__pyx_t_1);
18933     __pyx_t_1 = 0;
18934 
18935     /* "GPy/models/state_space_cython.pyx":664
18936  *         dP_pred = np.empty((p_dP.shape[0], p_dP.shape[1], p_dP.shape[2]), dtype = DTYPE)
18937  *
18938  *         for j in range(param_number):             # <<<<<<<<<<<<<<
18939  *             dA = dA_all_params[:,:,j]
18940  *             dQ = dQ_all_params[:,:,j]
18941  */
18942     __pyx_t_11 = __pyx_v_param_number;
18943     __pyx_t_28 = __pyx_t_11;
18944     for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
18945       __pyx_v_j = __pyx_t_29;
18946 
18947       /* "GPy/models/state_space_cython.pyx":665
18948  *
18949  *         for j in range(param_number):
18950  *             dA = dA_all_params[:,:,j]             # <<<<<<<<<<<<<<
18951  *             dQ = dQ_all_params[:,:,j]
18952  *
18953  */
18954       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
18955       __Pyx_GOTREF(__pyx_t_1);
18956       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 665, __pyx_L1_error)
18957       __Pyx_GOTREF(__pyx_t_10);
18958       __Pyx_INCREF(__pyx_slice__10);
18959       __Pyx_GIVEREF(__pyx_slice__10);
18960       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__10);
18961       __Pyx_INCREF(__pyx_slice__10);
18962       __Pyx_GIVEREF(__pyx_slice__10);
18963       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__10);
18964       __Pyx_GIVEREF(__pyx_t_1);
18965       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
18966       __pyx_t_1 = 0;
18967       __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dA_all_params), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
18968       __Pyx_GOTREF(__pyx_t_1);
18969       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
18970       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 665, __pyx_L1_error)
18971       __pyx_t_30 = ((PyArrayObject *)__pyx_t_1);
18972       {
18973         __Pyx_BufFmt_StackElem __pyx_stack[1];
18974         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA.rcbuffer->pybuffer);
18975         __pyx_t_31 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dA.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
18976         if (unlikely(__pyx_t_31 < 0)) {
18977           PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
18978           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dA.rcbuffer->pybuffer, (PyObject*)__pyx_v_dA, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
18979             Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
18980             __Pyx_RaiseBufferFallbackError();
18981           } else {
18982             PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
18983           }
18984           __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
18985         }
18986         __pyx_pybuffernd_dA.diminfo[0].strides = __pyx_pybuffernd_dA.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dA.diminfo[0].shape = __pyx_pybuffernd_dA.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dA.diminfo[1].strides = __pyx_pybuffernd_dA.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dA.diminfo[1].shape = __pyx_pybuffernd_dA.rcbuffer->pybuffer.shape[1];
18987         if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 665, __pyx_L1_error)
18988       }
18989       __pyx_t_30 = 0;
18990       __Pyx_XDECREF_SET(__pyx_v_dA, ((PyArrayObject *)__pyx_t_1));
18991       __pyx_t_1 = 0;
18992 
18993       /* "GPy/models/state_space_cython.pyx":666
18994  *         for j in range(param_number):
18995  *             dA = dA_all_params[:,:,j]
18996  *             dQ = dQ_all_params[:,:,j]             # <<<<<<<<<<<<<<
18997  *
18998  *             dm_pred[:,:,j] = np.dot(dA, p_m) + np.dot(A, p_dm[:,:,j])
18999  */
19000       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
19001       __Pyx_GOTREF(__pyx_t_1);
19002       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 666, __pyx_L1_error)
19003       __Pyx_GOTREF(__pyx_t_10);
19004       __Pyx_INCREF(__pyx_slice__10);
19005       __Pyx_GIVEREF(__pyx_slice__10);
19006       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__10);
19007       __Pyx_INCREF(__pyx_slice__10);
19008       __Pyx_GIVEREF(__pyx_slice__10);
19009       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__10);
19010       __Pyx_GIVEREF(__pyx_t_1);
19011       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1);
19012       __pyx_t_1 = 0;
19013       __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dQ_all_params), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
19014       __Pyx_GOTREF(__pyx_t_1);
19015       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19016       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 666, __pyx_L1_error)
19017       __pyx_t_32 = ((PyArrayObject *)__pyx_t_1);
19018       {
19019         __Pyx_BufFmt_StackElem __pyx_stack[1];
19020         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
19021         __pyx_t_31 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
19022         if (unlikely(__pyx_t_31 < 0)) {
19023           PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
19024           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer, (PyObject*)__pyx_v_dQ, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
19025             Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
19026             __Pyx_RaiseBufferFallbackError();
19027           } else {
19028             PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
19029           }
19030           __pyx_t_24 = __pyx_t_23 = __pyx_t_22 = 0;
19031         }
19032         __pyx_pybuffernd_dQ.diminfo[0].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dQ.diminfo[0].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dQ.diminfo[1].strides = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dQ.diminfo[1].shape = __pyx_pybuffernd_dQ.rcbuffer->pybuffer.shape[1];
19033         if (unlikely(__pyx_t_31 < 0)) __PYX_ERR(0, 666, __pyx_L1_error)
19034       }
19035       __pyx_t_32 = 0;
19036       __Pyx_XDECREF_SET(__pyx_v_dQ, ((PyArrayObject *)__pyx_t_1));
19037       __pyx_t_1 = 0;
19038 
19039       /* "GPy/models/state_space_cython.pyx":668
19040  *             dQ = dQ_all_params[:,:,j]
19041  *
19042  *             dm_pred[:,:,j] = np.dot(dA, p_m) + np.dot(A, p_dm[:,:,j])             # <<<<<<<<<<<<<<
19043  *             # prediction step derivatives for current parameter:
19044  *
19045  */
19046       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
19047       __Pyx_GOTREF(__pyx_t_10);
19048       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
19049       __Pyx_GOTREF(__pyx_t_7);
19050       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19051       __pyx_t_10 = NULL;
19052       __pyx_t_31 = 0;
19053       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
19054         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
19055         if (likely(__pyx_t_10)) {
19056           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19057           __Pyx_INCREF(__pyx_t_10);
19058           __Pyx_INCREF(function);
19059           __Pyx_DECREF_SET(__pyx_t_7, function);
19060           __pyx_t_31 = 1;
19061         }
19062       }
19063       #if CYTHON_FAST_PYCALL
19064       if (PyFunction_Check(__pyx_t_7)) {
19065         PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_dA), ((PyObject *)__pyx_v_p_m)};
19066         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
19067         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
19068         __Pyx_GOTREF(__pyx_t_1);
19069       } else
19070       #endif
19071       #if CYTHON_FAST_PYCCALL
19072       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
19073         PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_dA), ((PyObject *)__pyx_v_p_m)};
19074         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
19075         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
19076         __Pyx_GOTREF(__pyx_t_1);
19077       } else
19078       #endif
19079       {
19080         __pyx_t_6 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
19081         __Pyx_GOTREF(__pyx_t_6);
19082         if (__pyx_t_10) {
19083           __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); __pyx_t_10 = NULL;
19084         }
19085         __Pyx_INCREF(((PyObject *)__pyx_v_dA));
19086         __Pyx_GIVEREF(((PyObject *)__pyx_v_dA));
19087         PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_31, ((PyObject *)__pyx_v_dA));
19088         __Pyx_INCREF(((PyObject *)__pyx_v_p_m));
19089         __Pyx_GIVEREF(((PyObject *)__pyx_v_p_m));
19090         PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_31, ((PyObject *)__pyx_v_p_m));
19091         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
19092         __Pyx_GOTREF(__pyx_t_1);
19093         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19094       }
19095       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19096       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
19097       __Pyx_GOTREF(__pyx_t_6);
19098       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
19099       __Pyx_GOTREF(__pyx_t_10);
19100       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19101       __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
19102       __Pyx_GOTREF(__pyx_t_6);
19103       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 668, __pyx_L1_error)
19104       __Pyx_GOTREF(__pyx_t_12);
19105       __Pyx_INCREF(__pyx_slice__10);
19106       __Pyx_GIVEREF(__pyx_slice__10);
19107       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
19108       __Pyx_INCREF(__pyx_slice__10);
19109       __Pyx_GIVEREF(__pyx_slice__10);
19110       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
19111       __Pyx_GIVEREF(__pyx_t_6);
19112       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_6);
19113       __pyx_t_6 = 0;
19114       __pyx_t_6 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_p_dm), __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
19115       __Pyx_GOTREF(__pyx_t_6);
19116       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19117       __pyx_t_12 = NULL;
19118       __pyx_t_31 = 0;
19119       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
19120         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
19121         if (likely(__pyx_t_12)) {
19122           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
19123           __Pyx_INCREF(__pyx_t_12);
19124           __Pyx_INCREF(function);
19125           __Pyx_DECREF_SET(__pyx_t_10, function);
19126           __pyx_t_31 = 1;
19127         }
19128       }
19129       #if CYTHON_FAST_PYCALL
19130       if (PyFunction_Check(__pyx_t_10)) {
19131         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_A), __pyx_t_6};
19132         __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
19133         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19134         __Pyx_GOTREF(__pyx_t_7);
19135         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19136       } else
19137       #endif
19138       #if CYTHON_FAST_PYCCALL
19139       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
19140         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_A), __pyx_t_6};
19141         __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
19142         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19143         __Pyx_GOTREF(__pyx_t_7);
19144         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19145       } else
19146       #endif
19147       {
19148         __pyx_t_9 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 668, __pyx_L1_error)
19149         __Pyx_GOTREF(__pyx_t_9);
19150         if (__pyx_t_12) {
19151           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
19152         }
19153         __Pyx_INCREF(((PyObject *)__pyx_v_A));
19154         __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
19155         PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_31, ((PyObject *)__pyx_v_A));
19156         __Pyx_GIVEREF(__pyx_t_6);
19157         PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_31, __pyx_t_6);
19158         __pyx_t_6 = 0;
19159         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
19160         __Pyx_GOTREF(__pyx_t_7);
19161         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19162       }
19163       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19164       __pyx_t_10 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 668, __pyx_L1_error)
19165       __Pyx_GOTREF(__pyx_t_10);
19166       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19167       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19168       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 668, __pyx_L1_error)
19169       __Pyx_GOTREF(__pyx_t_7);
19170       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
19171       __Pyx_GOTREF(__pyx_t_1);
19172       __Pyx_INCREF(__pyx_slice__10);
19173       __Pyx_GIVEREF(__pyx_slice__10);
19174       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__10);
19175       __Pyx_INCREF(__pyx_slice__10);
19176       __Pyx_GIVEREF(__pyx_slice__10);
19177       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
19178       __Pyx_GIVEREF(__pyx_t_7);
19179       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
19180       __pyx_t_7 = 0;
19181       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dm_pred), __pyx_t_1, __pyx_t_10) < 0)) __PYX_ERR(0, 668, __pyx_L1_error)
19182       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19183       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19184 
19185       /* "GPy/models/state_space_cython.pyx":671
19186  *             # prediction step derivatives for current parameter:
19187  *
19188  *             dP_pred[:,:,j] = np.dot( dA ,np.dot(Prev_cov, A.T))             # <<<<<<<<<<<<<<
19189  *             dP_pred[:,:,j] += dP_pred[:,:,j].T
19190  *             dP_pred[:,:,j] += np.dot( A ,np.dot( p_dP[:,:,j] , A.T)) + dQ
19191  */
19192       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
19193       __Pyx_GOTREF(__pyx_t_1);
19194       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
19195       __Pyx_GOTREF(__pyx_t_7);
19196       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19197       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error)
19198       __Pyx_GOTREF(__pyx_t_9);
19199       __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error)
19200       __Pyx_GOTREF(__pyx_t_6);
19201       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19202       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_A), __pyx_n_s_T); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 671, __pyx_L1_error)
19203       __Pyx_GOTREF(__pyx_t_9);
19204       __pyx_t_12 = NULL;
19205       __pyx_t_31 = 0;
19206       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19207         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
19208         if (likely(__pyx_t_12)) {
19209           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19210           __Pyx_INCREF(__pyx_t_12);
19211           __Pyx_INCREF(function);
19212           __Pyx_DECREF_SET(__pyx_t_6, function);
19213           __pyx_t_31 = 1;
19214         }
19215       }
19216       #if CYTHON_FAST_PYCALL
19217       if (PyFunction_Check(__pyx_t_6)) {
19218         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_Prev_cov), __pyx_t_9};
19219         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
19220         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19221         __Pyx_GOTREF(__pyx_t_1);
19222         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19223       } else
19224       #endif
19225       #if CYTHON_FAST_PYCCALL
19226       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
19227         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_Prev_cov), __pyx_t_9};
19228         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
19229         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19230         __Pyx_GOTREF(__pyx_t_1);
19231         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19232       } else
19233       #endif
19234       {
19235         __pyx_t_8 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error)
19236         __Pyx_GOTREF(__pyx_t_8);
19237         if (__pyx_t_12) {
19238           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12); __pyx_t_12 = NULL;
19239         }
19240         __Pyx_INCREF(((PyObject *)__pyx_v_Prev_cov));
19241         __Pyx_GIVEREF(((PyObject *)__pyx_v_Prev_cov));
19242         PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_31, ((PyObject *)__pyx_v_Prev_cov));
19243         __Pyx_GIVEREF(__pyx_t_9);
19244         PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_31, __pyx_t_9);
19245         __pyx_t_9 = 0;
19246         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 671, __pyx_L1_error)
19247         __Pyx_GOTREF(__pyx_t_1);
19248         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19249       }
19250       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19251       __pyx_t_6 = NULL;
19252       __pyx_t_31 = 0;
19253       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
19254         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
19255         if (likely(__pyx_t_6)) {
19256           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
19257           __Pyx_INCREF(__pyx_t_6);
19258           __Pyx_INCREF(function);
19259           __Pyx_DECREF_SET(__pyx_t_7, function);
19260           __pyx_t_31 = 1;
19261         }
19262       }
19263       #if CYTHON_FAST_PYCALL
19264       if (PyFunction_Check(__pyx_t_7)) {
19265         PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_dA), __pyx_t_1};
19266         __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 671, __pyx_L1_error)
19267         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19268         __Pyx_GOTREF(__pyx_t_10);
19269         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19270       } else
19271       #endif
19272       #if CYTHON_FAST_PYCCALL
19273       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
19274         PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_dA), __pyx_t_1};
19275         __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 671, __pyx_L1_error)
19276         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
19277         __Pyx_GOTREF(__pyx_t_10);
19278         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19279       } else
19280       #endif
19281       {
19282         __pyx_t_8 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error)
19283         __Pyx_GOTREF(__pyx_t_8);
19284         if (__pyx_t_6) {
19285           __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
19286         }
19287         __Pyx_INCREF(((PyObject *)__pyx_v_dA));
19288         __Pyx_GIVEREF(((PyObject *)__pyx_v_dA));
19289         PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_31, ((PyObject *)__pyx_v_dA));
19290         __Pyx_GIVEREF(__pyx_t_1);
19291         PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_31, __pyx_t_1);
19292         __pyx_t_1 = 0;
19293         __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 671, __pyx_L1_error)
19294         __Pyx_GOTREF(__pyx_t_10);
19295         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19296       }
19297       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19298       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error)
19299       __Pyx_GOTREF(__pyx_t_7);
19300       __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error)
19301       __Pyx_GOTREF(__pyx_t_8);
19302       __Pyx_INCREF(__pyx_slice__10);
19303       __Pyx_GIVEREF(__pyx_slice__10);
19304       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_slice__10);
19305       __Pyx_INCREF(__pyx_slice__10);
19306       __Pyx_GIVEREF(__pyx_slice__10);
19307       PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice__10);
19308       __Pyx_GIVEREF(__pyx_t_7);
19309       PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
19310       __pyx_t_7 = 0;
19311       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_8, __pyx_t_10) < 0)) __PYX_ERR(0, 671, __pyx_L1_error)
19312       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19313       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19314 
19315       /* "GPy/models/state_space_cython.pyx":672
19316  *
19317  *             dP_pred[:,:,j] = np.dot( dA ,np.dot(Prev_cov, A.T))
19318  *             dP_pred[:,:,j] += dP_pred[:,:,j].T             # <<<<<<<<<<<<<<
19319  *             dP_pred[:,:,j] += np.dot( A ,np.dot( p_dP[:,:,j] , A.T)) + dQ
19320  *
19321  */
19322       __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 672, __pyx_L1_error)
19323       __Pyx_GOTREF(__pyx_t_10);
19324       __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error)
19325       __Pyx_GOTREF(__pyx_t_8);
19326       __Pyx_INCREF(__pyx_slice__10);
19327       __Pyx_GIVEREF(__pyx_slice__10);
19328       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_slice__10);
19329       __Pyx_INCREF(__pyx_slice__10);
19330       __Pyx_GIVEREF(__pyx_slice__10);
19331       PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice__10);
19332       __Pyx_GIVEREF(__pyx_t_10);
19333       PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_10);
19334       __pyx_t_10 = 0;
19335       __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 672, __pyx_L1_error)
19336       __Pyx_GOTREF(__pyx_t_10);
19337       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error)
19338       __Pyx_GOTREF(__pyx_t_7);
19339       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
19340       __Pyx_GOTREF(__pyx_t_1);
19341       __Pyx_INCREF(__pyx_slice__10);
19342       __Pyx_GIVEREF(__pyx_slice__10);
19343       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__10);
19344       __Pyx_INCREF(__pyx_slice__10);
19345       __Pyx_GIVEREF(__pyx_slice__10);
19346       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
19347       __Pyx_GIVEREF(__pyx_t_7);
19348       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
19349       __pyx_t_7 = 0;
19350       __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error)
19351       __Pyx_GOTREF(__pyx_t_7);
19352       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19353       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 672, __pyx_L1_error)
19354       __Pyx_GOTREF(__pyx_t_1);
19355       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19356       __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_t_10, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 672, __pyx_L1_error)
19357       __Pyx_GOTREF(__pyx_t_7);
19358       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19359       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19360       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_8, __pyx_t_7) < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
19361       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19362       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19363 
19364       /* "GPy/models/state_space_cython.pyx":673
19365  *             dP_pred[:,:,j] = np.dot( dA ,np.dot(Prev_cov, A.T))
19366  *             dP_pred[:,:,j] += dP_pred[:,:,j].T
19367  *             dP_pred[:,:,j] += np.dot( A ,np.dot( p_dP[:,:,j] , A.T)) + dQ             # <<<<<<<<<<<<<<
19368  *
19369  *             dP_pred[:,:,j] = 0.5*(dP_pred[:,:,j] + dP_pred[:,:,j].T) #symmetrize
19370  */
19371       __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error)
19372       __Pyx_GOTREF(__pyx_t_8);
19373       __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 673, __pyx_L1_error)
19374       __Pyx_GOTREF(__pyx_t_7);
19375       __Pyx_INCREF(__pyx_slice__10);
19376       __Pyx_GIVEREF(__pyx_slice__10);
19377       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__10);
19378       __Pyx_INCREF(__pyx_slice__10);
19379       __Pyx_GIVEREF(__pyx_slice__10);
19380       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_slice__10);
19381       __Pyx_GIVEREF(__pyx_t_8);
19382       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_8);
19383       __pyx_t_8 = 0;
19384       __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error)
19385       __Pyx_GOTREF(__pyx_t_8);
19386       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error)
19387       __Pyx_GOTREF(__pyx_t_10);
19388       __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
19389       __Pyx_GOTREF(__pyx_t_6);
19390       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19391       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 673, __pyx_L1_error)
19392       __Pyx_GOTREF(__pyx_t_9);
19393       __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L1_error)
19394       __Pyx_GOTREF(__pyx_t_12);
19395       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19396       __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 673, __pyx_L1_error)
19397       __Pyx_GOTREF(__pyx_t_9);
19398       __pyx_t_33 = PyTuple_New(3); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 673, __pyx_L1_error)
19399       __Pyx_GOTREF(__pyx_t_33);
19400       __Pyx_INCREF(__pyx_slice__10);
19401       __Pyx_GIVEREF(__pyx_slice__10);
19402       PyTuple_SET_ITEM(__pyx_t_33, 0, __pyx_slice__10);
19403       __Pyx_INCREF(__pyx_slice__10);
19404       __Pyx_GIVEREF(__pyx_slice__10);
19405       PyTuple_SET_ITEM(__pyx_t_33, 1, __pyx_slice__10);
19406       __Pyx_GIVEREF(__pyx_t_9);
19407       PyTuple_SET_ITEM(__pyx_t_33, 2, __pyx_t_9);
19408       __pyx_t_9 = 0;
19409       __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_p_dP), __pyx_t_33); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 673, __pyx_L1_error)
19410       __Pyx_GOTREF(__pyx_t_9);
19411       __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
19412       __pyx_t_33 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_A), __pyx_n_s_T); if (unlikely(!__pyx_t_33)) __PYX_ERR(0, 673, __pyx_L1_error)
19413       __Pyx_GOTREF(__pyx_t_33);
19414       __pyx_t_34 = NULL;
19415       __pyx_t_31 = 0;
19416       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
19417         __pyx_t_34 = PyMethod_GET_SELF(__pyx_t_12);
19418         if (likely(__pyx_t_34)) {
19419           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
19420           __Pyx_INCREF(__pyx_t_34);
19421           __Pyx_INCREF(function);
19422           __Pyx_DECREF_SET(__pyx_t_12, function);
19423           __pyx_t_31 = 1;
19424         }
19425       }
19426       #if CYTHON_FAST_PYCALL
19427       if (PyFunction_Check(__pyx_t_12)) {
19428         PyObject *__pyx_temp[3] = {__pyx_t_34, __pyx_t_9, __pyx_t_33};
19429         __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error)
19430         __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
19431         __Pyx_GOTREF(__pyx_t_10);
19432         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19433         __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
19434       } else
19435       #endif
19436       #if CYTHON_FAST_PYCCALL
19437       if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
19438         PyObject *__pyx_temp[3] = {__pyx_t_34, __pyx_t_9, __pyx_t_33};
19439         __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error)
19440         __Pyx_XDECREF(__pyx_t_34); __pyx_t_34 = 0;
19441         __Pyx_GOTREF(__pyx_t_10);
19442         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
19443         __Pyx_DECREF(__pyx_t_33); __pyx_t_33 = 0;
19444       } else
19445       #endif
19446       {
19447         __pyx_t_35 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 673, __pyx_L1_error)
19448         __Pyx_GOTREF(__pyx_t_35);
19449         if (__pyx_t_34) {
19450           __Pyx_GIVEREF(__pyx_t_34); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_34); __pyx_t_34 = NULL;
19451         }
19452         __Pyx_GIVEREF(__pyx_t_9);
19453         PyTuple_SET_ITEM(__pyx_t_35, 0+__pyx_t_31, __pyx_t_9);
19454         __Pyx_GIVEREF(__pyx_t_33);
19455         PyTuple_SET_ITEM(__pyx_t_35, 1+__pyx_t_31, __pyx_t_33);
19456         __pyx_t_9 = 0;
19457         __pyx_t_33 = 0;
19458         __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_35, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 673, __pyx_L1_error)
19459         __Pyx_GOTREF(__pyx_t_10);
19460         __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
19461       }
19462       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
19463       __pyx_t_12 = NULL;
19464       __pyx_t_31 = 0;
19465       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
19466         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
19467         if (likely(__pyx_t_12)) {
19468           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
19469           __Pyx_INCREF(__pyx_t_12);
19470           __Pyx_INCREF(function);
19471           __Pyx_DECREF_SET(__pyx_t_6, function);
19472           __pyx_t_31 = 1;
19473         }
19474       }
19475       #if CYTHON_FAST_PYCALL
19476       if (PyFunction_Check(__pyx_t_6)) {
19477         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_A), __pyx_t_10};
19478         __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
19479         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19480         __Pyx_GOTREF(__pyx_t_1);
19481         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19482       } else
19483       #endif
19484       #if CYTHON_FAST_PYCCALL
19485       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
19486         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_A), __pyx_t_10};
19487         __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_31, 2+__pyx_t_31); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
19488         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
19489         __Pyx_GOTREF(__pyx_t_1);
19490         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
19491       } else
19492       #endif
19493       {
19494         __pyx_t_35 = PyTuple_New(2+__pyx_t_31); if (unlikely(!__pyx_t_35)) __PYX_ERR(0, 673, __pyx_L1_error)
19495         __Pyx_GOTREF(__pyx_t_35);
19496         if (__pyx_t_12) {
19497           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_35, 0, __pyx_t_12); __pyx_t_12 = NULL;
19498         }
19499         __Pyx_INCREF(((PyObject *)__pyx_v_A));
19500         __Pyx_GIVEREF(((PyObject *)__pyx_v_A));
19501         PyTuple_SET_ITEM(__pyx_t_35, 0+__pyx_t_31, ((PyObject *)__pyx_v_A));
19502         __Pyx_GIVEREF(__pyx_t_10);
19503         PyTuple_SET_ITEM(__pyx_t_35, 1+__pyx_t_31, __pyx_t_10);
19504         __pyx_t_10 = 0;
19505         __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
19506         __Pyx_GOTREF(__pyx_t_1);
19507         __Pyx_DECREF(__pyx_t_35); __pyx_t_35 = 0;
19508       }
19509       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19510       __pyx_t_6 = PyNumber_Add(__pyx_t_1, ((PyObject *)__pyx_v_dQ)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
19511       __Pyx_GOTREF(__pyx_t_6);
19512       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19513       __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
19514       __Pyx_GOTREF(__pyx_t_1);
19515       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
19516       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19517       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_7, __pyx_t_1) < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
19518       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19519       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19520 
19521       /* "GPy/models/state_space_cython.pyx":675
19522  *             dP_pred[:,:,j] += np.dot( A ,np.dot( p_dP[:,:,j] , A.T)) + dQ
19523  *
19524  *             dP_pred[:,:,j] = 0.5*(dP_pred[:,:,j] + dP_pred[:,:,j].T) #symmetrize             # <<<<<<<<<<<<<<
19525  *     else:
19526  *         dm_pred = None
19527  */
19528       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
19529       __Pyx_GOTREF(__pyx_t_7);
19530       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
19531       __Pyx_GOTREF(__pyx_t_1);
19532       __Pyx_INCREF(__pyx_slice__10);
19533       __Pyx_GIVEREF(__pyx_slice__10);
19534       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__10);
19535       __Pyx_INCREF(__pyx_slice__10);
19536       __Pyx_GIVEREF(__pyx_slice__10);
19537       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
19538       __Pyx_GIVEREF(__pyx_t_7);
19539       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7);
19540       __pyx_t_7 = 0;
19541       __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
19542       __Pyx_GOTREF(__pyx_t_7);
19543       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19544       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
19545       __Pyx_GOTREF(__pyx_t_1);
19546       __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
19547       __Pyx_GOTREF(__pyx_t_6);
19548       __Pyx_INCREF(__pyx_slice__10);
19549       __Pyx_GIVEREF(__pyx_slice__10);
19550       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_slice__10);
19551       __Pyx_INCREF(__pyx_slice__10);
19552       __Pyx_GIVEREF(__pyx_slice__10);
19553       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__10);
19554       __Pyx_GIVEREF(__pyx_t_1);
19555       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
19556       __pyx_t_1 = 0;
19557       __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
19558       __Pyx_GOTREF(__pyx_t_1);
19559       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19560       __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_T); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
19561       __Pyx_GOTREF(__pyx_t_6);
19562       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19563       __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
19564       __Pyx_GOTREF(__pyx_t_1);
19565       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19566       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19567       __pyx_t_6 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
19568       __Pyx_GOTREF(__pyx_t_6);
19569       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19570       __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
19571       __Pyx_GOTREF(__pyx_t_1);
19572       __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error)
19573       __Pyx_GOTREF(__pyx_t_7);
19574       __Pyx_INCREF(__pyx_slice__10);
19575       __Pyx_GIVEREF(__pyx_slice__10);
19576       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_slice__10);
19577       __Pyx_INCREF(__pyx_slice__10);
19578       __Pyx_GIVEREF(__pyx_slice__10);
19579       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_slice__10);
19580       __Pyx_GIVEREF(__pyx_t_1);
19581       PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
19582       __pyx_t_1 = 0;
19583       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_pred), __pyx_t_7, __pyx_t_6) < 0)) __PYX_ERR(0, 675, __pyx_L1_error)
19584       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
19585       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19586     }
19587 
19588     /* "GPy/models/state_space_cython.pyx":654
19589  *     cdef np.ndarray[DTYPE_t, ndim=2] dA
19590  *     cdef np.ndarray[DTYPE_t, ndim=2] dQ
19591  *     if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
19592  *         dA_all_params = p_dynamic_callables.dAk(k) # derivatives of A wrt parameters
19593  *         dQ_all_params = p_dynamic_callables.dQk(k) # derivatives of Q wrt parameters
19594  */
19595     goto __pyx_L3;
19596   }
19597 
19598   /* "GPy/models/state_space_cython.pyx":677
19599  *             dP_pred[:,:,j] = 0.5*(dP_pred[:,:,j] + dP_pred[:,:,j].T) #symmetrize
19600  *     else:
19601  *         dm_pred = None             # <<<<<<<<<<<<<<
19602  *         dP_pred = None
19603  *
19604  */
19605   /*else*/ {
19606     __pyx_t_26 = ((PyArrayObject *)Py_None);
19607     {
19608       __Pyx_BufFmt_StackElem __pyx_stack[1];
19609       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
19610       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_26, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
19611       if (unlikely(__pyx_t_11 < 0)) {
19612         PyErr_Fetch(&__pyx_t_22, &__pyx_t_23, &__pyx_t_24);
19613         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
19614           Py_XDECREF(__pyx_t_22); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_24);
19615           __Pyx_RaiseBufferFallbackError();
19616         } else {
19617           PyErr_Restore(__pyx_t_22, __pyx_t_23, __pyx_t_24);
19618         }
19619         __pyx_t_22 = __pyx_t_23 = __pyx_t_24 = 0;
19620       }
19621       __pyx_pybuffernd_dm_pred.diminfo[0].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_pred.diminfo[0].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_pred.diminfo[1].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_pred.diminfo[1].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_pred.diminfo[2].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_pred.diminfo[2].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[2];
19622       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 677, __pyx_L1_error)
19623     }
19624     __pyx_t_26 = 0;
19625     __Pyx_INCREF(Py_None);
19626     __pyx_v_dm_pred = ((PyArrayObject *)Py_None);
19627 
19628     /* "GPy/models/state_space_cython.pyx":678
19629  *     else:
19630  *         dm_pred = None
19631  *         dP_pred = None             # <<<<<<<<<<<<<<
19632  *
19633  *     ret = (P_pred, S_new, Vh.T)
19634  */
19635     __pyx_t_27 = ((PyArrayObject *)Py_None);
19636     {
19637       __Pyx_BufFmt_StackElem __pyx_stack[1];
19638       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
19639       __pyx_t_11 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_27, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
19640       if (unlikely(__pyx_t_11 < 0)) {
19641         PyErr_Fetch(&__pyx_t_24, &__pyx_t_23, &__pyx_t_22);
19642         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
19643           Py_XDECREF(__pyx_t_24); Py_XDECREF(__pyx_t_23); Py_XDECREF(__pyx_t_22);
19644           __Pyx_RaiseBufferFallbackError();
19645         } else {
19646           PyErr_Restore(__pyx_t_24, __pyx_t_23, __pyx_t_22);
19647         }
19648         __pyx_t_24 = __pyx_t_23 = __pyx_t_22 = 0;
19649       }
19650       __pyx_pybuffernd_dP_pred.diminfo[0].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_pred.diminfo[0].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_pred.diminfo[1].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_pred.diminfo[1].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_pred.diminfo[2].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_pred.diminfo[2].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[2];
19651       if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 678, __pyx_L1_error)
19652     }
19653     __pyx_t_27 = 0;
19654     __Pyx_INCREF(Py_None);
19655     __pyx_v_dP_pred = ((PyArrayObject *)Py_None);
19656   }
19657   __pyx_L3:;
19658 
19659   /* "GPy/models/state_space_cython.pyx":680
19660  *         dP_pred = None
19661  *
19662  *     ret = (P_pred, S_new, Vh.T)             # <<<<<<<<<<<<<<
19663  *     return m_pred, ret, dm_pred, dP_pred
19664  *
19665  */
19666   __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Vh), __pyx_n_s_T); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
19667   __Pyx_GOTREF(__pyx_t_6);
19668   __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 680, __pyx_L1_error)
19669   __Pyx_GOTREF(__pyx_t_7);
19670   __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
19671   __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
19672   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_P_pred));
19673   __Pyx_INCREF(((PyObject *)__pyx_v_S_new));
19674   __Pyx_GIVEREF(((PyObject *)__pyx_v_S_new));
19675   PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_S_new));
19676   __Pyx_GIVEREF(__pyx_t_6);
19677   PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
19678   __pyx_t_6 = 0;
19679   __pyx_v_ret = ((PyObject*)__pyx_t_7);
19680   __pyx_t_7 = 0;
19681 
19682   /* "GPy/models/state_space_cython.pyx":681
19683  *
19684  *     ret = (P_pred, S_new, Vh.T)
19685  *     return m_pred, ret, dm_pred, dP_pred             # <<<<<<<<<<<<<<
19686  *
19687  *
19688  */
19689   __Pyx_XDECREF(__pyx_r);
19690   __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error)
19691   __Pyx_GOTREF(__pyx_t_7);
19692   __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
19693   __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
19694   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_m_pred));
19695   __Pyx_INCREF(__pyx_v_ret);
19696   __Pyx_GIVEREF(__pyx_v_ret);
19697   PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_ret);
19698   __Pyx_INCREF(((PyObject *)__pyx_v_dm_pred));
19699   __Pyx_GIVEREF(((PyObject *)__pyx_v_dm_pred));
19700   PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_v_dm_pred));
19701   __Pyx_INCREF(((PyObject *)__pyx_v_dP_pred));
19702   __Pyx_GIVEREF(((PyObject *)__pyx_v_dP_pred));
19703   PyTuple_SET_ITEM(__pyx_t_7, 3, ((PyObject *)__pyx_v_dP_pred));
19704   __pyx_r = __pyx_t_7;
19705   __pyx_t_7 = 0;
19706   goto __pyx_L0;
19707 
19708   /* "GPy/models/state_space_cython.pyx":547
19709  *
19710  * @cython.boundscheck(False)
19711  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,             # <<<<<<<<<<<<<<
19712  *                                 Dynamic_Callables_Cython p_dynamic_callables,
19713  *                                 bint calc_grad_log_likelihood=False,
19714  */
19715 
19716   /* function exit code */
19717   __pyx_L1_error:;
19718   __Pyx_XDECREF(__pyx_t_1);
19719   __Pyx_XDECREF(__pyx_t_6);
19720   __Pyx_XDECREF(__pyx_t_7);
19721   __Pyx_XDECREF(__pyx_t_8);
19722   __Pyx_XDECREF(__pyx_t_9);
19723   __Pyx_XDECREF(__pyx_t_10);
19724   __Pyx_XDECREF(__pyx_t_12);
19725   __Pyx_XDECREF(__pyx_t_33);
19726   __Pyx_XDECREF(__pyx_t_34);
19727   __Pyx_XDECREF(__pyx_t_35);
19728   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19729     __Pyx_PyThreadState_declare
19730     __Pyx_PyThreadState_assign
19731     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19732     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
19733     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
19734     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer);
19735     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
19736     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q_sr.rcbuffer->pybuffer);
19737     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
19738     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_new.rcbuffer->pybuffer);
19739     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_old.rcbuffer->pybuffer);
19740     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
19741     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_new.rcbuffer->pybuffer);
19742     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_old.rcbuffer->pybuffer);
19743     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
19744     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA.rcbuffer->pybuffer);
19745     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer);
19746     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
19747     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
19748     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer);
19749     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
19750     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
19751     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer);
19752     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer);
19753     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer);
19754     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer);
19755   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19756   __Pyx_AddTraceback("GPy.models.state_space_cython._kalman_prediction_step_SVD_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
19757   __pyx_r = NULL;
19758   goto __pyx_L2;
19759   __pyx_L0:;
19760   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_A.rcbuffer->pybuffer);
19761   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
19762   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Prev_cov.rcbuffer->pybuffer);
19763   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q.rcbuffer->pybuffer);
19764   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Q_sr.rcbuffer->pybuffer);
19765   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
19766   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_new.rcbuffer->pybuffer);
19767   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_old.rcbuffer->pybuffer);
19768   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
19769   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_new.rcbuffer->pybuffer);
19770   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_old.rcbuffer->pybuffer);
19771   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
19772   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA.rcbuffer->pybuffer);
19773   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dA_all_params.rcbuffer->pybuffer);
19774   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
19775   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ.rcbuffer->pybuffer);
19776   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dQ_all_params.rcbuffer->pybuffer);
19777   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
19778   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
19779   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer);
19780   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer);
19781   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer);
19782   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_svd_1_matr.rcbuffer->pybuffer);
19783   __pyx_L2:;
19784   __Pyx_XDECREF((PyObject *)__pyx_v_Prev_cov);
19785   __Pyx_XDECREF((PyObject *)__pyx_v_S_old);
19786   __Pyx_XDECREF((PyObject *)__pyx_v_V_old);
19787   __Pyx_XDECREF((PyObject *)__pyx_v_A);
19788   __Pyx_XDECREF((PyObject *)__pyx_v_Q);
19789   __Pyx_XDECREF((PyObject *)__pyx_v_Q_sr);
19790   __Pyx_XDECREF((PyObject *)__pyx_v_m_pred);
19791   __Pyx_XDECREF((PyObject *)__pyx_v_svd_1_matr);
19792   __Pyx_XDECREF(__pyx_v_res);
19793   __Pyx_XDECREF((PyObject *)__pyx_v_U);
19794   __Pyx_XDECREF((PyObject *)__pyx_v_S);
19795   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
19796   __Pyx_XDECREF((PyObject *)__pyx_v_V_new);
19797   __Pyx_XDECREF((PyObject *)__pyx_v_S_new);
19798   __Pyx_XDECREF((PyObject *)__pyx_v_P_pred);
19799   __Pyx_XDECREF((PyObject *)__pyx_v_dA_all_params);
19800   __Pyx_XDECREF((PyObject *)__pyx_v_dQ_all_params);
19801   __Pyx_XDECREF((PyObject *)__pyx_v_dm_pred);
19802   __Pyx_XDECREF((PyObject *)__pyx_v_dP_pred);
19803   __Pyx_XDECREF(__pyx_v_ret);
19804   __Pyx_XDECREF((PyObject *)__pyx_v_dA);
19805   __Pyx_XDECREF((PyObject *)__pyx_v_dQ);
19806   __Pyx_XGIVEREF(__pyx_r);
19807   __Pyx_RefNannyFinishContext();
19808   return __pyx_r;
19809 }
19810 
19811 /* "GPy/models/state_space_cython.pyx":686
19812  *
19813  * @cython.boundscheck(False)
19814  * def _kalman_update_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m, tuple p_P,             # <<<<<<<<<<<<<<
19815  *                             Measurement_Callables_Cython p_measurement_callables,
19816  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
19817  */
19818 
19819 /* Python wrapper */
19820 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
19821 static char __pyx_doc_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython[] = "\n    Input:\n    \n    k: int\n          Iteration No. Starts at 0. Total number of iterations equal to the \n          number of measurements.\n      \n    m_P: matrix of size (state_dim, time_series_no)\n         Mean value from the previous step. For \"multiple time series mode\" \n            it is matrix, second dimension of which correspond to different\n            time series.\n            \n    p_P: tuple (P_pred, S, V)\n         Covariance matrix from the prediction step and its SVD decomposition.\n         P_pred = V * S * V.T The tuple is (P_pred, S, V)\n         \n    p_h: function (k, x_{k}, H_{k}). Measurement function.\n        k (iteration number), starts at 0\n        x_{k} state \n        H_{k} Jacobian matrices of f_h. In the linear case it is exactly H_{k}.\n    \n    p_f_H: function (k, m, P) return Jacobian of dynamic function, it is\n        passed into p_h.\n        k (iteration number), starts at 0\n        m: point where Jacobian is evaluated\n        P: parameter for Jacobian, usually covariance matrix.\n    \n    p_f_R: function (k). Returns noise matrix of measurement equation \n        on iteration k.\n        k (iteration number). starts at 0\n        \n    p_f_iRsr: function (k). Returns the square root of the noise matrix of \n        measurement equation on iteration k. \n        k (iteration number). starts at 0\n        \n    measurement: (measurement_dim, time_series_no) matrix\n        One measurement used on the current update step. For \n        \"multiple time series mode\" it is matrix, second dimension of \n        which correspond to different time series.\n        \n    calc_log_likelihood: boolean\n        Whether to calculate marginal likelihood of the state-space model.\n    \n    calc_grad_log_likelihood: boolean\n            Whether to calculate gradient of the marginal likelihood \n            of the state-space model. If true then the next parameter must \n            provide the extra parameters for gradient cal""culation.\n    \n    p_dm: 3D array (state_dim, time_series_no, parameters_no)\n            Mean derivatives from the prediction step. For \"multiple time series mode\" \n            it is 3D array, second dimension of which correspond to different\n            time series.\n    \n    p_dP: array\n        Covariance derivatives from the prediction step.\n    \n    grad_calc_params_2: List or None\n        List with derivatives. The first component is 'f_dH' - function(k)\n        which returns the derivative of H. The second element is 'f_dR'\n         - function(k). Function which returns the derivative of R.\n    \n    Output:\n    ----------------------------\n    m_upd, P_upd, dm_upd, dP_upd: metrices, 3D objects\n        Results of the prediction steps.\n        \n    log_likelihood_update: double or 1D array\n        Update to the log_likelihood from this step        \n    \n    d_log_likelihood_update: (grad_params_no, time_series_no) matrix\n        Update to the gradient of log_likelihood, \"multiple time series mode\"\n        adds extra columns to the gradient.\n    \n    ";
19822 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython = {"_kalman_update_step_SVD_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython};
__pyx_pw_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)19823 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19824   long __pyx_v_k;
19825   PyArrayObject *__pyx_v_p_m = 0;
19826   PyObject *__pyx_v_p_P = 0;
19827   struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables = 0;
19828   PyArrayObject *__pyx_v_measurement = 0;
19829   int __pyx_v_calc_log_likelihood;
19830   int __pyx_v_calc_grad_log_likelihood;
19831   PyArrayObject *__pyx_v_p_dm = 0;
19832   PyArrayObject *__pyx_v_p_dP = 0;
19833   int __pyx_lineno = 0;
19834   const char *__pyx_filename = NULL;
19835   int __pyx_clineno = 0;
19836   PyObject *__pyx_r = 0;
19837   __Pyx_RefNannyDeclarations
19838   __Pyx_RefNannySetupContext("_kalman_update_step_SVD_Cython (wrapper)", 0);
19839   {
19840     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_p_m,&__pyx_n_s_p_P,&__pyx_n_s_p_measurement_callables,&__pyx_n_s_measurement,&__pyx_n_s_calc_log_likelihood,&__pyx_n_s_calc_grad_log_likelihood,&__pyx_n_s_p_dm,&__pyx_n_s_p_dP,0};
19841     PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
19842 
19843     /* "GPy/models/state_space_cython.pyx":691
19844  *                             bint calc_log_likelihood= False,
19845  *                             bint calc_grad_log_likelihood=False,
19846  *                             np.ndarray[DTYPE_t, ndim=3] p_dm = None,             # <<<<<<<<<<<<<<
19847  *                             np.ndarray[DTYPE_t, ndim=3] p_dP = None):
19848  *     """
19849  */
19850     values[7] = (PyObject *)((PyArrayObject *)Py_None);
19851 
19852     /* "GPy/models/state_space_cython.pyx":692
19853  *                             bint calc_grad_log_likelihood=False,
19854  *                             np.ndarray[DTYPE_t, ndim=3] p_dm = None,
19855  *                             np.ndarray[DTYPE_t, ndim=3] p_dP = None):             # <<<<<<<<<<<<<<
19856  *     """
19857  *     Input:
19858  */
19859     values[8] = (PyObject *)((PyArrayObject *)Py_None);
19860     if (unlikely(__pyx_kwds)) {
19861       Py_ssize_t kw_args;
19862       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19863       switch (pos_args) {
19864         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19865         CYTHON_FALLTHROUGH;
19866         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19867         CYTHON_FALLTHROUGH;
19868         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19869         CYTHON_FALLTHROUGH;
19870         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19871         CYTHON_FALLTHROUGH;
19872         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19873         CYTHON_FALLTHROUGH;
19874         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19875         CYTHON_FALLTHROUGH;
19876         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19877         CYTHON_FALLTHROUGH;
19878         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19879         CYTHON_FALLTHROUGH;
19880         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19881         CYTHON_FALLTHROUGH;
19882         case  0: break;
19883         default: goto __pyx_L5_argtuple_error;
19884       }
19885       kw_args = PyDict_Size(__pyx_kwds);
19886       switch (pos_args) {
19887         case  0:
19888         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_k)) != 0)) kw_args--;
19889         else goto __pyx_L5_argtuple_error;
19890         CYTHON_FALLTHROUGH;
19891         case  1:
19892         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_m)) != 0)) kw_args--;
19893         else {
19894           __Pyx_RaiseArgtupleInvalid("_kalman_update_step_SVD_Cython", 0, 5, 9, 1); __PYX_ERR(0, 686, __pyx_L3_error)
19895         }
19896         CYTHON_FALLTHROUGH;
19897         case  2:
19898         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_P)) != 0)) kw_args--;
19899         else {
19900           __Pyx_RaiseArgtupleInvalid("_kalman_update_step_SVD_Cython", 0, 5, 9, 2); __PYX_ERR(0, 686, __pyx_L3_error)
19901         }
19902         CYTHON_FALLTHROUGH;
19903         case  3:
19904         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_measurement_callables)) != 0)) kw_args--;
19905         else {
19906           __Pyx_RaiseArgtupleInvalid("_kalman_update_step_SVD_Cython", 0, 5, 9, 3); __PYX_ERR(0, 686, __pyx_L3_error)
19907         }
19908         CYTHON_FALLTHROUGH;
19909         case  4:
19910         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_measurement)) != 0)) kw_args--;
19911         else {
19912           __Pyx_RaiseArgtupleInvalid("_kalman_update_step_SVD_Cython", 0, 5, 9, 4); __PYX_ERR(0, 686, __pyx_L3_error)
19913         }
19914         CYTHON_FALLTHROUGH;
19915         case  5:
19916         if (kw_args > 0) {
19917           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calc_log_likelihood);
19918           if (value) { values[5] = value; kw_args--; }
19919         }
19920         CYTHON_FALLTHROUGH;
19921         case  6:
19922         if (kw_args > 0) {
19923           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calc_grad_log_likelihood);
19924           if (value) { values[6] = value; kw_args--; }
19925         }
19926         CYTHON_FALLTHROUGH;
19927         case  7:
19928         if (kw_args > 0) {
19929           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dm);
19930           if (value) { values[7] = value; kw_args--; }
19931         }
19932         CYTHON_FALLTHROUGH;
19933         case  8:
19934         if (kw_args > 0) {
19935           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dP);
19936           if (value) { values[8] = value; kw_args--; }
19937         }
19938       }
19939       if (unlikely(kw_args > 0)) {
19940         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kalman_update_step_SVD_Cython") < 0)) __PYX_ERR(0, 686, __pyx_L3_error)
19941       }
19942     } else {
19943       switch (PyTuple_GET_SIZE(__pyx_args)) {
19944         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
19945         CYTHON_FALLTHROUGH;
19946         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
19947         CYTHON_FALLTHROUGH;
19948         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
19949         CYTHON_FALLTHROUGH;
19950         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
19951         CYTHON_FALLTHROUGH;
19952         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
19953         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
19954         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19955         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19956         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19957         break;
19958         default: goto __pyx_L5_argtuple_error;
19959       }
19960     }
19961     __pyx_v_k = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_k == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 686, __pyx_L3_error)
19962     __pyx_v_p_m = ((PyArrayObject *)values[1]);
19963     __pyx_v_p_P = ((PyObject*)values[2]);
19964     __pyx_v_p_measurement_callables = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)values[3]);
19965     __pyx_v_measurement = ((PyArrayObject *)values[4]);
19966     if (values[5]) {
19967       __pyx_v_calc_log_likelihood = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_calc_log_likelihood == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 689, __pyx_L3_error)
19968     } else {
19969 
19970       /* "GPy/models/state_space_cython.pyx":689
19971  *                             Measurement_Callables_Cython p_measurement_callables,
19972  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
19973  *                             bint calc_log_likelihood= False,             # <<<<<<<<<<<<<<
19974  *                             bint calc_grad_log_likelihood=False,
19975  *                             np.ndarray[DTYPE_t, ndim=3] p_dm = None,
19976  */
19977       __pyx_v_calc_log_likelihood = ((int)0);
19978     }
19979     if (values[6]) {
19980       __pyx_v_calc_grad_log_likelihood = __Pyx_PyObject_IsTrue(values[6]); if (unlikely((__pyx_v_calc_grad_log_likelihood == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 690, __pyx_L3_error)
19981     } else {
19982 
19983       /* "GPy/models/state_space_cython.pyx":690
19984  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
19985  *                             bint calc_log_likelihood= False,
19986  *                             bint calc_grad_log_likelihood=False,             # <<<<<<<<<<<<<<
19987  *                             np.ndarray[DTYPE_t, ndim=3] p_dm = None,
19988  *                             np.ndarray[DTYPE_t, ndim=3] p_dP = None):
19989  */
19990       __pyx_v_calc_grad_log_likelihood = ((int)0);
19991     }
19992     __pyx_v_p_dm = ((PyArrayObject *)values[7]);
19993     __pyx_v_p_dP = ((PyArrayObject *)values[8]);
19994   }
19995   goto __pyx_L4_argument_unpacking_done;
19996   __pyx_L5_argtuple_error:;
19997   __Pyx_RaiseArgtupleInvalid("_kalman_update_step_SVD_Cython", 0, 5, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 686, __pyx_L3_error)
19998   __pyx_L3_error:;
19999   __Pyx_AddTraceback("GPy.models.state_space_cython._kalman_update_step_SVD_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
20000   __Pyx_RefNannyFinishContext();
20001   return NULL;
20002   __pyx_L4_argument_unpacking_done:;
20003   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_m), __pyx_ptype_5numpy_ndarray, 1, "p_m", 0))) __PYX_ERR(0, 686, __pyx_L1_error)
20004   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_P), (&PyTuple_Type), 1, "p_P", 1))) __PYX_ERR(0, 686, __pyx_L1_error)
20005   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_measurement_callables), __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython, 1, "p_measurement_callables", 0))) __PYX_ERR(0, 687, __pyx_L1_error)
20006   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_measurement), __pyx_ptype_5numpy_ndarray, 1, "measurement", 0))) __PYX_ERR(0, 688, __pyx_L1_error)
20007   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dm), __pyx_ptype_5numpy_ndarray, 1, "p_dm", 0))) __PYX_ERR(0, 691, __pyx_L1_error)
20008   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dP), __pyx_ptype_5numpy_ndarray, 1, "p_dP", 0))) __PYX_ERR(0, 692, __pyx_L1_error)
20009   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython(__pyx_self, __pyx_v_k, __pyx_v_p_m, __pyx_v_p_P, __pyx_v_p_measurement_callables, __pyx_v_measurement, __pyx_v_calc_log_likelihood, __pyx_v_calc_grad_log_likelihood, __pyx_v_p_dm, __pyx_v_p_dP);
20010 
20011   /* "GPy/models/state_space_cython.pyx":686
20012  *
20013  * @cython.boundscheck(False)
20014  * def _kalman_update_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m, tuple p_P,             # <<<<<<<<<<<<<<
20015  *                             Measurement_Callables_Cython p_measurement_callables,
20016  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
20017  */
20018 
20019   /* function exit code */
20020   goto __pyx_L0;
20021   __pyx_L1_error:;
20022   __pyx_r = NULL;
20023   __pyx_L0:;
20024   __Pyx_RefNannyFinishContext();
20025   return __pyx_r;
20026 }
20027 
__pyx_pf_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython(CYTHON_UNUSED PyObject * __pyx_self,long __pyx_v_k,PyArrayObject * __pyx_v_p_m,PyObject * __pyx_v_p_P,struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_p_measurement_callables,PyArrayObject * __pyx_v_measurement,int __pyx_v_calc_log_likelihood,int __pyx_v_calc_grad_log_likelihood,PyArrayObject * __pyx_v_p_dm,PyArrayObject * __pyx_v_p_dP)20028 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_2_kalman_update_step_SVD_Cython(CYTHON_UNUSED PyObject *__pyx_self, long __pyx_v_k, PyArrayObject *__pyx_v_p_m, PyObject *__pyx_v_p_P, struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables, PyArrayObject *__pyx_v_measurement, int __pyx_v_calc_log_likelihood, int __pyx_v_calc_grad_log_likelihood, PyArrayObject *__pyx_v_p_dm, PyArrayObject *__pyx_v_p_dP) {
20029   PyArrayObject *__pyx_v_m_pred = 0;
20030   PyArrayObject *__pyx_v_P_pred = 0;
20031   PyArrayObject *__pyx_v_S_pred = 0;
20032   PyArrayObject *__pyx_v_V_pred = 0;
20033   PyArrayObject *__pyx_v_H = 0;
20034   PyArrayObject *__pyx_v_R = 0;
20035   PyArrayObject *__pyx_v_R_isr = 0;
20036   int __pyx_v_time_series_no;
20037   PyArrayObject *__pyx_v_log_likelihood_update = 0;
20038   PyArrayObject *__pyx_v_v = 0;
20039   PyArrayObject *__pyx_v_svd_2_matr = 0;
20040   PyObject *__pyx_v_res = NULL;
20041   CYTHON_UNUSED PyArrayObject *__pyx_v_U = 0;
20042   PyArrayObject *__pyx_v_S_svd = 0;
20043   PyArrayObject *__pyx_v_Vh = 0;
20044   PyArrayObject *__pyx_v_U_upd = 0;
20045   PyArrayObject *__pyx_v_S_upd = 0;
20046   PyArrayObject *__pyx_v_P_upd = 0;
20047   PyArrayObject *__pyx_v_S = 0;
20048   PyArrayObject *__pyx_v_K = 0;
20049   CYTHON_UNUSED int __pyx_v_measurement_dim_gt_one;
20050   PyArrayObject *__pyx_v_dm_upd = 0;
20051   PyArrayObject *__pyx_v_dP_upd = 0;
20052   PyArrayObject *__pyx_v_d_log_likelihood_update = 0;
20053   PyArrayObject *__pyx_v_dm_pred_all_params = 0;
20054   PyArrayObject *__pyx_v_dP_pred_all_params = 0;
20055   int __pyx_v_param_number;
20056   PyArrayObject *__pyx_v_dH_all_params = 0;
20057   PyArrayObject *__pyx_v_dR_all_params = 0;
20058   int __pyx_v_param;
20059   PyArrayObject *__pyx_v_dH = 0;
20060   PyArrayObject *__pyx_v_dR = 0;
20061   PyArrayObject *__pyx_v_dm_pred = 0;
20062   PyArrayObject *__pyx_v_dP_pred = 0;
20063   PyArrayObject *__pyx_v_dv = 0;
20064   PyArrayObject *__pyx_v_dS = 0;
20065   PyArrayObject *__pyx_v_tmp1 = 0;
20066   PyArrayObject *__pyx_v_tmp2 = 0;
20067   PyArrayObject *__pyx_v_tmp3 = 0;
20068   PyArrayObject *__pyx_v_dK = 0;
20069   PyArrayObject *__pyx_v_tmp5 = 0;
20070   PyObject *__pyx_v_ret = 0;
20071   PyObject *__pyx_v_m_upd = NULL;
20072   __Pyx_LocalBuf_ND __pyx_pybuffernd_H;
20073   __Pyx_Buffer __pyx_pybuffer_H;
20074   __Pyx_LocalBuf_ND __pyx_pybuffernd_K;
20075   __Pyx_Buffer __pyx_pybuffer_K;
20076   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_pred;
20077   __Pyx_Buffer __pyx_pybuffer_P_pred;
20078   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_upd;
20079   __Pyx_Buffer __pyx_pybuffer_P_upd;
20080   __Pyx_LocalBuf_ND __pyx_pybuffernd_R;
20081   __Pyx_Buffer __pyx_pybuffer_R;
20082   __Pyx_LocalBuf_ND __pyx_pybuffernd_R_isr;
20083   __Pyx_Buffer __pyx_pybuffer_R_isr;
20084   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
20085   __Pyx_Buffer __pyx_pybuffer_S;
20086   __Pyx_LocalBuf_ND __pyx_pybuffernd_S_pred;
20087   __Pyx_Buffer __pyx_pybuffer_S_pred;
20088   __Pyx_LocalBuf_ND __pyx_pybuffernd_S_svd;
20089   __Pyx_Buffer __pyx_pybuffer_S_svd;
20090   __Pyx_LocalBuf_ND __pyx_pybuffernd_S_upd;
20091   __Pyx_Buffer __pyx_pybuffer_S_upd;
20092   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
20093   __Pyx_Buffer __pyx_pybuffer_U;
20094   __Pyx_LocalBuf_ND __pyx_pybuffernd_U_upd;
20095   __Pyx_Buffer __pyx_pybuffer_U_upd;
20096   __Pyx_LocalBuf_ND __pyx_pybuffernd_V_pred;
20097   __Pyx_Buffer __pyx_pybuffer_V_pred;
20098   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
20099   __Pyx_Buffer __pyx_pybuffer_Vh;
20100   __Pyx_LocalBuf_ND __pyx_pybuffernd_dH;
20101   __Pyx_Buffer __pyx_pybuffer_dH;
20102   __Pyx_LocalBuf_ND __pyx_pybuffernd_dH_all_params;
20103   __Pyx_Buffer __pyx_pybuffer_dH_all_params;
20104   __Pyx_LocalBuf_ND __pyx_pybuffernd_dK;
20105   __Pyx_Buffer __pyx_pybuffer_dK;
20106   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_pred;
20107   __Pyx_Buffer __pyx_pybuffer_dP_pred;
20108   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_pred_all_params;
20109   __Pyx_Buffer __pyx_pybuffer_dP_pred_all_params;
20110   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_upd;
20111   __Pyx_Buffer __pyx_pybuffer_dP_upd;
20112   __Pyx_LocalBuf_ND __pyx_pybuffernd_dR;
20113   __Pyx_Buffer __pyx_pybuffer_dR;
20114   __Pyx_LocalBuf_ND __pyx_pybuffernd_dR_all_params;
20115   __Pyx_Buffer __pyx_pybuffer_dR_all_params;
20116   __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
20117   __Pyx_Buffer __pyx_pybuffer_dS;
20118   __Pyx_LocalBuf_ND __pyx_pybuffernd_d_log_likelihood_update;
20119   __Pyx_Buffer __pyx_pybuffer_d_log_likelihood_update;
20120   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_pred;
20121   __Pyx_Buffer __pyx_pybuffer_dm_pred;
20122   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_pred_all_params;
20123   __Pyx_Buffer __pyx_pybuffer_dm_pred_all_params;
20124   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_upd;
20125   __Pyx_Buffer __pyx_pybuffer_dm_upd;
20126   __Pyx_LocalBuf_ND __pyx_pybuffernd_dv;
20127   __Pyx_Buffer __pyx_pybuffer_dv;
20128   __Pyx_LocalBuf_ND __pyx_pybuffernd_log_likelihood_update;
20129   __Pyx_Buffer __pyx_pybuffer_log_likelihood_update;
20130   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
20131   __Pyx_Buffer __pyx_pybuffer_m_pred;
20132   __Pyx_LocalBuf_ND __pyx_pybuffernd_measurement;
20133   __Pyx_Buffer __pyx_pybuffer_measurement;
20134   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_dP;
20135   __Pyx_Buffer __pyx_pybuffer_p_dP;
20136   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_dm;
20137   __Pyx_Buffer __pyx_pybuffer_p_dm;
20138   __Pyx_LocalBuf_ND __pyx_pybuffernd_p_m;
20139   __Pyx_Buffer __pyx_pybuffer_p_m;
20140   __Pyx_LocalBuf_ND __pyx_pybuffernd_svd_2_matr;
20141   __Pyx_Buffer __pyx_pybuffer_svd_2_matr;
20142   __Pyx_LocalBuf_ND __pyx_pybuffernd_tmp1;
20143   __Pyx_Buffer __pyx_pybuffer_tmp1;
20144   __Pyx_LocalBuf_ND __pyx_pybuffernd_tmp2;
20145   __Pyx_Buffer __pyx_pybuffer_tmp2;
20146   __Pyx_LocalBuf_ND __pyx_pybuffernd_tmp3;
20147   __Pyx_Buffer __pyx_pybuffer_tmp3;
20148   __Pyx_LocalBuf_ND __pyx_pybuffernd_tmp5;
20149   __Pyx_Buffer __pyx_pybuffer_tmp5;
20150   __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
20151   __Pyx_Buffer __pyx_pybuffer_v;
20152   PyObject *__pyx_r = NULL;
20153   __Pyx_RefNannyDeclarations
20154   PyObject *__pyx_t_1 = NULL;
20155   PyArrayObject *__pyx_t_2 = NULL;
20156   PyArrayObject *__pyx_t_3 = NULL;
20157   PyArrayObject *__pyx_t_4 = NULL;
20158   PyObject *__pyx_t_5 = NULL;
20159   PyArrayObject *__pyx_t_6 = NULL;
20160   PyObject *__pyx_t_7 = NULL;
20161   PyObject *__pyx_t_8 = NULL;
20162   PyObject *__pyx_t_9 = NULL;
20163   PyObject *__pyx_t_10 = NULL;
20164   PyObject *__pyx_t_11 = NULL;
20165   PyObject *__pyx_t_12 = NULL;
20166   int __pyx_t_13;
20167   PyObject *__pyx_t_14 = NULL;
20168   PyArrayObject *__pyx_t_15 = NULL;
20169   PyArrayObject *__pyx_t_16 = NULL;
20170   PyArrayObject *__pyx_t_17 = NULL;
20171   PyArrayObject *__pyx_t_18 = NULL;
20172   PyArrayObject *__pyx_t_19 = NULL;
20173   PyArrayObject *__pyx_t_20 = NULL;
20174   PyArrayObject *__pyx_t_21 = NULL;
20175   PyArrayObject *__pyx_t_22 = NULL;
20176   int __pyx_t_23;
20177   PyArrayObject *__pyx_t_24 = NULL;
20178   PyObject *__pyx_t_25 = NULL;
20179   PyObject *__pyx_t_26 = NULL;
20180   PyObject *__pyx_t_27 = NULL;
20181   PyArrayObject *__pyx_t_28 = NULL;
20182   PyArrayObject *__pyx_t_29 = NULL;
20183   PyArrayObject *__pyx_t_30 = NULL;
20184   PyArrayObject *__pyx_t_31 = NULL;
20185   PyArrayObject *__pyx_t_32 = NULL;
20186   PyArrayObject *__pyx_t_33 = NULL;
20187   int __pyx_t_34;
20188   int __pyx_t_35;
20189   PyArrayObject *__pyx_t_36 = NULL;
20190   int __pyx_t_37;
20191   int __pyx_lineno = 0;
20192   const char *__pyx_filename = NULL;
20193   int __pyx_clineno = 0;
20194   __Pyx_RefNannySetupContext("_kalman_update_step_SVD_Cython", 0);
20195   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
20196   __pyx_pybuffer_m_pred.refcount = 0;
20197   __pyx_pybuffernd_m_pred.data = NULL;
20198   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
20199   __pyx_pybuffer_P_pred.pybuffer.buf = NULL;
20200   __pyx_pybuffer_P_pred.refcount = 0;
20201   __pyx_pybuffernd_P_pred.data = NULL;
20202   __pyx_pybuffernd_P_pred.rcbuffer = &__pyx_pybuffer_P_pred;
20203   __pyx_pybuffer_S_pred.pybuffer.buf = NULL;
20204   __pyx_pybuffer_S_pred.refcount = 0;
20205   __pyx_pybuffernd_S_pred.data = NULL;
20206   __pyx_pybuffernd_S_pred.rcbuffer = &__pyx_pybuffer_S_pred;
20207   __pyx_pybuffer_V_pred.pybuffer.buf = NULL;
20208   __pyx_pybuffer_V_pred.refcount = 0;
20209   __pyx_pybuffernd_V_pred.data = NULL;
20210   __pyx_pybuffernd_V_pred.rcbuffer = &__pyx_pybuffer_V_pred;
20211   __pyx_pybuffer_H.pybuffer.buf = NULL;
20212   __pyx_pybuffer_H.refcount = 0;
20213   __pyx_pybuffernd_H.data = NULL;
20214   __pyx_pybuffernd_H.rcbuffer = &__pyx_pybuffer_H;
20215   __pyx_pybuffer_R.pybuffer.buf = NULL;
20216   __pyx_pybuffer_R.refcount = 0;
20217   __pyx_pybuffernd_R.data = NULL;
20218   __pyx_pybuffernd_R.rcbuffer = &__pyx_pybuffer_R;
20219   __pyx_pybuffer_R_isr.pybuffer.buf = NULL;
20220   __pyx_pybuffer_R_isr.refcount = 0;
20221   __pyx_pybuffernd_R_isr.data = NULL;
20222   __pyx_pybuffernd_R_isr.rcbuffer = &__pyx_pybuffer_R_isr;
20223   __pyx_pybuffer_log_likelihood_update.pybuffer.buf = NULL;
20224   __pyx_pybuffer_log_likelihood_update.refcount = 0;
20225   __pyx_pybuffernd_log_likelihood_update.data = NULL;
20226   __pyx_pybuffernd_log_likelihood_update.rcbuffer = &__pyx_pybuffer_log_likelihood_update;
20227   __pyx_pybuffer_v.pybuffer.buf = NULL;
20228   __pyx_pybuffer_v.refcount = 0;
20229   __pyx_pybuffernd_v.data = NULL;
20230   __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
20231   __pyx_pybuffer_svd_2_matr.pybuffer.buf = NULL;
20232   __pyx_pybuffer_svd_2_matr.refcount = 0;
20233   __pyx_pybuffernd_svd_2_matr.data = NULL;
20234   __pyx_pybuffernd_svd_2_matr.rcbuffer = &__pyx_pybuffer_svd_2_matr;
20235   __pyx_pybuffer_U.pybuffer.buf = NULL;
20236   __pyx_pybuffer_U.refcount = 0;
20237   __pyx_pybuffernd_U.data = NULL;
20238   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
20239   __pyx_pybuffer_S_svd.pybuffer.buf = NULL;
20240   __pyx_pybuffer_S_svd.refcount = 0;
20241   __pyx_pybuffernd_S_svd.data = NULL;
20242   __pyx_pybuffernd_S_svd.rcbuffer = &__pyx_pybuffer_S_svd;
20243   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
20244   __pyx_pybuffer_Vh.refcount = 0;
20245   __pyx_pybuffernd_Vh.data = NULL;
20246   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
20247   __pyx_pybuffer_U_upd.pybuffer.buf = NULL;
20248   __pyx_pybuffer_U_upd.refcount = 0;
20249   __pyx_pybuffernd_U_upd.data = NULL;
20250   __pyx_pybuffernd_U_upd.rcbuffer = &__pyx_pybuffer_U_upd;
20251   __pyx_pybuffer_S_upd.pybuffer.buf = NULL;
20252   __pyx_pybuffer_S_upd.refcount = 0;
20253   __pyx_pybuffernd_S_upd.data = NULL;
20254   __pyx_pybuffernd_S_upd.rcbuffer = &__pyx_pybuffer_S_upd;
20255   __pyx_pybuffer_P_upd.pybuffer.buf = NULL;
20256   __pyx_pybuffer_P_upd.refcount = 0;
20257   __pyx_pybuffernd_P_upd.data = NULL;
20258   __pyx_pybuffernd_P_upd.rcbuffer = &__pyx_pybuffer_P_upd;
20259   __pyx_pybuffer_S.pybuffer.buf = NULL;
20260   __pyx_pybuffer_S.refcount = 0;
20261   __pyx_pybuffernd_S.data = NULL;
20262   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
20263   __pyx_pybuffer_K.pybuffer.buf = NULL;
20264   __pyx_pybuffer_K.refcount = 0;
20265   __pyx_pybuffernd_K.data = NULL;
20266   __pyx_pybuffernd_K.rcbuffer = &__pyx_pybuffer_K;
20267   __pyx_pybuffer_dm_upd.pybuffer.buf = NULL;
20268   __pyx_pybuffer_dm_upd.refcount = 0;
20269   __pyx_pybuffernd_dm_upd.data = NULL;
20270   __pyx_pybuffernd_dm_upd.rcbuffer = &__pyx_pybuffer_dm_upd;
20271   __pyx_pybuffer_dP_upd.pybuffer.buf = NULL;
20272   __pyx_pybuffer_dP_upd.refcount = 0;
20273   __pyx_pybuffernd_dP_upd.data = NULL;
20274   __pyx_pybuffernd_dP_upd.rcbuffer = &__pyx_pybuffer_dP_upd;
20275   __pyx_pybuffer_d_log_likelihood_update.pybuffer.buf = NULL;
20276   __pyx_pybuffer_d_log_likelihood_update.refcount = 0;
20277   __pyx_pybuffernd_d_log_likelihood_update.data = NULL;
20278   __pyx_pybuffernd_d_log_likelihood_update.rcbuffer = &__pyx_pybuffer_d_log_likelihood_update;
20279   __pyx_pybuffer_dm_pred_all_params.pybuffer.buf = NULL;
20280   __pyx_pybuffer_dm_pred_all_params.refcount = 0;
20281   __pyx_pybuffernd_dm_pred_all_params.data = NULL;
20282   __pyx_pybuffernd_dm_pred_all_params.rcbuffer = &__pyx_pybuffer_dm_pred_all_params;
20283   __pyx_pybuffer_dP_pred_all_params.pybuffer.buf = NULL;
20284   __pyx_pybuffer_dP_pred_all_params.refcount = 0;
20285   __pyx_pybuffernd_dP_pred_all_params.data = NULL;
20286   __pyx_pybuffernd_dP_pred_all_params.rcbuffer = &__pyx_pybuffer_dP_pred_all_params;
20287   __pyx_pybuffer_dH_all_params.pybuffer.buf = NULL;
20288   __pyx_pybuffer_dH_all_params.refcount = 0;
20289   __pyx_pybuffernd_dH_all_params.data = NULL;
20290   __pyx_pybuffernd_dH_all_params.rcbuffer = &__pyx_pybuffer_dH_all_params;
20291   __pyx_pybuffer_dR_all_params.pybuffer.buf = NULL;
20292   __pyx_pybuffer_dR_all_params.refcount = 0;
20293   __pyx_pybuffernd_dR_all_params.data = NULL;
20294   __pyx_pybuffernd_dR_all_params.rcbuffer = &__pyx_pybuffer_dR_all_params;
20295   __pyx_pybuffer_dH.pybuffer.buf = NULL;
20296   __pyx_pybuffer_dH.refcount = 0;
20297   __pyx_pybuffernd_dH.data = NULL;
20298   __pyx_pybuffernd_dH.rcbuffer = &__pyx_pybuffer_dH;
20299   __pyx_pybuffer_dR.pybuffer.buf = NULL;
20300   __pyx_pybuffer_dR.refcount = 0;
20301   __pyx_pybuffernd_dR.data = NULL;
20302   __pyx_pybuffernd_dR.rcbuffer = &__pyx_pybuffer_dR;
20303   __pyx_pybuffer_dm_pred.pybuffer.buf = NULL;
20304   __pyx_pybuffer_dm_pred.refcount = 0;
20305   __pyx_pybuffernd_dm_pred.data = NULL;
20306   __pyx_pybuffernd_dm_pred.rcbuffer = &__pyx_pybuffer_dm_pred;
20307   __pyx_pybuffer_dP_pred.pybuffer.buf = NULL;
20308   __pyx_pybuffer_dP_pred.refcount = 0;
20309   __pyx_pybuffernd_dP_pred.data = NULL;
20310   __pyx_pybuffernd_dP_pred.rcbuffer = &__pyx_pybuffer_dP_pred;
20311   __pyx_pybuffer_dv.pybuffer.buf = NULL;
20312   __pyx_pybuffer_dv.refcount = 0;
20313   __pyx_pybuffernd_dv.data = NULL;
20314   __pyx_pybuffernd_dv.rcbuffer = &__pyx_pybuffer_dv;
20315   __pyx_pybuffer_dS.pybuffer.buf = NULL;
20316   __pyx_pybuffer_dS.refcount = 0;
20317   __pyx_pybuffernd_dS.data = NULL;
20318   __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
20319   __pyx_pybuffer_tmp1.pybuffer.buf = NULL;
20320   __pyx_pybuffer_tmp1.refcount = 0;
20321   __pyx_pybuffernd_tmp1.data = NULL;
20322   __pyx_pybuffernd_tmp1.rcbuffer = &__pyx_pybuffer_tmp1;
20323   __pyx_pybuffer_tmp2.pybuffer.buf = NULL;
20324   __pyx_pybuffer_tmp2.refcount = 0;
20325   __pyx_pybuffernd_tmp2.data = NULL;
20326   __pyx_pybuffernd_tmp2.rcbuffer = &__pyx_pybuffer_tmp2;
20327   __pyx_pybuffer_tmp3.pybuffer.buf = NULL;
20328   __pyx_pybuffer_tmp3.refcount = 0;
20329   __pyx_pybuffernd_tmp3.data = NULL;
20330   __pyx_pybuffernd_tmp3.rcbuffer = &__pyx_pybuffer_tmp3;
20331   __pyx_pybuffer_dK.pybuffer.buf = NULL;
20332   __pyx_pybuffer_dK.refcount = 0;
20333   __pyx_pybuffernd_dK.data = NULL;
20334   __pyx_pybuffernd_dK.rcbuffer = &__pyx_pybuffer_dK;
20335   __pyx_pybuffer_tmp5.pybuffer.buf = NULL;
20336   __pyx_pybuffer_tmp5.refcount = 0;
20337   __pyx_pybuffernd_tmp5.data = NULL;
20338   __pyx_pybuffernd_tmp5.rcbuffer = &__pyx_pybuffer_tmp5;
20339   __pyx_pybuffer_p_m.pybuffer.buf = NULL;
20340   __pyx_pybuffer_p_m.refcount = 0;
20341   __pyx_pybuffernd_p_m.data = NULL;
20342   __pyx_pybuffernd_p_m.rcbuffer = &__pyx_pybuffer_p_m;
20343   __pyx_pybuffer_measurement.pybuffer.buf = NULL;
20344   __pyx_pybuffer_measurement.refcount = 0;
20345   __pyx_pybuffernd_measurement.data = NULL;
20346   __pyx_pybuffernd_measurement.rcbuffer = &__pyx_pybuffer_measurement;
20347   __pyx_pybuffer_p_dm.pybuffer.buf = NULL;
20348   __pyx_pybuffer_p_dm.refcount = 0;
20349   __pyx_pybuffernd_p_dm.data = NULL;
20350   __pyx_pybuffernd_p_dm.rcbuffer = &__pyx_pybuffer_p_dm;
20351   __pyx_pybuffer_p_dP.pybuffer.buf = NULL;
20352   __pyx_pybuffer_p_dP.refcount = 0;
20353   __pyx_pybuffernd_p_dP.data = NULL;
20354   __pyx_pybuffernd_p_dP.rcbuffer = &__pyx_pybuffer_p_dP;
20355   {
20356     __Pyx_BufFmt_StackElem __pyx_stack[1];
20357     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_m, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error)
20358   }
20359   __pyx_pybuffernd_p_m.diminfo[0].strides = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_m.diminfo[0].shape = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_m.diminfo[1].strides = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_m.diminfo[1].shape = __pyx_pybuffernd_p_m.rcbuffer->pybuffer.shape[1];
20360   {
20361     __Pyx_BufFmt_StackElem __pyx_stack[1];
20362     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_measurement.rcbuffer->pybuffer, (PyObject*)__pyx_v_measurement, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error)
20363   }
20364   __pyx_pybuffernd_measurement.diminfo[0].strides = __pyx_pybuffernd_measurement.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_measurement.diminfo[0].shape = __pyx_pybuffernd_measurement.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_measurement.diminfo[1].strides = __pyx_pybuffernd_measurement.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_measurement.diminfo[1].shape = __pyx_pybuffernd_measurement.rcbuffer->pybuffer.shape[1];
20365   {
20366     __Pyx_BufFmt_StackElem __pyx_stack[1];
20367     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_dm, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error)
20368   }
20369   __pyx_pybuffernd_p_dm.diminfo[0].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_dm.diminfo[0].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_dm.diminfo[1].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_dm.diminfo[1].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p_dm.diminfo[2].strides = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p_dm.diminfo[2].shape = __pyx_pybuffernd_p_dm.rcbuffer->pybuffer.shape[2];
20370   {
20371     __Pyx_BufFmt_StackElem __pyx_stack[1];
20372     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer, (PyObject*)__pyx_v_p_dP, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 686, __pyx_L1_error)
20373   }
20374   __pyx_pybuffernd_p_dP.diminfo[0].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_p_dP.diminfo[0].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_p_dP.diminfo[1].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_p_dP.diminfo[1].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_p_dP.diminfo[2].strides = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_p_dP.diminfo[2].shape = __pyx_pybuffernd_p_dP.rcbuffer->pybuffer.shape[2];
20375 
20376   /* "GPy/models/state_space_cython.pyx":768
20377  *     """
20378  *
20379  *     cdef np.ndarray[DTYPE_t, ndim=2] m_pred = p_m # from prediction step             # <<<<<<<<<<<<<<
20380  *     #P_pred,S_pred,V_pred = p_P # from prediction step
20381  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = p_P[0]
20382  */
20383   {
20384     __Pyx_BufFmt_StackElem __pyx_stack[1];
20385     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_p_m), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20386       __pyx_v_m_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.buf = NULL;
20387       __PYX_ERR(0, 768, __pyx_L1_error)
20388     } else {__pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
20389     }
20390   }
20391   __Pyx_INCREF(((PyObject *)__pyx_v_p_m));
20392   __pyx_v_m_pred = ((PyArrayObject *)__pyx_v_p_m);
20393 
20394   /* "GPy/models/state_space_cython.pyx":770
20395  *     cdef np.ndarray[DTYPE_t, ndim=2] m_pred = p_m # from prediction step
20396  *     #P_pred,S_pred,V_pred = p_P # from prediction step
20397  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = p_P[0]             # <<<<<<<<<<<<<<
20398  *     cdef np.ndarray[DTYPE_t, ndim=1] S_pred = p_P[1]
20399  *     cdef np.ndarray[DTYPE_t, ndim=2] V_pred = p_P[2]
20400  */
20401   if (unlikely(__pyx_v_p_P == Py_None)) {
20402     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20403     __PYX_ERR(0, 770, __pyx_L1_error)
20404   }
20405   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 0)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 0), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 770, __pyx_L1_error)
20406   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 0);
20407   __Pyx_INCREF(__pyx_t_1);
20408   {
20409     __Pyx_BufFmt_StackElem __pyx_stack[1];
20410     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20411       __pyx_v_P_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.buf = NULL;
20412       __PYX_ERR(0, 770, __pyx_L1_error)
20413     } else {__pyx_pybuffernd_P_pred.diminfo[0].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_pred.diminfo[0].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_pred.diminfo[1].strides = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_pred.diminfo[1].shape = __pyx_pybuffernd_P_pred.rcbuffer->pybuffer.shape[1];
20414     }
20415   }
20416   __pyx_v_P_pred = ((PyArrayObject *)__pyx_t_1);
20417   __pyx_t_1 = 0;
20418 
20419   /* "GPy/models/state_space_cython.pyx":771
20420  *     #P_pred,S_pred,V_pred = p_P # from prediction step
20421  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = p_P[0]
20422  *     cdef np.ndarray[DTYPE_t, ndim=1] S_pred = p_P[1]             # <<<<<<<<<<<<<<
20423  *     cdef np.ndarray[DTYPE_t, ndim=2] V_pred = p_P[2]
20424  *
20425  */
20426   if (unlikely(__pyx_v_p_P == Py_None)) {
20427     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20428     __PYX_ERR(0, 771, __pyx_L1_error)
20429   }
20430   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 1)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 1), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 771, __pyx_L1_error)
20431   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 1);
20432   __Pyx_INCREF(__pyx_t_1);
20433   {
20434     __Pyx_BufFmt_StackElem __pyx_stack[1];
20435     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S_pred.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
20436       __pyx_v_S_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S_pred.rcbuffer->pybuffer.buf = NULL;
20437       __PYX_ERR(0, 771, __pyx_L1_error)
20438     } else {__pyx_pybuffernd_S_pred.diminfo[0].strides = __pyx_pybuffernd_S_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S_pred.diminfo[0].shape = __pyx_pybuffernd_S_pred.rcbuffer->pybuffer.shape[0];
20439     }
20440   }
20441   __pyx_v_S_pred = ((PyArrayObject *)__pyx_t_1);
20442   __pyx_t_1 = 0;
20443 
20444   /* "GPy/models/state_space_cython.pyx":772
20445  *     cdef np.ndarray[DTYPE_t, ndim=2] P_pred = p_P[0]
20446  *     cdef np.ndarray[DTYPE_t, ndim=1] S_pred = p_P[1]
20447  *     cdef np.ndarray[DTYPE_t, ndim=2] V_pred = p_P[2]             # <<<<<<<<<<<<<<
20448  *
20449  *     cdef np.ndarray[DTYPE_t, ndim=2] H = p_measurement_callables.Hk(k, m_pred, P_pred)
20450  */
20451   if (unlikely(__pyx_v_p_P == Py_None)) {
20452     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20453     __PYX_ERR(0, 772, __pyx_L1_error)
20454   }
20455   if (!(likely(((PyTuple_GET_ITEM(__pyx_v_p_P, 2)) == Py_None) || likely(__Pyx_TypeTest(PyTuple_GET_ITEM(__pyx_v_p_P, 2), __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 772, __pyx_L1_error)
20456   __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_p_P, 2);
20457   __Pyx_INCREF(__pyx_t_1);
20458   {
20459     __Pyx_BufFmt_StackElem __pyx_stack[1];
20460     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_V_pred.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20461       __pyx_v_V_pred = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_V_pred.rcbuffer->pybuffer.buf = NULL;
20462       __PYX_ERR(0, 772, __pyx_L1_error)
20463     } else {__pyx_pybuffernd_V_pred.diminfo[0].strides = __pyx_pybuffernd_V_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_V_pred.diminfo[0].shape = __pyx_pybuffernd_V_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_V_pred.diminfo[1].strides = __pyx_pybuffernd_V_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_V_pred.diminfo[1].shape = __pyx_pybuffernd_V_pred.rcbuffer->pybuffer.shape[1];
20464     }
20465   }
20466   __pyx_v_V_pred = ((PyArrayObject *)__pyx_t_1);
20467   __pyx_t_1 = 0;
20468 
20469   /* "GPy/models/state_space_cython.pyx":774
20470  *     cdef np.ndarray[DTYPE_t, ndim=2] V_pred = p_P[2]
20471  *
20472  *     cdef np.ndarray[DTYPE_t, ndim=2] H = p_measurement_callables.Hk(k, m_pred, P_pred)             # <<<<<<<<<<<<<<
20473  *     cdef np.ndarray[DTYPE_t, ndim=2] R = p_measurement_callables.Rk(k)
20474  *     cdef np.ndarray[DTYPE_t, ndim=2] R_isr =p_measurement_callables.R_isrk(k) # square root of the inverse of R matrix
20475  */
20476   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->Hk(__pyx_v_p_measurement_callables, __pyx_v_k, ((PyArrayObject *)__pyx_v_m_pred), ((PyArrayObject *)__pyx_v_P_pred), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error)
20477   __Pyx_GOTREF(__pyx_t_1);
20478   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 774, __pyx_L1_error)
20479   __pyx_t_2 = ((PyArrayObject *)__pyx_t_1);
20480   {
20481     __Pyx_BufFmt_StackElem __pyx_stack[1];
20482     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_H.rcbuffer->pybuffer, (PyObject*)__pyx_t_2, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20483       __pyx_v_H = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_H.rcbuffer->pybuffer.buf = NULL;
20484       __PYX_ERR(0, 774, __pyx_L1_error)
20485     } else {__pyx_pybuffernd_H.diminfo[0].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_H.diminfo[0].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_H.diminfo[1].strides = __pyx_pybuffernd_H.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_H.diminfo[1].shape = __pyx_pybuffernd_H.rcbuffer->pybuffer.shape[1];
20486     }
20487   }
20488   __pyx_t_2 = 0;
20489   __pyx_v_H = ((PyArrayObject *)__pyx_t_1);
20490   __pyx_t_1 = 0;
20491 
20492   /* "GPy/models/state_space_cython.pyx":775
20493  *
20494  *     cdef np.ndarray[DTYPE_t, ndim=2] H = p_measurement_callables.Hk(k, m_pred, P_pred)
20495  *     cdef np.ndarray[DTYPE_t, ndim=2] R = p_measurement_callables.Rk(k)             # <<<<<<<<<<<<<<
20496  *     cdef np.ndarray[DTYPE_t, ndim=2] R_isr =p_measurement_callables.R_isrk(k) # square root of the inverse of R matrix
20497  *
20498  */
20499   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->Rk(__pyx_v_p_measurement_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
20500   __Pyx_GOTREF(__pyx_t_1);
20501   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 775, __pyx_L1_error)
20502   __pyx_t_3 = ((PyArrayObject *)__pyx_t_1);
20503   {
20504     __Pyx_BufFmt_StackElem __pyx_stack[1];
20505     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R.rcbuffer->pybuffer, (PyObject*)__pyx_t_3, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20506       __pyx_v_R = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_R.rcbuffer->pybuffer.buf = NULL;
20507       __PYX_ERR(0, 775, __pyx_L1_error)
20508     } else {__pyx_pybuffernd_R.diminfo[0].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R.diminfo[0].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R.diminfo[1].strides = __pyx_pybuffernd_R.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R.diminfo[1].shape = __pyx_pybuffernd_R.rcbuffer->pybuffer.shape[1];
20509     }
20510   }
20511   __pyx_t_3 = 0;
20512   __pyx_v_R = ((PyArrayObject *)__pyx_t_1);
20513   __pyx_t_1 = 0;
20514 
20515   /* "GPy/models/state_space_cython.pyx":776
20516  *     cdef np.ndarray[DTYPE_t, ndim=2] H = p_measurement_callables.Hk(k, m_pred, P_pred)
20517  *     cdef np.ndarray[DTYPE_t, ndim=2] R = p_measurement_callables.Rk(k)
20518  *     cdef np.ndarray[DTYPE_t, ndim=2] R_isr =p_measurement_callables.R_isrk(k) # square root of the inverse of R matrix             # <<<<<<<<<<<<<<
20519  *
20520  *     cdef int time_series_no = p_m.shape[1] # number of time serieses
20521  */
20522   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->R_isrk(__pyx_v_p_measurement_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
20523   __Pyx_GOTREF(__pyx_t_1);
20524   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 776, __pyx_L1_error)
20525   __pyx_t_4 = ((PyArrayObject *)__pyx_t_1);
20526   {
20527     __Pyx_BufFmt_StackElem __pyx_stack[1];
20528     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_R_isr.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20529       __pyx_v_R_isr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_R_isr.rcbuffer->pybuffer.buf = NULL;
20530       __PYX_ERR(0, 776, __pyx_L1_error)
20531     } else {__pyx_pybuffernd_R_isr.diminfo[0].strides = __pyx_pybuffernd_R_isr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_R_isr.diminfo[0].shape = __pyx_pybuffernd_R_isr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_R_isr.diminfo[1].strides = __pyx_pybuffernd_R_isr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_R_isr.diminfo[1].shape = __pyx_pybuffernd_R_isr.rcbuffer->pybuffer.shape[1];
20532     }
20533   }
20534   __pyx_t_4 = 0;
20535   __pyx_v_R_isr = ((PyArrayObject *)__pyx_t_1);
20536   __pyx_t_1 = 0;
20537 
20538   /* "GPy/models/state_space_cython.pyx":778
20539  *     cdef np.ndarray[DTYPE_t, ndim=2] R_isr =p_measurement_callables.R_isrk(k) # square root of the inverse of R matrix
20540  *
20541  *     cdef int time_series_no = p_m.shape[1] # number of time serieses             # <<<<<<<<<<<<<<
20542  *
20543  *     cdef np.ndarray[DTYPE_t, ndim=2] log_likelihood_update # log_likelihood_update=None;
20544  */
20545   __pyx_v_time_series_no = (__pyx_v_p_m->dimensions[1]);
20546 
20547   /* "GPy/models/state_space_cython.pyx":783
20548  *     # Update step (only if there is data)
20549  *     #if not np.any(np.isnan(measurement)): # TODO: if some dimensions are missing, do properly computations for other.
20550  *     cdef np.ndarray[DTYPE_t, ndim=2] v = measurement-p_measurement_callables.f_h(k, m_pred, H)             # <<<<<<<<<<<<<<
20551  *
20552  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_2_matr = np.vstack( ( np.dot( R_isr.T, np.dot(H, V_pred)) , np.diag( 1.0/np.sqrt(S_pred) ) ) )
20553  */
20554   __pyx_t_1 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->f_h(__pyx_v_p_measurement_callables, __pyx_v_k, ((PyArrayObject *)__pyx_v_m_pred), ((PyArrayObject *)__pyx_v_H), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
20555   __Pyx_GOTREF(__pyx_t_1);
20556   __pyx_t_5 = PyNumber_Subtract(((PyObject *)__pyx_v_measurement), __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 783, __pyx_L1_error)
20557   __Pyx_GOTREF(__pyx_t_5);
20558   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20559   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 783, __pyx_L1_error)
20560   __pyx_t_6 = ((PyArrayObject *)__pyx_t_5);
20561   {
20562     __Pyx_BufFmt_StackElem __pyx_stack[1];
20563     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20564       __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL;
20565       __PYX_ERR(0, 783, __pyx_L1_error)
20566     } else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1];
20567     }
20568   }
20569   __pyx_t_6 = 0;
20570   __pyx_v_v = ((PyArrayObject *)__pyx_t_5);
20571   __pyx_t_5 = 0;
20572 
20573   /* "GPy/models/state_space_cython.pyx":785
20574  *     cdef np.ndarray[DTYPE_t, ndim=2] v = measurement-p_measurement_callables.f_h(k, m_pred, H)
20575  *
20576  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_2_matr = np.vstack( ( np.dot( R_isr.T, np.dot(H, V_pred)) , np.diag( 1.0/np.sqrt(S_pred) ) ) )             # <<<<<<<<<<<<<<
20577  *
20578  *     res = sp.linalg.svd( svd_2_matr,full_matrices=False, compute_uv=True,
20579  */
20580   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
20581   __Pyx_GOTREF(__pyx_t_1);
20582   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_vstack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 785, __pyx_L1_error)
20583   __Pyx_GOTREF(__pyx_t_7);
20584   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20585   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error)
20586   __Pyx_GOTREF(__pyx_t_8);
20587   __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_dot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 785, __pyx_L1_error)
20588   __Pyx_GOTREF(__pyx_t_9);
20589   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20590   __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_R_isr), __pyx_n_s_T); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error)
20591   __Pyx_GOTREF(__pyx_t_8);
20592   __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 785, __pyx_L1_error)
20593   __Pyx_GOTREF(__pyx_t_11);
20594   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 785, __pyx_L1_error)
20595   __Pyx_GOTREF(__pyx_t_12);
20596   __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
20597   __pyx_t_11 = NULL;
20598   __pyx_t_13 = 0;
20599   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
20600     __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
20601     if (likely(__pyx_t_11)) {
20602       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
20603       __Pyx_INCREF(__pyx_t_11);
20604       __Pyx_INCREF(function);
20605       __Pyx_DECREF_SET(__pyx_t_12, function);
20606       __pyx_t_13 = 1;
20607     }
20608   }
20609   #if CYTHON_FAST_PYCALL
20610   if (PyFunction_Check(__pyx_t_12)) {
20611     PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_V_pred)};
20612     __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error)
20613     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20614     __Pyx_GOTREF(__pyx_t_10);
20615   } else
20616   #endif
20617   #if CYTHON_FAST_PYCCALL
20618   if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
20619     PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_V_pred)};
20620     __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error)
20621     __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
20622     __Pyx_GOTREF(__pyx_t_10);
20623   } else
20624   #endif
20625   {
20626     __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L1_error)
20627     __Pyx_GOTREF(__pyx_t_14);
20628     if (__pyx_t_11) {
20629       __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11); __pyx_t_11 = NULL;
20630     }
20631     __Pyx_INCREF(((PyObject *)__pyx_v_H));
20632     __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
20633     PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, ((PyObject *)__pyx_v_H));
20634     __Pyx_INCREF(((PyObject *)__pyx_v_V_pred));
20635     __Pyx_GIVEREF(((PyObject *)__pyx_v_V_pred));
20636     PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, ((PyObject *)__pyx_v_V_pred));
20637     __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error)
20638     __Pyx_GOTREF(__pyx_t_10);
20639     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
20640   }
20641   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
20642   __pyx_t_12 = NULL;
20643   __pyx_t_13 = 0;
20644   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
20645     __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
20646     if (likely(__pyx_t_12)) {
20647       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
20648       __Pyx_INCREF(__pyx_t_12);
20649       __Pyx_INCREF(function);
20650       __Pyx_DECREF_SET(__pyx_t_9, function);
20651       __pyx_t_13 = 1;
20652     }
20653   }
20654   #if CYTHON_FAST_PYCALL
20655   if (PyFunction_Check(__pyx_t_9)) {
20656     PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_8, __pyx_t_10};
20657     __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
20658     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
20659     __Pyx_GOTREF(__pyx_t_1);
20660     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20661     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20662   } else
20663   #endif
20664   #if CYTHON_FAST_PYCCALL
20665   if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
20666     PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_8, __pyx_t_10};
20667     __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
20668     __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
20669     __Pyx_GOTREF(__pyx_t_1);
20670     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20671     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20672   } else
20673   #endif
20674   {
20675     __pyx_t_14 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L1_error)
20676     __Pyx_GOTREF(__pyx_t_14);
20677     if (__pyx_t_12) {
20678       __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
20679     }
20680     __Pyx_GIVEREF(__pyx_t_8);
20681     PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_13, __pyx_t_8);
20682     __Pyx_GIVEREF(__pyx_t_10);
20683     PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_13, __pyx_t_10);
20684     __pyx_t_8 = 0;
20685     __pyx_t_10 = 0;
20686     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
20687     __Pyx_GOTREF(__pyx_t_1);
20688     __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
20689   }
20690   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20691   __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L1_error)
20692   __Pyx_GOTREF(__pyx_t_14);
20693   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_diag); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error)
20694   __Pyx_GOTREF(__pyx_t_10);
20695   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
20696   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 785, __pyx_L1_error)
20697   __Pyx_GOTREF(__pyx_t_8);
20698   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 785, __pyx_L1_error)
20699   __Pyx_GOTREF(__pyx_t_12);
20700   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
20701   __pyx_t_8 = NULL;
20702   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
20703     __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_12);
20704     if (likely(__pyx_t_8)) {
20705       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
20706       __Pyx_INCREF(__pyx_t_8);
20707       __Pyx_INCREF(function);
20708       __Pyx_DECREF_SET(__pyx_t_12, function);
20709     }
20710   }
20711   __pyx_t_14 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_8, ((PyObject *)__pyx_v_S_pred)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_v_S_pred));
20712   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20713   if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 785, __pyx_L1_error)
20714   __Pyx_GOTREF(__pyx_t_14);
20715   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
20716   __pyx_t_12 = __Pyx_PyFloat_DivideCObj(__pyx_float_1_0, __pyx_t_14, 1.0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 785, __pyx_L1_error)
20717   __Pyx_GOTREF(__pyx_t_12);
20718   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
20719   __pyx_t_14 = NULL;
20720   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
20721     __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_10);
20722     if (likely(__pyx_t_14)) {
20723       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
20724       __Pyx_INCREF(__pyx_t_14);
20725       __Pyx_INCREF(function);
20726       __Pyx_DECREF_SET(__pyx_t_10, function);
20727     }
20728   }
20729   __pyx_t_9 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_12);
20730   __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
20731   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
20732   if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 785, __pyx_L1_error)
20733   __Pyx_GOTREF(__pyx_t_9);
20734   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20735   __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error)
20736   __Pyx_GOTREF(__pyx_t_10);
20737   __Pyx_GIVEREF(__pyx_t_1);
20738   PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
20739   __Pyx_GIVEREF(__pyx_t_9);
20740   PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
20741   __pyx_t_1 = 0;
20742   __pyx_t_9 = 0;
20743   __pyx_t_9 = NULL;
20744   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20745     __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
20746     if (likely(__pyx_t_9)) {
20747       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20748       __Pyx_INCREF(__pyx_t_9);
20749       __Pyx_INCREF(function);
20750       __Pyx_DECREF_SET(__pyx_t_7, function);
20751     }
20752   }
20753   __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10);
20754   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
20755   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20756   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __pyx_L1_error)
20757   __Pyx_GOTREF(__pyx_t_5);
20758   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20759   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 785, __pyx_L1_error)
20760   __pyx_t_15 = ((PyArrayObject *)__pyx_t_5);
20761   {
20762     __Pyx_BufFmt_StackElem __pyx_stack[1];
20763     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20764       __pyx_v_svd_2_matr = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer.buf = NULL;
20765       __PYX_ERR(0, 785, __pyx_L1_error)
20766     } else {__pyx_pybuffernd_svd_2_matr.diminfo[0].strides = __pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_svd_2_matr.diminfo[0].shape = __pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_svd_2_matr.diminfo[1].strides = __pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_svd_2_matr.diminfo[1].shape = __pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer.shape[1];
20767     }
20768   }
20769   __pyx_t_15 = 0;
20770   __pyx_v_svd_2_matr = ((PyArrayObject *)__pyx_t_5);
20771   __pyx_t_5 = 0;
20772 
20773   /* "GPy/models/state_space_cython.pyx":787
20774  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_2_matr = np.vstack( ( np.dot( R_isr.T, np.dot(H, V_pred)) , np.diag( 1.0/np.sqrt(S_pred) ) ) )
20775  *
20776  *     res = sp.linalg.svd( svd_2_matr,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
20777  *                  overwrite_a=False,check_finite=True)
20778  *
20779  */
20780   __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error)
20781   __Pyx_GOTREF(__pyx_t_5);
20782   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_linalg); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 787, __pyx_L1_error)
20783   __Pyx_GOTREF(__pyx_t_7);
20784   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20785   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_svd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error)
20786   __Pyx_GOTREF(__pyx_t_5);
20787   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20788   __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 787, __pyx_L1_error)
20789   __Pyx_GOTREF(__pyx_t_7);
20790   __Pyx_INCREF(((PyObject *)__pyx_v_svd_2_matr));
20791   __Pyx_GIVEREF(((PyObject *)__pyx_v_svd_2_matr));
20792   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_svd_2_matr));
20793   __pyx_t_10 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 787, __pyx_L1_error)
20794   __Pyx_GOTREF(__pyx_t_10);
20795   if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
20796   if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
20797 
20798   /* "GPy/models/state_space_cython.pyx":788
20799  *
20800  *     res = sp.linalg.svd( svd_2_matr,full_matrices=False, compute_uv=True,
20801  *                  overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
20802  *
20803  *     #(U,S,Vh)
20804  */
20805   if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
20806   if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
20807 
20808   /* "GPy/models/state_space_cython.pyx":787
20809  *     cdef np.ndarray[DTYPE_t, ndim=2] svd_2_matr = np.vstack( ( np.dot( R_isr.T, np.dot(H, V_pred)) , np.diag( 1.0/np.sqrt(S_pred) ) ) )
20810  *
20811  *     res = sp.linalg.svd( svd_2_matr,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
20812  *                  overwrite_a=False,check_finite=True)
20813  *
20814  */
20815   __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 787, __pyx_L1_error)
20816   __Pyx_GOTREF(__pyx_t_9);
20817   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
20818   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20819   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20820   __pyx_v_res = __pyx_t_9;
20821   __pyx_t_9 = 0;
20822 
20823   /* "GPy/models/state_space_cython.pyx":791
20824  *
20825  *     #(U,S,Vh)
20826  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]             # <<<<<<<<<<<<<<
20827  *     cdef np.ndarray[DTYPE_t, ndim=1] S_svd = res[1]
20828  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]
20829  */
20830   __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_res, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 791, __pyx_L1_error)
20831   __Pyx_GOTREF(__pyx_t_9);
20832   if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 791, __pyx_L1_error)
20833   __pyx_t_16 = ((PyArrayObject *)__pyx_t_9);
20834   {
20835     __Pyx_BufFmt_StackElem __pyx_stack[1];
20836     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20837       __pyx_v_U = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U.rcbuffer->pybuffer.buf = NULL;
20838       __PYX_ERR(0, 791, __pyx_L1_error)
20839     } else {__pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
20840     }
20841   }
20842   __pyx_t_16 = 0;
20843   __pyx_v_U = ((PyArrayObject *)__pyx_t_9);
20844   __pyx_t_9 = 0;
20845 
20846   /* "GPy/models/state_space_cython.pyx":792
20847  *     #(U,S,Vh)
20848  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]
20849  *     cdef np.ndarray[DTYPE_t, ndim=1] S_svd = res[1]             # <<<<<<<<<<<<<<
20850  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]
20851  *
20852  */
20853   __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_res, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 792, __pyx_L1_error)
20854   __Pyx_GOTREF(__pyx_t_9);
20855   if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 792, __pyx_L1_error)
20856   __pyx_t_17 = ((PyArrayObject *)__pyx_t_9);
20857   {
20858     __Pyx_BufFmt_StackElem __pyx_stack[1];
20859     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S_svd.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
20860       __pyx_v_S_svd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S_svd.rcbuffer->pybuffer.buf = NULL;
20861       __PYX_ERR(0, 792, __pyx_L1_error)
20862     } else {__pyx_pybuffernd_S_svd.diminfo[0].strides = __pyx_pybuffernd_S_svd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S_svd.diminfo[0].shape = __pyx_pybuffernd_S_svd.rcbuffer->pybuffer.shape[0];
20863     }
20864   }
20865   __pyx_t_17 = 0;
20866   __pyx_v_S_svd = ((PyArrayObject *)__pyx_t_9);
20867   __pyx_t_9 = 0;
20868 
20869   /* "GPy/models/state_space_cython.pyx":793
20870  *     cdef np.ndarray[DTYPE_t, ndim=2] U = res[0]
20871  *     cdef np.ndarray[DTYPE_t, ndim=1] S_svd = res[1]
20872  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh = res[2]             # <<<<<<<<<<<<<<
20873  *
20874  *      # P_upd = U_upd S_upd**2 U_upd.T
20875  */
20876   __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_res, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 793, __pyx_L1_error)
20877   __Pyx_GOTREF(__pyx_t_9);
20878   if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 793, __pyx_L1_error)
20879   __pyx_t_18 = ((PyArrayObject *)__pyx_t_9);
20880   {
20881     __Pyx_BufFmt_StackElem __pyx_stack[1];
20882     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20883       __pyx_v_Vh = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_Vh.rcbuffer->pybuffer.buf = NULL;
20884       __PYX_ERR(0, 793, __pyx_L1_error)
20885     } else {__pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
20886     }
20887   }
20888   __pyx_t_18 = 0;
20889   __pyx_v_Vh = ((PyArrayObject *)__pyx_t_9);
20890   __pyx_t_9 = 0;
20891 
20892   /* "GPy/models/state_space_cython.pyx":796
20893  *
20894  *      # P_upd = U_upd S_upd**2 U_upd.T
20895  *     cdef np.ndarray[DTYPE_t, ndim=2] U_upd = np.dot(V_pred, Vh.T)             # <<<<<<<<<<<<<<
20896  *     cdef np.ndarray[DTYPE_t, ndim=1] S_upd = (1.0/S_svd)**2
20897  *
20898  */
20899   __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L1_error)
20900   __Pyx_GOTREF(__pyx_t_10);
20901   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 796, __pyx_L1_error)
20902   __Pyx_GOTREF(__pyx_t_7);
20903   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20904   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_Vh), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L1_error)
20905   __Pyx_GOTREF(__pyx_t_10);
20906   __pyx_t_5 = NULL;
20907   __pyx_t_13 = 0;
20908   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
20909     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
20910     if (likely(__pyx_t_5)) {
20911       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20912       __Pyx_INCREF(__pyx_t_5);
20913       __Pyx_INCREF(function);
20914       __Pyx_DECREF_SET(__pyx_t_7, function);
20915       __pyx_t_13 = 1;
20916     }
20917   }
20918   #if CYTHON_FAST_PYCALL
20919   if (PyFunction_Check(__pyx_t_7)) {
20920     PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_V_pred), __pyx_t_10};
20921     __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 796, __pyx_L1_error)
20922     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20923     __Pyx_GOTREF(__pyx_t_9);
20924     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20925   } else
20926   #endif
20927   #if CYTHON_FAST_PYCCALL
20928   if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
20929     PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_V_pred), __pyx_t_10};
20930     __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 796, __pyx_L1_error)
20931     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20932     __Pyx_GOTREF(__pyx_t_9);
20933     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
20934   } else
20935   #endif
20936   {
20937     __pyx_t_1 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
20938     __Pyx_GOTREF(__pyx_t_1);
20939     if (__pyx_t_5) {
20940       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
20941     }
20942     __Pyx_INCREF(((PyObject *)__pyx_v_V_pred));
20943     __Pyx_GIVEREF(((PyObject *)__pyx_v_V_pred));
20944     PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_13, ((PyObject *)__pyx_v_V_pred));
20945     __Pyx_GIVEREF(__pyx_t_10);
20946     PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_13, __pyx_t_10);
20947     __pyx_t_10 = 0;
20948     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 796, __pyx_L1_error)
20949     __Pyx_GOTREF(__pyx_t_9);
20950     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20951   }
20952   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20953   if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 796, __pyx_L1_error)
20954   __pyx_t_19 = ((PyArrayObject *)__pyx_t_9);
20955   {
20956     __Pyx_BufFmt_StackElem __pyx_stack[1];
20957     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
20958       __pyx_v_U_upd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_U_upd.rcbuffer->pybuffer.buf = NULL;
20959       __PYX_ERR(0, 796, __pyx_L1_error)
20960     } else {__pyx_pybuffernd_U_upd.diminfo[0].strides = __pyx_pybuffernd_U_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U_upd.diminfo[0].shape = __pyx_pybuffernd_U_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U_upd.diminfo[1].strides = __pyx_pybuffernd_U_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U_upd.diminfo[1].shape = __pyx_pybuffernd_U_upd.rcbuffer->pybuffer.shape[1];
20961     }
20962   }
20963   __pyx_t_19 = 0;
20964   __pyx_v_U_upd = ((PyArrayObject *)__pyx_t_9);
20965   __pyx_t_9 = 0;
20966 
20967   /* "GPy/models/state_space_cython.pyx":797
20968  *      # P_upd = U_upd S_upd**2 U_upd.T
20969  *     cdef np.ndarray[DTYPE_t, ndim=2] U_upd = np.dot(V_pred, Vh.T)
20970  *     cdef np.ndarray[DTYPE_t, ndim=1] S_upd = (1.0/S_svd)**2             # <<<<<<<<<<<<<<
20971  *
20972  *     cdef np.ndarray[DTYPE_t, ndim=2] P_upd = np.dot(U_upd * S_upd, U_upd.T) # update covariance
20973  */
20974   __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_float_1_0, ((PyObject *)__pyx_v_S_svd)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 797, __pyx_L1_error)
20975   __Pyx_GOTREF(__pyx_t_9);
20976   __pyx_t_7 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error)
20977   __Pyx_GOTREF(__pyx_t_7);
20978   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20979   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 797, __pyx_L1_error)
20980   __pyx_t_20 = ((PyArrayObject *)__pyx_t_7);
20981   {
20982     __Pyx_BufFmt_StackElem __pyx_stack[1];
20983     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_20, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
20984       __pyx_v_S_upd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S_upd.rcbuffer->pybuffer.buf = NULL;
20985       __PYX_ERR(0, 797, __pyx_L1_error)
20986     } else {__pyx_pybuffernd_S_upd.diminfo[0].strides = __pyx_pybuffernd_S_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S_upd.diminfo[0].shape = __pyx_pybuffernd_S_upd.rcbuffer->pybuffer.shape[0];
20987     }
20988   }
20989   __pyx_t_20 = 0;
20990   __pyx_v_S_upd = ((PyArrayObject *)__pyx_t_7);
20991   __pyx_t_7 = 0;
20992 
20993   /* "GPy/models/state_space_cython.pyx":799
20994  *     cdef np.ndarray[DTYPE_t, ndim=1] S_upd = (1.0/S_svd)**2
20995  *
20996  *     cdef np.ndarray[DTYPE_t, ndim=2] P_upd = np.dot(U_upd * S_upd, U_upd.T) # update covariance             # <<<<<<<<<<<<<<
20997  *     #P_upd = (P_upd,S_upd,U_upd) # tuple to pass to the next step
20998  *
20999  */
21000   __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 799, __pyx_L1_error)
21001   __Pyx_GOTREF(__pyx_t_9);
21002   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 799, __pyx_L1_error)
21003   __Pyx_GOTREF(__pyx_t_1);
21004   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21005   __pyx_t_9 = PyNumber_Multiply(((PyObject *)__pyx_v_U_upd), ((PyObject *)__pyx_v_S_upd)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 799, __pyx_L1_error)
21006   __Pyx_GOTREF(__pyx_t_9);
21007   __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_U_upd), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 799, __pyx_L1_error)
21008   __Pyx_GOTREF(__pyx_t_10);
21009   __pyx_t_5 = NULL;
21010   __pyx_t_13 = 0;
21011   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
21012     __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
21013     if (likely(__pyx_t_5)) {
21014       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21015       __Pyx_INCREF(__pyx_t_5);
21016       __Pyx_INCREF(function);
21017       __Pyx_DECREF_SET(__pyx_t_1, function);
21018       __pyx_t_13 = 1;
21019     }
21020   }
21021   #if CYTHON_FAST_PYCALL
21022   if (PyFunction_Check(__pyx_t_1)) {
21023     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_10};
21024     __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 799, __pyx_L1_error)
21025     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21026     __Pyx_GOTREF(__pyx_t_7);
21027     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21028     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21029   } else
21030   #endif
21031   #if CYTHON_FAST_PYCCALL
21032   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
21033     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_10};
21034     __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 799, __pyx_L1_error)
21035     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
21036     __Pyx_GOTREF(__pyx_t_7);
21037     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21038     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21039   } else
21040   #endif
21041   {
21042     __pyx_t_12 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 799, __pyx_L1_error)
21043     __Pyx_GOTREF(__pyx_t_12);
21044     if (__pyx_t_5) {
21045       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5); __pyx_t_5 = NULL;
21046     }
21047     __Pyx_GIVEREF(__pyx_t_9);
21048     PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_13, __pyx_t_9);
21049     __Pyx_GIVEREF(__pyx_t_10);
21050     PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_13, __pyx_t_10);
21051     __pyx_t_9 = 0;
21052     __pyx_t_10 = 0;
21053     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 799, __pyx_L1_error)
21054     __Pyx_GOTREF(__pyx_t_7);
21055     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21056   }
21057   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21058   if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 799, __pyx_L1_error)
21059   __pyx_t_21 = ((PyArrayObject *)__pyx_t_7);
21060   {
21061     __Pyx_BufFmt_StackElem __pyx_stack[1];
21062     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_21, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21063       __pyx_v_P_upd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_P_upd.rcbuffer->pybuffer.buf = NULL;
21064       __PYX_ERR(0, 799, __pyx_L1_error)
21065     } else {__pyx_pybuffernd_P_upd.diminfo[0].strides = __pyx_pybuffernd_P_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_upd.diminfo[0].shape = __pyx_pybuffernd_P_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_upd.diminfo[1].strides = __pyx_pybuffernd_P_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_upd.diminfo[1].shape = __pyx_pybuffernd_P_upd.rcbuffer->pybuffer.shape[1];
21066     }
21067   }
21068   __pyx_t_21 = 0;
21069   __pyx_v_P_upd = ((PyArrayObject *)__pyx_t_7);
21070   __pyx_t_7 = 0;
21071 
21072   /* "GPy/models/state_space_cython.pyx":803
21073  *
21074  *      # stil need to compute S and K for derivative computation
21075  *     cdef np.ndarray[DTYPE_t, ndim=2] S = H.dot(P_pred).dot(H.T) + R             # <<<<<<<<<<<<<<
21076  *     cdef np.ndarray[DTYPE_t, ndim=2] K
21077  *     cdef bint measurement_dim_gt_one = False
21078  */
21079   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 803, __pyx_L1_error)
21080   __Pyx_GOTREF(__pyx_t_12);
21081   __pyx_t_10 = NULL;
21082   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
21083     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
21084     if (likely(__pyx_t_10)) {
21085       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
21086       __Pyx_INCREF(__pyx_t_10);
21087       __Pyx_INCREF(function);
21088       __Pyx_DECREF_SET(__pyx_t_12, function);
21089     }
21090   }
21091   __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_10, ((PyObject *)__pyx_v_P_pred)) : __Pyx_PyObject_CallOneArg(__pyx_t_12, ((PyObject *)__pyx_v_P_pred));
21092   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21093   if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
21094   __Pyx_GOTREF(__pyx_t_1);
21095   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21096   __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 803, __pyx_L1_error)
21097   __Pyx_GOTREF(__pyx_t_12);
21098   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21099   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 803, __pyx_L1_error)
21100   __Pyx_GOTREF(__pyx_t_1);
21101   __pyx_t_10 = NULL;
21102   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
21103     __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
21104     if (likely(__pyx_t_10)) {
21105       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
21106       __Pyx_INCREF(__pyx_t_10);
21107       __Pyx_INCREF(function);
21108       __Pyx_DECREF_SET(__pyx_t_12, function);
21109     }
21110   }
21111   __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1);
21112   __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21113   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21114   if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 803, __pyx_L1_error)
21115   __Pyx_GOTREF(__pyx_t_7);
21116   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21117   __pyx_t_12 = PyNumber_Add(__pyx_t_7, ((PyObject *)__pyx_v_R)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 803, __pyx_L1_error)
21118   __Pyx_GOTREF(__pyx_t_12);
21119   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21120   if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 803, __pyx_L1_error)
21121   __pyx_t_22 = ((PyArrayObject *)__pyx_t_12);
21122   {
21123     __Pyx_BufFmt_StackElem __pyx_stack[1];
21124     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21125       __pyx_v_S = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_S.rcbuffer->pybuffer.buf = NULL;
21126       __PYX_ERR(0, 803, __pyx_L1_error)
21127     } else {__pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_S.diminfo[1].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_S.diminfo[1].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[1];
21128     }
21129   }
21130   __pyx_t_22 = 0;
21131   __pyx_v_S = ((PyArrayObject *)__pyx_t_12);
21132   __pyx_t_12 = 0;
21133 
21134   /* "GPy/models/state_space_cython.pyx":805
21135  *     cdef np.ndarray[DTYPE_t, ndim=2] S = H.dot(P_pred).dot(H.T) + R
21136  *     cdef np.ndarray[DTYPE_t, ndim=2] K
21137  *     cdef bint measurement_dim_gt_one = False             # <<<<<<<<<<<<<<
21138  *     if measurement.shape[0]==1: # measurements are one dimensional
21139  *         if (S < 0):
21140  */
21141   __pyx_v_measurement_dim_gt_one = 0;
21142 
21143   /* "GPy/models/state_space_cython.pyx":806
21144  *     cdef np.ndarray[DTYPE_t, ndim=2] K
21145  *     cdef bint measurement_dim_gt_one = False
21146  *     if measurement.shape[0]==1: # measurements are one dimensional             # <<<<<<<<<<<<<<
21147  *         if (S < 0):
21148  *             raise ValueError("Kalman Filter Update SVD: S is negative step %i" % k )
21149  */
21150   __pyx_t_23 = (((__pyx_v_measurement->dimensions[0]) == 1) != 0);
21151   if (likely(__pyx_t_23)) {
21152 
21153     /* "GPy/models/state_space_cython.pyx":807
21154  *     cdef bint measurement_dim_gt_one = False
21155  *     if measurement.shape[0]==1: # measurements are one dimensional
21156  *         if (S < 0):             # <<<<<<<<<<<<<<
21157  *             raise ValueError("Kalman Filter Update SVD: S is negative step %i" % k )
21158  *             #import pdb; pdb.set_trace()
21159  */
21160     __pyx_t_12 = PyObject_RichCompare(((PyObject *)__pyx_v_S), __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 807, __pyx_L1_error)
21161     __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 807, __pyx_L1_error)
21162     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21163     if (unlikely(__pyx_t_23)) {
21164 
21165       /* "GPy/models/state_space_cython.pyx":808
21166  *     if measurement.shape[0]==1: # measurements are one dimensional
21167  *         if (S < 0):
21168  *             raise ValueError("Kalman Filter Update SVD: S is negative step %i" % k )             # <<<<<<<<<<<<<<
21169  *             #import pdb; pdb.set_trace()
21170  *
21171  */
21172       __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_v_k); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error)
21173       __Pyx_GOTREF(__pyx_t_12);
21174       __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Kalman_Filter_Update_SVD_S_is_ne, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 808, __pyx_L1_error)
21175       __Pyx_GOTREF(__pyx_t_7);
21176       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21177       __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 808, __pyx_L1_error)
21178       __Pyx_GOTREF(__pyx_t_12);
21179       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21180       __Pyx_Raise(__pyx_t_12, 0, 0, 0);
21181       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21182       __PYX_ERR(0, 808, __pyx_L1_error)
21183 
21184       /* "GPy/models/state_space_cython.pyx":807
21185  *     cdef bint measurement_dim_gt_one = False
21186  *     if measurement.shape[0]==1: # measurements are one dimensional
21187  *         if (S < 0):             # <<<<<<<<<<<<<<
21188  *             raise ValueError("Kalman Filter Update SVD: S is negative step %i" % k )
21189  *             #import pdb; pdb.set_trace()
21190  */
21191     }
21192 
21193     /* "GPy/models/state_space_cython.pyx":811
21194  *             #import pdb; pdb.set_trace()
21195  *
21196  *         K = P_pred.dot(H.T) / S             # <<<<<<<<<<<<<<
21197  *         if calc_log_likelihood:
21198  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +
21199  */
21200     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_P_pred), __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
21201     __Pyx_GOTREF(__pyx_t_7);
21202     __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 811, __pyx_L1_error)
21203     __Pyx_GOTREF(__pyx_t_1);
21204     __pyx_t_10 = NULL;
21205     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
21206       __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
21207       if (likely(__pyx_t_10)) {
21208         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
21209         __Pyx_INCREF(__pyx_t_10);
21210         __Pyx_INCREF(function);
21211         __Pyx_DECREF_SET(__pyx_t_7, function);
21212       }
21213     }
21214     __pyx_t_12 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1);
21215     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21216     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21217     if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 811, __pyx_L1_error)
21218     __Pyx_GOTREF(__pyx_t_12);
21219     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21220     __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_12, ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 811, __pyx_L1_error)
21221     __Pyx_GOTREF(__pyx_t_7);
21222     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21223     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 811, __pyx_L1_error)
21224     __pyx_t_24 = ((PyArrayObject *)__pyx_t_7);
21225     {
21226       __Pyx_BufFmt_StackElem __pyx_stack[1];
21227       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_K.rcbuffer->pybuffer);
21228       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_K.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21229       if (unlikely(__pyx_t_13 < 0)) {
21230         PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21231         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_K.rcbuffer->pybuffer, (PyObject*)__pyx_v_K, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21232           Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21233           __Pyx_RaiseBufferFallbackError();
21234         } else {
21235           PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21236         }
21237         __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21238       }
21239       __pyx_pybuffernd_K.diminfo[0].strides = __pyx_pybuffernd_K.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_K.diminfo[0].shape = __pyx_pybuffernd_K.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_K.diminfo[1].strides = __pyx_pybuffernd_K.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_K.diminfo[1].shape = __pyx_pybuffernd_K.rcbuffer->pybuffer.shape[1];
21240       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 811, __pyx_L1_error)
21241     }
21242     __pyx_t_24 = 0;
21243     __pyx_v_K = ((PyArrayObject *)__pyx_t_7);
21244     __pyx_t_7 = 0;
21245 
21246     /* "GPy/models/state_space_cython.pyx":812
21247  *
21248  *         K = P_pred.dot(H.T) / S
21249  *         if calc_log_likelihood:             # <<<<<<<<<<<<<<
21250  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +
21251  *                                  v*v / S)
21252  */
21253     __pyx_t_23 = (__pyx_v_calc_log_likelihood != 0);
21254     if (__pyx_t_23) {
21255 
21256       /* "GPy/models/state_space_cython.pyx":813
21257  *         K = P_pred.dot(H.T) / S
21258  *         if calc_log_likelihood:
21259  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +             # <<<<<<<<<<<<<<
21260  *                                  v*v / S)
21261  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21262  */
21263       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 813, __pyx_L1_error)
21264       __Pyx_GOTREF(__pyx_t_12);
21265       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
21266       __Pyx_GOTREF(__pyx_t_1);
21267       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21268       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 813, __pyx_L1_error)
21269       __Pyx_GOTREF(__pyx_t_12);
21270       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_pi); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
21271       __Pyx_GOTREF(__pyx_t_10);
21272       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21273       __pyx_t_12 = PyNumber_Multiply(__pyx_int_2, __pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 813, __pyx_L1_error)
21274       __Pyx_GOTREF(__pyx_t_12);
21275       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21276       __pyx_t_10 = NULL;
21277       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
21278         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_1);
21279         if (likely(__pyx_t_10)) {
21280           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
21281           __Pyx_INCREF(__pyx_t_10);
21282           __Pyx_INCREF(function);
21283           __Pyx_DECREF_SET(__pyx_t_1, function);
21284         }
21285       }
21286       __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_10, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12);
21287       __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
21288       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21289       if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
21290       __Pyx_GOTREF(__pyx_t_7);
21291       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21292       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 813, __pyx_L1_error)
21293       __Pyx_GOTREF(__pyx_t_12);
21294       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_log); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
21295       __Pyx_GOTREF(__pyx_t_10);
21296       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21297       __pyx_t_12 = NULL;
21298       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
21299         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
21300         if (likely(__pyx_t_12)) {
21301           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
21302           __Pyx_INCREF(__pyx_t_12);
21303           __Pyx_INCREF(function);
21304           __Pyx_DECREF_SET(__pyx_t_10, function);
21305         }
21306       }
21307       __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_12, ((PyObject *)__pyx_v_S)) : __Pyx_PyObject_CallOneArg(__pyx_t_10, ((PyObject *)__pyx_v_S));
21308       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21309       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
21310       __Pyx_GOTREF(__pyx_t_1);
21311       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21312       __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 813, __pyx_L1_error)
21313       __Pyx_GOTREF(__pyx_t_10);
21314       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21315       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21316 
21317       /* "GPy/models/state_space_cython.pyx":814
21318  *         if calc_log_likelihood:
21319  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +
21320  *                                  v*v / S)             # <<<<<<<<<<<<<<
21321  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21322  *             if np.any(np.isnan(log_likelihood_update)): # some member in P_pred is None.
21323  */
21324       __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_v), ((PyObject *)__pyx_v_v)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 814, __pyx_L1_error)
21325       __Pyx_GOTREF(__pyx_t_1);
21326       __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 814, __pyx_L1_error)
21327       __Pyx_GOTREF(__pyx_t_7);
21328       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21329 
21330       /* "GPy/models/state_space_cython.pyx":813
21331  *         K = P_pred.dot(H.T) / S
21332  *         if calc_log_likelihood:
21333  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +             # <<<<<<<<<<<<<<
21334  *                                  v*v / S)
21335  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21336  */
21337       __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 813, __pyx_L1_error)
21338       __Pyx_GOTREF(__pyx_t_1);
21339       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21340       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21341       __pyx_t_7 = PyNumber_Multiply(__pyx_float_neg_0_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 813, __pyx_L1_error)
21342       __Pyx_GOTREF(__pyx_t_7);
21343       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21344       if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 813, __pyx_L1_error)
21345       __pyx_t_28 = ((PyArrayObject *)__pyx_t_7);
21346       {
21347         __Pyx_BufFmt_StackElem __pyx_stack[1];
21348         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
21349         __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21350         if (unlikely(__pyx_t_13 < 0)) {
21351           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21352           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21353             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21354             __Pyx_RaiseBufferFallbackError();
21355           } else {
21356             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21357           }
21358           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21359         }
21360         __pyx_pybuffernd_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[1];
21361         if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 813, __pyx_L1_error)
21362       }
21363       __pyx_t_28 = 0;
21364       __pyx_v_log_likelihood_update = ((PyArrayObject *)__pyx_t_7);
21365       __pyx_t_7 = 0;
21366 
21367       /* "GPy/models/state_space_cython.pyx":816
21368  *                                  v*v / S)
21369  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21370  *             if np.any(np.isnan(log_likelihood_update)): # some member in P_pred is None.             # <<<<<<<<<<<<<<
21371  *                 raise ValueError("Nan values in likelihood update!")
21372  *         else:
21373  */
21374       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
21375       __Pyx_GOTREF(__pyx_t_1);
21376       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 816, __pyx_L1_error)
21377       __Pyx_GOTREF(__pyx_t_10);
21378       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21379       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 816, __pyx_L1_error)
21380       __Pyx_GOTREF(__pyx_t_12);
21381       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_isnan); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 816, __pyx_L1_error)
21382       __Pyx_GOTREF(__pyx_t_9);
21383       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21384       __pyx_t_12 = NULL;
21385       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
21386         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
21387         if (likely(__pyx_t_12)) {
21388           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
21389           __Pyx_INCREF(__pyx_t_12);
21390           __Pyx_INCREF(function);
21391           __Pyx_DECREF_SET(__pyx_t_9, function);
21392         }
21393       }
21394       __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_12, ((PyObject *)__pyx_v_log_likelihood_update)) : __Pyx_PyObject_CallOneArg(__pyx_t_9, ((PyObject *)__pyx_v_log_likelihood_update));
21395       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
21396       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error)
21397       __Pyx_GOTREF(__pyx_t_1);
21398       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21399       __pyx_t_9 = NULL;
21400       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
21401         __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
21402         if (likely(__pyx_t_9)) {
21403           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
21404           __Pyx_INCREF(__pyx_t_9);
21405           __Pyx_INCREF(function);
21406           __Pyx_DECREF_SET(__pyx_t_10, function);
21407         }
21408       }
21409       __pyx_t_7 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_1);
21410       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
21411       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21412       if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 816, __pyx_L1_error)
21413       __Pyx_GOTREF(__pyx_t_7);
21414       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21415       __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 816, __pyx_L1_error)
21416       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21417       if (unlikely(__pyx_t_23)) {
21418 
21419         /* "GPy/models/state_space_cython.pyx":817
21420  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21421  *             if np.any(np.isnan(log_likelihood_update)): # some member in P_pred is None.
21422  *                 raise ValueError("Nan values in likelihood update!")             # <<<<<<<<<<<<<<
21423  *         else:
21424  *             log_likelihood_update = None
21425  */
21426         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 817, __pyx_L1_error)
21427         __Pyx_GOTREF(__pyx_t_7);
21428         __Pyx_Raise(__pyx_t_7, 0, 0, 0);
21429         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21430         __PYX_ERR(0, 817, __pyx_L1_error)
21431 
21432         /* "GPy/models/state_space_cython.pyx":816
21433  *                                  v*v / S)
21434  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
21435  *             if np.any(np.isnan(log_likelihood_update)): # some member in P_pred is None.             # <<<<<<<<<<<<<<
21436  *                 raise ValueError("Nan values in likelihood update!")
21437  *         else:
21438  */
21439       }
21440 
21441       /* "GPy/models/state_space_cython.pyx":812
21442  *
21443  *         K = P_pred.dot(H.T) / S
21444  *         if calc_log_likelihood:             # <<<<<<<<<<<<<<
21445  *             log_likelihood_update = -0.5 * ( np.log(2*np.pi) + np.log(S) +
21446  *                                  v*v / S)
21447  */
21448       goto __pyx_L5;
21449     }
21450 
21451     /* "GPy/models/state_space_cython.pyx":819
21452  *                 raise ValueError("Nan values in likelihood update!")
21453  *         else:
21454  *             log_likelihood_update = None             # <<<<<<<<<<<<<<
21455  *         #LL = None; islower = None
21456  *     else:
21457  */
21458     /*else*/ {
21459       __pyx_t_28 = ((PyArrayObject *)Py_None);
21460       {
21461         __Pyx_BufFmt_StackElem __pyx_stack[1];
21462         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
21463         __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_28, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21464         if (unlikely(__pyx_t_13 < 0)) {
21465           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21466           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21467             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21468             __Pyx_RaiseBufferFallbackError();
21469           } else {
21470             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21471           }
21472           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21473         }
21474         __pyx_pybuffernd_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[1];
21475         if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 819, __pyx_L1_error)
21476       }
21477       __pyx_t_28 = 0;
21478       __Pyx_INCREF(Py_None);
21479       __pyx_v_log_likelihood_update = ((PyArrayObject *)Py_None);
21480     }
21481     __pyx_L5:;
21482 
21483     /* "GPy/models/state_space_cython.pyx":806
21484  *     cdef np.ndarray[DTYPE_t, ndim=2] K
21485  *     cdef bint measurement_dim_gt_one = False
21486  *     if measurement.shape[0]==1: # measurements are one dimensional             # <<<<<<<<<<<<<<
21487  *         if (S < 0):
21488  *             raise ValueError("Kalman Filter Update SVD: S is negative step %i" % k )
21489  */
21490     goto __pyx_L3;
21491   }
21492 
21493   /* "GPy/models/state_space_cython.pyx":822
21494  *         #LL = None; islower = None
21495  *     else:
21496  *         measurement_dim_gt_one = True             # <<<<<<<<<<<<<<
21497  *         raise ValueError("""Measurement dimension larger then 1 is currently not supported""")
21498  *
21499  */
21500   /*else*/ {
21501     __pyx_v_measurement_dim_gt_one = 1;
21502 
21503     /* "GPy/models/state_space_cython.pyx":823
21504  *     else:
21505  *         measurement_dim_gt_one = True
21506  *         raise ValueError("""Measurement dimension larger then 1 is currently not supported""")             # <<<<<<<<<<<<<<
21507  *
21508  *     # Old  method of computing updated covariance (for testing) ->
21509  */
21510     __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 823, __pyx_L1_error)
21511     __Pyx_GOTREF(__pyx_t_7);
21512     __Pyx_Raise(__pyx_t_7, 0, 0, 0);
21513     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21514     __PYX_ERR(0, 823, __pyx_L1_error)
21515   }
21516   __pyx_L3:;
21517 
21518   /* "GPy/models/state_space_cython.pyx":846
21519  *     cdef tuple ret
21520  *
21521  *     if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
21522  *         dm_pred_all_params = p_dm # derivativas of the prediction phase
21523  *         dP_pred_all_params = p_dP
21524  */
21525   __pyx_t_23 = (__pyx_v_calc_grad_log_likelihood != 0);
21526   if (__pyx_t_23) {
21527 
21528     /* "GPy/models/state_space_cython.pyx":847
21529  *
21530  *     if calc_grad_log_likelihood:
21531  *         dm_pred_all_params = p_dm # derivativas of the prediction phase             # <<<<<<<<<<<<<<
21532  *         dP_pred_all_params = p_dP
21533  *
21534  */
21535     {
21536       __Pyx_BufFmt_StackElem __pyx_stack[1];
21537       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer);
21538       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_p_dm), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21539       if (unlikely(__pyx_t_13 < 0)) {
21540         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21541         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_pred_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21542           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21543           __Pyx_RaiseBufferFallbackError();
21544         } else {
21545           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21546         }
21547         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21548       }
21549       __pyx_pybuffernd_dm_pred_all_params.diminfo[0].strides = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_pred_all_params.diminfo[0].shape = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_pred_all_params.diminfo[1].strides = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_pred_all_params.diminfo[1].shape = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_pred_all_params.diminfo[2].strides = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_pred_all_params.diminfo[2].shape = __pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer.shape[2];
21550       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 847, __pyx_L1_error)
21551     }
21552     __Pyx_INCREF(((PyObject *)__pyx_v_p_dm));
21553     __pyx_v_dm_pred_all_params = ((PyArrayObject *)__pyx_v_p_dm);
21554 
21555     /* "GPy/models/state_space_cython.pyx":848
21556  *     if calc_grad_log_likelihood:
21557  *         dm_pred_all_params = p_dm # derivativas of the prediction phase
21558  *         dP_pred_all_params = p_dP             # <<<<<<<<<<<<<<
21559  *
21560  *         param_number = p_dP.shape[2]
21561  */
21562     {
21563       __Pyx_BufFmt_StackElem __pyx_stack[1];
21564       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer);
21565       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_p_dP), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21566       if (unlikely(__pyx_t_13 < 0)) {
21567         PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21568         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_pred_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21569           Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21570           __Pyx_RaiseBufferFallbackError();
21571         } else {
21572           PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21573         }
21574         __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21575       }
21576       __pyx_pybuffernd_dP_pred_all_params.diminfo[0].strides = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_pred_all_params.diminfo[0].shape = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_pred_all_params.diminfo[1].strides = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_pred_all_params.diminfo[1].shape = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_pred_all_params.diminfo[2].strides = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_pred_all_params.diminfo[2].shape = __pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer.shape[2];
21577       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 848, __pyx_L1_error)
21578     }
21579     __Pyx_INCREF(((PyObject *)__pyx_v_p_dP));
21580     __pyx_v_dP_pred_all_params = ((PyArrayObject *)__pyx_v_p_dP);
21581 
21582     /* "GPy/models/state_space_cython.pyx":850
21583  *         dP_pred_all_params = p_dP
21584  *
21585  *         param_number = p_dP.shape[2]             # <<<<<<<<<<<<<<
21586  *
21587  *         dH_all_params = p_measurement_callables.dHk(k)
21588  */
21589     __pyx_v_param_number = (__pyx_v_p_dP->dimensions[2]);
21590 
21591     /* "GPy/models/state_space_cython.pyx":852
21592  *         param_number = p_dP.shape[2]
21593  *
21594  *         dH_all_params = p_measurement_callables.dHk(k)             # <<<<<<<<<<<<<<
21595  *         dR_all_params = p_measurement_callables.dRk(k)
21596  *
21597  */
21598     __pyx_t_7 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->dHk(__pyx_v_p_measurement_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 852, __pyx_L1_error)
21599     __Pyx_GOTREF(__pyx_t_7);
21600     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 852, __pyx_L1_error)
21601     __pyx_t_29 = ((PyArrayObject *)__pyx_t_7);
21602     {
21603       __Pyx_BufFmt_StackElem __pyx_stack[1];
21604       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer);
21605       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21606       if (unlikely(__pyx_t_13 < 0)) {
21607         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21608         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dH_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21609           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21610           __Pyx_RaiseBufferFallbackError();
21611         } else {
21612           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21613         }
21614         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21615       }
21616       __pyx_pybuffernd_dH_all_params.diminfo[0].strides = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dH_all_params.diminfo[0].shape = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dH_all_params.diminfo[1].strides = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dH_all_params.diminfo[1].shape = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dH_all_params.diminfo[2].strides = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dH_all_params.diminfo[2].shape = __pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer.shape[2];
21617       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 852, __pyx_L1_error)
21618     }
21619     __pyx_t_29 = 0;
21620     __pyx_v_dH_all_params = ((PyArrayObject *)__pyx_t_7);
21621     __pyx_t_7 = 0;
21622 
21623     /* "GPy/models/state_space_cython.pyx":853
21624  *
21625  *         dH_all_params = p_measurement_callables.dHk(k)
21626  *         dR_all_params = p_measurement_callables.dRk(k)             # <<<<<<<<<<<<<<
21627  *
21628  *         dm_upd = np.empty((dm_pred_all_params.shape[0], dm_pred_all_params.shape[1], dm_pred_all_params.shape[2]), dtype = DTYPE)
21629  */
21630     __pyx_t_7 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v_p_measurement_callables->__pyx_vtab)->dRk(__pyx_v_p_measurement_callables, __pyx_v_k, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 853, __pyx_L1_error)
21631     __Pyx_GOTREF(__pyx_t_7);
21632     if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 853, __pyx_L1_error)
21633     __pyx_t_30 = ((PyArrayObject *)__pyx_t_7);
21634     {
21635       __Pyx_BufFmt_StackElem __pyx_stack[1];
21636       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer);
21637       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21638       if (unlikely(__pyx_t_13 < 0)) {
21639         PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21640         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer, (PyObject*)__pyx_v_dR_all_params, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21641           Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21642           __Pyx_RaiseBufferFallbackError();
21643         } else {
21644           PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21645         }
21646         __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21647       }
21648       __pyx_pybuffernd_dR_all_params.diminfo[0].strides = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dR_all_params.diminfo[0].shape = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dR_all_params.diminfo[1].strides = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dR_all_params.diminfo[1].shape = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dR_all_params.diminfo[2].strides = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dR_all_params.diminfo[2].shape = __pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer.shape[2];
21649       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 853, __pyx_L1_error)
21650     }
21651     __pyx_t_30 = 0;
21652     __pyx_v_dR_all_params = ((PyArrayObject *)__pyx_t_7);
21653     __pyx_t_7 = 0;
21654 
21655     /* "GPy/models/state_space_cython.pyx":855
21656  *         dR_all_params = p_measurement_callables.dRk(k)
21657  *
21658  *         dm_upd = np.empty((dm_pred_all_params.shape[0], dm_pred_all_params.shape[1], dm_pred_all_params.shape[2]), dtype = DTYPE)             # <<<<<<<<<<<<<<
21659  *         dP_upd = np.empty((dP_pred_all_params.shape[0], dP_pred_all_params.shape[1], dP_pred_all_params.shape[2]), dtype = DTYPE)
21660  *
21661  */
21662     __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error)
21663     __Pyx_GOTREF(__pyx_t_7);
21664     __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_empty); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 855, __pyx_L1_error)
21665     __Pyx_GOTREF(__pyx_t_10);
21666     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21667     __pyx_t_7 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dm_pred_all_params->dimensions[0])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 855, __pyx_L1_error)
21668     __Pyx_GOTREF(__pyx_t_7);
21669     __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dm_pred_all_params->dimensions[1])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
21670     __Pyx_GOTREF(__pyx_t_1);
21671     __pyx_t_9 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dm_pred_all_params->dimensions[2])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 855, __pyx_L1_error)
21672     __Pyx_GOTREF(__pyx_t_9);
21673     __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 855, __pyx_L1_error)
21674     __Pyx_GOTREF(__pyx_t_12);
21675     __Pyx_GIVEREF(__pyx_t_7);
21676     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7);
21677     __Pyx_GIVEREF(__pyx_t_1);
21678     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1);
21679     __Pyx_GIVEREF(__pyx_t_9);
21680     PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
21681     __pyx_t_7 = 0;
21682     __pyx_t_1 = 0;
21683     __pyx_t_9 = 0;
21684     __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 855, __pyx_L1_error)
21685     __Pyx_GOTREF(__pyx_t_9);
21686     __Pyx_GIVEREF(__pyx_t_12);
21687     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
21688     __pyx_t_12 = 0;
21689     __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 855, __pyx_L1_error)
21690     __Pyx_GOTREF(__pyx_t_12);
21691     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
21692     __Pyx_GOTREF(__pyx_t_1);
21693     if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 855, __pyx_L1_error)
21694     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21695     __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error)
21696     __Pyx_GOTREF(__pyx_t_1);
21697     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21698     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21699     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21700     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 855, __pyx_L1_error)
21701     __pyx_t_31 = ((PyArrayObject *)__pyx_t_1);
21702     {
21703       __Pyx_BufFmt_StackElem __pyx_stack[1];
21704       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
21705       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21706       if (unlikely(__pyx_t_13 < 0)) {
21707         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21708         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21709           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21710           __Pyx_RaiseBufferFallbackError();
21711         } else {
21712           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21713         }
21714         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21715       }
21716       __pyx_pybuffernd_dm_upd.diminfo[0].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_upd.diminfo[0].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_upd.diminfo[1].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_upd.diminfo[1].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_upd.diminfo[2].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_upd.diminfo[2].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[2];
21717       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 855, __pyx_L1_error)
21718     }
21719     __pyx_t_31 = 0;
21720     __pyx_v_dm_upd = ((PyArrayObject *)__pyx_t_1);
21721     __pyx_t_1 = 0;
21722 
21723     /* "GPy/models/state_space_cython.pyx":856
21724  *
21725  *         dm_upd = np.empty((dm_pred_all_params.shape[0], dm_pred_all_params.shape[1], dm_pred_all_params.shape[2]), dtype = DTYPE)
21726  *         dP_upd = np.empty((dP_pred_all_params.shape[0], dP_pred_all_params.shape[1], dP_pred_all_params.shape[2]), dtype = DTYPE)             # <<<<<<<<<<<<<<
21727  *
21728  *          # firts dimension parameter_no, second - time series number
21729  */
21730     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
21731     __Pyx_GOTREF(__pyx_t_1);
21732     __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 856, __pyx_L1_error)
21733     __Pyx_GOTREF(__pyx_t_12);
21734     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21735     __pyx_t_1 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dP_pred_all_params->dimensions[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
21736     __Pyx_GOTREF(__pyx_t_1);
21737     __pyx_t_9 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dP_pred_all_params->dimensions[1])); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error)
21738     __Pyx_GOTREF(__pyx_t_9);
21739     __pyx_t_10 = __Pyx_PyInt_From_Py_intptr_t((__pyx_v_dP_pred_all_params->dimensions[2])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 856, __pyx_L1_error)
21740     __Pyx_GOTREF(__pyx_t_10);
21741     __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
21742     __Pyx_GOTREF(__pyx_t_7);
21743     __Pyx_GIVEREF(__pyx_t_1);
21744     PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
21745     __Pyx_GIVEREF(__pyx_t_9);
21746     PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
21747     __Pyx_GIVEREF(__pyx_t_10);
21748     PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_10);
21749     __pyx_t_1 = 0;
21750     __pyx_t_9 = 0;
21751     __pyx_t_10 = 0;
21752     __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 856, __pyx_L1_error)
21753     __Pyx_GOTREF(__pyx_t_10);
21754     __Pyx_GIVEREF(__pyx_t_7);
21755     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
21756     __pyx_t_7 = 0;
21757     __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 856, __pyx_L1_error)
21758     __Pyx_GOTREF(__pyx_t_7);
21759     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error)
21760     __Pyx_GOTREF(__pyx_t_9);
21761     if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 856, __pyx_L1_error)
21762     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21763     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 856, __pyx_L1_error)
21764     __Pyx_GOTREF(__pyx_t_9);
21765     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21766     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21767     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21768     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 856, __pyx_L1_error)
21769     __pyx_t_32 = ((PyArrayObject *)__pyx_t_9);
21770     {
21771       __Pyx_BufFmt_StackElem __pyx_stack[1];
21772       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
21773       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
21774       if (unlikely(__pyx_t_13 < 0)) {
21775         PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21776         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
21777           Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21778           __Pyx_RaiseBufferFallbackError();
21779         } else {
21780           PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21781         }
21782         __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21783       }
21784       __pyx_pybuffernd_dP_upd.diminfo[0].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_upd.diminfo[0].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_upd.diminfo[1].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_upd.diminfo[1].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_upd.diminfo[2].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_upd.diminfo[2].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[2];
21785       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 856, __pyx_L1_error)
21786     }
21787     __pyx_t_32 = 0;
21788     __pyx_v_dP_upd = ((PyArrayObject *)__pyx_t_9);
21789     __pyx_t_9 = 0;
21790 
21791     /* "GPy/models/state_space_cython.pyx":859
21792  *
21793  *          # firts dimension parameter_no, second - time series number
21794  *         d_log_likelihood_update = np.empty((param_number,time_series_no), dtype = DTYPE)             # <<<<<<<<<<<<<<
21795  *         for param in range(param_number):
21796  *
21797  */
21798     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 859, __pyx_L1_error)
21799     __Pyx_GOTREF(__pyx_t_9);
21800     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_empty); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 859, __pyx_L1_error)
21801     __Pyx_GOTREF(__pyx_t_7);
21802     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21803     __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_param_number); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 859, __pyx_L1_error)
21804     __Pyx_GOTREF(__pyx_t_9);
21805     __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 859, __pyx_L1_error)
21806     __Pyx_GOTREF(__pyx_t_10);
21807     __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 859, __pyx_L1_error)
21808     __Pyx_GOTREF(__pyx_t_12);
21809     __Pyx_GIVEREF(__pyx_t_9);
21810     PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9);
21811     __Pyx_GIVEREF(__pyx_t_10);
21812     PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_10);
21813     __pyx_t_9 = 0;
21814     __pyx_t_10 = 0;
21815     __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 859, __pyx_L1_error)
21816     __Pyx_GOTREF(__pyx_t_10);
21817     __Pyx_GIVEREF(__pyx_t_12);
21818     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
21819     __pyx_t_12 = 0;
21820     __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 859, __pyx_L1_error)
21821     __Pyx_GOTREF(__pyx_t_12);
21822     __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 859, __pyx_L1_error)
21823     __Pyx_GOTREF(__pyx_t_9);
21824     if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 859, __pyx_L1_error)
21825     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
21826     __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 859, __pyx_L1_error)
21827     __Pyx_GOTREF(__pyx_t_9);
21828     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
21829     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
21830     __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21831     if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 859, __pyx_L1_error)
21832     __pyx_t_33 = ((PyArrayObject *)__pyx_t_9);
21833     {
21834       __Pyx_BufFmt_StackElem __pyx_stack[1];
21835       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
21836       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21837       if (unlikely(__pyx_t_13 < 0)) {
21838         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21839         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21840           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21841           __Pyx_RaiseBufferFallbackError();
21842         } else {
21843           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21844         }
21845         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21846       }
21847       __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[1];
21848       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 859, __pyx_L1_error)
21849     }
21850     __pyx_t_33 = 0;
21851     __pyx_v_d_log_likelihood_update = ((PyArrayObject *)__pyx_t_9);
21852     __pyx_t_9 = 0;
21853 
21854     /* "GPy/models/state_space_cython.pyx":860
21855  *          # firts dimension parameter_no, second - time series number
21856  *         d_log_likelihood_update = np.empty((param_number,time_series_no), dtype = DTYPE)
21857  *         for param in range(param_number):             # <<<<<<<<<<<<<<
21858  *
21859  *            dH = dH_all_params[:,:,param]
21860  */
21861     __pyx_t_13 = __pyx_v_param_number;
21862     __pyx_t_34 = __pyx_t_13;
21863     for (__pyx_t_35 = 0; __pyx_t_35 < __pyx_t_34; __pyx_t_35+=1) {
21864       __pyx_v_param = __pyx_t_35;
21865 
21866       /* "GPy/models/state_space_cython.pyx":862
21867  *         for param in range(param_number):
21868  *
21869  *            dH = dH_all_params[:,:,param]             # <<<<<<<<<<<<<<
21870  *            dR = dR_all_params[:,:,param]
21871  *
21872  */
21873       __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L1_error)
21874       __Pyx_GOTREF(__pyx_t_9);
21875       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 862, __pyx_L1_error)
21876       __Pyx_GOTREF(__pyx_t_12);
21877       __Pyx_INCREF(__pyx_slice__10);
21878       __Pyx_GIVEREF(__pyx_slice__10);
21879       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
21880       __Pyx_INCREF(__pyx_slice__10);
21881       __Pyx_GIVEREF(__pyx_slice__10);
21882       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
21883       __Pyx_GIVEREF(__pyx_t_9);
21884       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
21885       __pyx_t_9 = 0;
21886       __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dH_all_params), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 862, __pyx_L1_error)
21887       __Pyx_GOTREF(__pyx_t_9);
21888       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21889       if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 862, __pyx_L1_error)
21890       __pyx_t_36 = ((PyArrayObject *)__pyx_t_9);
21891       {
21892         __Pyx_BufFmt_StackElem __pyx_stack[1];
21893         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH.rcbuffer->pybuffer);
21894         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dH.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21895         if (unlikely(__pyx_t_37 < 0)) {
21896           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21897           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dH.rcbuffer->pybuffer, (PyObject*)__pyx_v_dH, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21898             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21899             __Pyx_RaiseBufferFallbackError();
21900           } else {
21901             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21902           }
21903           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21904         }
21905         __pyx_pybuffernd_dH.diminfo[0].strides = __pyx_pybuffernd_dH.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dH.diminfo[0].shape = __pyx_pybuffernd_dH.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dH.diminfo[1].strides = __pyx_pybuffernd_dH.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dH.diminfo[1].shape = __pyx_pybuffernd_dH.rcbuffer->pybuffer.shape[1];
21906         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 862, __pyx_L1_error)
21907       }
21908       __pyx_t_36 = 0;
21909       __Pyx_XDECREF_SET(__pyx_v_dH, ((PyArrayObject *)__pyx_t_9));
21910       __pyx_t_9 = 0;
21911 
21912       /* "GPy/models/state_space_cython.pyx":863
21913  *
21914  *            dH = dH_all_params[:,:,param]
21915  *            dR = dR_all_params[:,:,param]             # <<<<<<<<<<<<<<
21916  *
21917  *            dm_pred = dm_pred_all_params[:,:,param]
21918  */
21919       __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error)
21920       __Pyx_GOTREF(__pyx_t_9);
21921       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 863, __pyx_L1_error)
21922       __Pyx_GOTREF(__pyx_t_12);
21923       __Pyx_INCREF(__pyx_slice__10);
21924       __Pyx_GIVEREF(__pyx_slice__10);
21925       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
21926       __Pyx_INCREF(__pyx_slice__10);
21927       __Pyx_GIVEREF(__pyx_slice__10);
21928       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
21929       __Pyx_GIVEREF(__pyx_t_9);
21930       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
21931       __pyx_t_9 = 0;
21932       __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dR_all_params), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 863, __pyx_L1_error)
21933       __Pyx_GOTREF(__pyx_t_9);
21934       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21935       if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 863, __pyx_L1_error)
21936       __pyx_t_36 = ((PyArrayObject *)__pyx_t_9);
21937       {
21938         __Pyx_BufFmt_StackElem __pyx_stack[1];
21939         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
21940         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21941         if (unlikely(__pyx_t_37 < 0)) {
21942           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
21943           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dR.rcbuffer->pybuffer, (PyObject*)__pyx_v_dR, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21944             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
21945             __Pyx_RaiseBufferFallbackError();
21946           } else {
21947             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
21948           }
21949           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
21950         }
21951         __pyx_pybuffernd_dR.diminfo[0].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dR.diminfo[0].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dR.diminfo[1].strides = __pyx_pybuffernd_dR.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dR.diminfo[1].shape = __pyx_pybuffernd_dR.rcbuffer->pybuffer.shape[1];
21952         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 863, __pyx_L1_error)
21953       }
21954       __pyx_t_36 = 0;
21955       __Pyx_XDECREF_SET(__pyx_v_dR, ((PyArrayObject *)__pyx_t_9));
21956       __pyx_t_9 = 0;
21957 
21958       /* "GPy/models/state_space_cython.pyx":865
21959  *            dR = dR_all_params[:,:,param]
21960  *
21961  *            dm_pred = dm_pred_all_params[:,:,param]             # <<<<<<<<<<<<<<
21962  *            dP_pred = dP_pred_all_params[:,:,param]
21963  *
21964  */
21965       __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
21966       __Pyx_GOTREF(__pyx_t_9);
21967       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 865, __pyx_L1_error)
21968       __Pyx_GOTREF(__pyx_t_12);
21969       __Pyx_INCREF(__pyx_slice__10);
21970       __Pyx_GIVEREF(__pyx_slice__10);
21971       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
21972       __Pyx_INCREF(__pyx_slice__10);
21973       __Pyx_GIVEREF(__pyx_slice__10);
21974       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
21975       __Pyx_GIVEREF(__pyx_t_9);
21976       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
21977       __pyx_t_9 = 0;
21978       __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dm_pred_all_params), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
21979       __Pyx_GOTREF(__pyx_t_9);
21980       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
21981       if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 865, __pyx_L1_error)
21982       __pyx_t_36 = ((PyArrayObject *)__pyx_t_9);
21983       {
21984         __Pyx_BufFmt_StackElem __pyx_stack[1];
21985         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
21986         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
21987         if (unlikely(__pyx_t_37 < 0)) {
21988           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
21989           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
21990             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
21991             __Pyx_RaiseBufferFallbackError();
21992           } else {
21993             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
21994           }
21995           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
21996         }
21997         __pyx_pybuffernd_dm_pred.diminfo[0].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_pred.diminfo[0].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_pred.diminfo[1].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_pred.diminfo[1].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[1];
21998         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 865, __pyx_L1_error)
21999       }
22000       __pyx_t_36 = 0;
22001       __Pyx_XDECREF_SET(__pyx_v_dm_pred, ((PyArrayObject *)__pyx_t_9));
22002       __pyx_t_9 = 0;
22003 
22004       /* "GPy/models/state_space_cython.pyx":866
22005  *
22006  *            dm_pred = dm_pred_all_params[:,:,param]
22007  *            dP_pred = dP_pred_all_params[:,:,param]             # <<<<<<<<<<<<<<
22008  *
22009  *             # Terms in the likelihood derivatives
22010  */
22011       __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
22012       __Pyx_GOTREF(__pyx_t_9);
22013       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 866, __pyx_L1_error)
22014       __Pyx_GOTREF(__pyx_t_12);
22015       __Pyx_INCREF(__pyx_slice__10);
22016       __Pyx_GIVEREF(__pyx_slice__10);
22017       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
22018       __Pyx_INCREF(__pyx_slice__10);
22019       __Pyx_GIVEREF(__pyx_slice__10);
22020       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
22021       __Pyx_GIVEREF(__pyx_t_9);
22022       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_9);
22023       __pyx_t_9 = 0;
22024       __pyx_t_9 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_pred_all_params), __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 866, __pyx_L1_error)
22025       __Pyx_GOTREF(__pyx_t_9);
22026       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22027       if (!(likely(((__pyx_t_9) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_9, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 866, __pyx_L1_error)
22028       __pyx_t_36 = ((PyArrayObject *)__pyx_t_9);
22029       {
22030         __Pyx_BufFmt_StackElem __pyx_stack[1];
22031         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
22032         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22033         if (unlikely(__pyx_t_37 < 0)) {
22034           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
22035           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22036             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
22037             __Pyx_RaiseBufferFallbackError();
22038           } else {
22039             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
22040           }
22041           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
22042         }
22043         __pyx_pybuffernd_dP_pred.diminfo[0].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_pred.diminfo[0].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_pred.diminfo[1].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_pred.diminfo[1].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[1];
22044         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 866, __pyx_L1_error)
22045       }
22046       __pyx_t_36 = 0;
22047       __Pyx_XDECREF_SET(__pyx_v_dP_pred, ((PyArrayObject *)__pyx_t_9));
22048       __pyx_t_9 = 0;
22049 
22050       /* "GPy/models/state_space_cython.pyx":869
22051  *
22052  *             # Terms in the likelihood derivatives
22053  *            dv = - np.dot( dH, m_pred) -  np.dot( H, dm_pred)             # <<<<<<<<<<<<<<
22054  *            dS = np.dot(dH, np.dot( P_pred, H.T))
22055  *            dS += dS.T
22056  */
22057       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 869, __pyx_L1_error)
22058       __Pyx_GOTREF(__pyx_t_12);
22059       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 869, __pyx_L1_error)
22060       __Pyx_GOTREF(__pyx_t_10);
22061       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22062       __pyx_t_12 = NULL;
22063       __pyx_t_37 = 0;
22064       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
22065         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
22066         if (likely(__pyx_t_12)) {
22067           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22068           __Pyx_INCREF(__pyx_t_12);
22069           __Pyx_INCREF(function);
22070           __Pyx_DECREF_SET(__pyx_t_10, function);
22071           __pyx_t_37 = 1;
22072         }
22073       }
22074       #if CYTHON_FAST_PYCALL
22075       if (PyFunction_Check(__pyx_t_10)) {
22076         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_dH), ((PyObject *)__pyx_v_m_pred)};
22077         __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22078         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22079         __Pyx_GOTREF(__pyx_t_9);
22080       } else
22081       #endif
22082       #if CYTHON_FAST_PYCCALL
22083       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
22084         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_dH), ((PyObject *)__pyx_v_m_pred)};
22085         __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22086         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22087         __Pyx_GOTREF(__pyx_t_9);
22088       } else
22089       #endif
22090       {
22091         __pyx_t_7 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
22092         __Pyx_GOTREF(__pyx_t_7);
22093         if (__pyx_t_12) {
22094           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
22095         }
22096         __Pyx_INCREF(((PyObject *)__pyx_v_dH));
22097         __Pyx_GIVEREF(((PyObject *)__pyx_v_dH));
22098         PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_37, ((PyObject *)__pyx_v_dH));
22099         __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
22100         __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
22101         PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_37, ((PyObject *)__pyx_v_m_pred));
22102         __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22103         __Pyx_GOTREF(__pyx_t_9);
22104         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22105       }
22106       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22107       __pyx_t_10 = PyNumber_Negative(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 869, __pyx_L1_error)
22108       __Pyx_GOTREF(__pyx_t_10);
22109       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22110       __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
22111       __Pyx_GOTREF(__pyx_t_7);
22112       __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 869, __pyx_L1_error)
22113       __Pyx_GOTREF(__pyx_t_12);
22114       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22115       __pyx_t_7 = NULL;
22116       __pyx_t_37 = 0;
22117       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
22118         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12);
22119         if (likely(__pyx_t_7)) {
22120           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
22121           __Pyx_INCREF(__pyx_t_7);
22122           __Pyx_INCREF(function);
22123           __Pyx_DECREF_SET(__pyx_t_12, function);
22124           __pyx_t_37 = 1;
22125         }
22126       }
22127       #if CYTHON_FAST_PYCALL
22128       if (PyFunction_Check(__pyx_t_12)) {
22129         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_dm_pred)};
22130         __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22131         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22132         __Pyx_GOTREF(__pyx_t_9);
22133       } else
22134       #endif
22135       #if CYTHON_FAST_PYCCALL
22136       if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
22137         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_H), ((PyObject *)__pyx_v_dm_pred)};
22138         __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22139         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22140         __Pyx_GOTREF(__pyx_t_9);
22141       } else
22142       #endif
22143       {
22144         __pyx_t_1 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
22145         __Pyx_GOTREF(__pyx_t_1);
22146         if (__pyx_t_7) {
22147           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7); __pyx_t_7 = NULL;
22148         }
22149         __Pyx_INCREF(((PyObject *)__pyx_v_H));
22150         __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
22151         PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_37, ((PyObject *)__pyx_v_H));
22152         __Pyx_INCREF(((PyObject *)__pyx_v_dm_pred));
22153         __Pyx_GIVEREF(((PyObject *)__pyx_v_dm_pred));
22154         PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_37, ((PyObject *)__pyx_v_dm_pred));
22155         __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
22156         __Pyx_GOTREF(__pyx_t_9);
22157         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22158       }
22159       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22160       __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 869, __pyx_L1_error)
22161       __Pyx_GOTREF(__pyx_t_12);
22162       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22163       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22164       if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 869, __pyx_L1_error)
22165       __pyx_t_36 = ((PyArrayObject *)__pyx_t_12);
22166       {
22167         __Pyx_BufFmt_StackElem __pyx_stack[1];
22168         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
22169         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dv.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22170         if (unlikely(__pyx_t_37 < 0)) {
22171           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
22172           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dv.rcbuffer->pybuffer, (PyObject*)__pyx_v_dv, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22173             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
22174             __Pyx_RaiseBufferFallbackError();
22175           } else {
22176             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
22177           }
22178           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
22179         }
22180         __pyx_pybuffernd_dv.diminfo[0].strides = __pyx_pybuffernd_dv.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dv.diminfo[0].shape = __pyx_pybuffernd_dv.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dv.diminfo[1].strides = __pyx_pybuffernd_dv.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dv.diminfo[1].shape = __pyx_pybuffernd_dv.rcbuffer->pybuffer.shape[1];
22181         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 869, __pyx_L1_error)
22182       }
22183       __pyx_t_36 = 0;
22184       __Pyx_XDECREF_SET(__pyx_v_dv, ((PyArrayObject *)__pyx_t_12));
22185       __pyx_t_12 = 0;
22186 
22187       /* "GPy/models/state_space_cython.pyx":870
22188  *             # Terms in the likelihood derivatives
22189  *            dv = - np.dot( dH, m_pred) -  np.dot( H, dm_pred)
22190  *            dS = np.dot(dH, np.dot( P_pred, H.T))             # <<<<<<<<<<<<<<
22191  *            dS += dS.T
22192  *            dS += np.dot(H, np.dot( dP_pred, H.T)) + dR
22193  */
22194       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error)
22195       __Pyx_GOTREF(__pyx_t_9);
22196       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 870, __pyx_L1_error)
22197       __Pyx_GOTREF(__pyx_t_10);
22198       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22199       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
22200       __Pyx_GOTREF(__pyx_t_1);
22201       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 870, __pyx_L1_error)
22202       __Pyx_GOTREF(__pyx_t_7);
22203       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22204       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 870, __pyx_L1_error)
22205       __Pyx_GOTREF(__pyx_t_1);
22206       __pyx_t_5 = NULL;
22207       __pyx_t_37 = 0;
22208       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
22209         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
22210         if (likely(__pyx_t_5)) {
22211           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22212           __Pyx_INCREF(__pyx_t_5);
22213           __Pyx_INCREF(function);
22214           __Pyx_DECREF_SET(__pyx_t_7, function);
22215           __pyx_t_37 = 1;
22216         }
22217       }
22218       #if CYTHON_FAST_PYCALL
22219       if (PyFunction_Check(__pyx_t_7)) {
22220         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_P_pred), __pyx_t_1};
22221         __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error)
22222         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22223         __Pyx_GOTREF(__pyx_t_9);
22224         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22225       } else
22226       #endif
22227       #if CYTHON_FAST_PYCCALL
22228       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
22229         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_P_pred), __pyx_t_1};
22230         __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error)
22231         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22232         __Pyx_GOTREF(__pyx_t_9);
22233         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22234       } else
22235       #endif
22236       {
22237         __pyx_t_14 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 870, __pyx_L1_error)
22238         __Pyx_GOTREF(__pyx_t_14);
22239         if (__pyx_t_5) {
22240           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL;
22241         }
22242         __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
22243         __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
22244         PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_37, ((PyObject *)__pyx_v_P_pred));
22245         __Pyx_GIVEREF(__pyx_t_1);
22246         PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_37, __pyx_t_1);
22247         __pyx_t_1 = 0;
22248         __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 870, __pyx_L1_error)
22249         __Pyx_GOTREF(__pyx_t_9);
22250         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22251       }
22252       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22253       __pyx_t_7 = NULL;
22254       __pyx_t_37 = 0;
22255       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
22256         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
22257         if (likely(__pyx_t_7)) {
22258           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22259           __Pyx_INCREF(__pyx_t_7);
22260           __Pyx_INCREF(function);
22261           __Pyx_DECREF_SET(__pyx_t_10, function);
22262           __pyx_t_37 = 1;
22263         }
22264       }
22265       #if CYTHON_FAST_PYCALL
22266       if (PyFunction_Check(__pyx_t_10)) {
22267         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_dH), __pyx_t_9};
22268         __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 870, __pyx_L1_error)
22269         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22270         __Pyx_GOTREF(__pyx_t_12);
22271         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22272       } else
22273       #endif
22274       #if CYTHON_FAST_PYCCALL
22275       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
22276         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_dH), __pyx_t_9};
22277         __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 870, __pyx_L1_error)
22278         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22279         __Pyx_GOTREF(__pyx_t_12);
22280         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22281       } else
22282       #endif
22283       {
22284         __pyx_t_14 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 870, __pyx_L1_error)
22285         __Pyx_GOTREF(__pyx_t_14);
22286         if (__pyx_t_7) {
22287           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_7); __pyx_t_7 = NULL;
22288         }
22289         __Pyx_INCREF(((PyObject *)__pyx_v_dH));
22290         __Pyx_GIVEREF(((PyObject *)__pyx_v_dH));
22291         PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_37, ((PyObject *)__pyx_v_dH));
22292         __Pyx_GIVEREF(__pyx_t_9);
22293         PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_37, __pyx_t_9);
22294         __pyx_t_9 = 0;
22295         __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 870, __pyx_L1_error)
22296         __Pyx_GOTREF(__pyx_t_12);
22297         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22298       }
22299       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22300       if (!(likely(((__pyx_t_12) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_12, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 870, __pyx_L1_error)
22301       __pyx_t_36 = ((PyArrayObject *)__pyx_t_12);
22302       {
22303         __Pyx_BufFmt_StackElem __pyx_stack[1];
22304         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
22305         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22306         if (unlikely(__pyx_t_37 < 0)) {
22307           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
22308           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22309             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
22310             __Pyx_RaiseBufferFallbackError();
22311           } else {
22312             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
22313           }
22314           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
22315         }
22316         __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1];
22317         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 870, __pyx_L1_error)
22318       }
22319       __pyx_t_36 = 0;
22320       __Pyx_XDECREF_SET(__pyx_v_dS, ((PyArrayObject *)__pyx_t_12));
22321       __pyx_t_12 = 0;
22322 
22323       /* "GPy/models/state_space_cython.pyx":871
22324  *            dv = - np.dot( dH, m_pred) -  np.dot( H, dm_pred)
22325  *            dS = np.dot(dH, np.dot( P_pred, H.T))
22326  *            dS += dS.T             # <<<<<<<<<<<<<<
22327  *            dS += np.dot(H, np.dot( dP_pred, H.T)) + dR
22328  *
22329  */
22330       __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dS), __pyx_n_s_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 871, __pyx_L1_error)
22331       __Pyx_GOTREF(__pyx_t_12);
22332       __pyx_t_10 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_dS), __pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 871, __pyx_L1_error)
22333       __Pyx_GOTREF(__pyx_t_10);
22334       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22335       if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 871, __pyx_L1_error)
22336       __pyx_t_36 = ((PyArrayObject *)__pyx_t_10);
22337       {
22338         __Pyx_BufFmt_StackElem __pyx_stack[1];
22339         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
22340         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22341         if (unlikely(__pyx_t_37 < 0)) {
22342           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
22343           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22344             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
22345             __Pyx_RaiseBufferFallbackError();
22346           } else {
22347             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
22348           }
22349           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
22350         }
22351         __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1];
22352         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 871, __pyx_L1_error)
22353       }
22354       __pyx_t_36 = 0;
22355       __Pyx_DECREF_SET(__pyx_v_dS, ((PyArrayObject *)__pyx_t_10));
22356       __pyx_t_10 = 0;
22357 
22358       /* "GPy/models/state_space_cython.pyx":872
22359  *            dS = np.dot(dH, np.dot( P_pred, H.T))
22360  *            dS += dS.T
22361  *            dS += np.dot(H, np.dot( dP_pred, H.T)) + dR             # <<<<<<<<<<<<<<
22362  *
22363  *             # TODO: maybe symmetrize dS
22364  */
22365       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 872, __pyx_L1_error)
22366       __Pyx_GOTREF(__pyx_t_12);
22367       __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_dot); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 872, __pyx_L1_error)
22368       __Pyx_GOTREF(__pyx_t_14);
22369       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22370       __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 872, __pyx_L1_error)
22371       __Pyx_GOTREF(__pyx_t_9);
22372       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 872, __pyx_L1_error)
22373       __Pyx_GOTREF(__pyx_t_7);
22374       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22375       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_T); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 872, __pyx_L1_error)
22376       __Pyx_GOTREF(__pyx_t_9);
22377       __pyx_t_1 = NULL;
22378       __pyx_t_37 = 0;
22379       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
22380         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
22381         if (likely(__pyx_t_1)) {
22382           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22383           __Pyx_INCREF(__pyx_t_1);
22384           __Pyx_INCREF(function);
22385           __Pyx_DECREF_SET(__pyx_t_7, function);
22386           __pyx_t_37 = 1;
22387         }
22388       }
22389       #if CYTHON_FAST_PYCALL
22390       if (PyFunction_Check(__pyx_t_7)) {
22391         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dP_pred), __pyx_t_9};
22392         __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 872, __pyx_L1_error)
22393         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22394         __Pyx_GOTREF(__pyx_t_12);
22395         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22396       } else
22397       #endif
22398       #if CYTHON_FAST_PYCCALL
22399       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
22400         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dP_pred), __pyx_t_9};
22401         __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 872, __pyx_L1_error)
22402         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22403         __Pyx_GOTREF(__pyx_t_12);
22404         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22405       } else
22406       #endif
22407       {
22408         __pyx_t_5 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L1_error)
22409         __Pyx_GOTREF(__pyx_t_5);
22410         if (__pyx_t_1) {
22411           __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
22412         }
22413         __Pyx_INCREF(((PyObject *)__pyx_v_dP_pred));
22414         __Pyx_GIVEREF(((PyObject *)__pyx_v_dP_pred));
22415         PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_37, ((PyObject *)__pyx_v_dP_pred));
22416         __Pyx_GIVEREF(__pyx_t_9);
22417         PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_37, __pyx_t_9);
22418         __pyx_t_9 = 0;
22419         __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 872, __pyx_L1_error)
22420         __Pyx_GOTREF(__pyx_t_12);
22421         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22422       }
22423       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22424       __pyx_t_7 = NULL;
22425       __pyx_t_37 = 0;
22426       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_14))) {
22427         __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_14);
22428         if (likely(__pyx_t_7)) {
22429           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
22430           __Pyx_INCREF(__pyx_t_7);
22431           __Pyx_INCREF(function);
22432           __Pyx_DECREF_SET(__pyx_t_14, function);
22433           __pyx_t_37 = 1;
22434         }
22435       }
22436       #if CYTHON_FAST_PYCALL
22437       if (PyFunction_Check(__pyx_t_14)) {
22438         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_H), __pyx_t_12};
22439         __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error)
22440         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22441         __Pyx_GOTREF(__pyx_t_10);
22442         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22443       } else
22444       #endif
22445       #if CYTHON_FAST_PYCCALL
22446       if (__Pyx_PyFastCFunction_Check(__pyx_t_14)) {
22447         PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_H), __pyx_t_12};
22448         __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_14, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error)
22449         __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
22450         __Pyx_GOTREF(__pyx_t_10);
22451         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22452       } else
22453       #endif
22454       {
22455         __pyx_t_5 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 872, __pyx_L1_error)
22456         __Pyx_GOTREF(__pyx_t_5);
22457         if (__pyx_t_7) {
22458           __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
22459         }
22460         __Pyx_INCREF(((PyObject *)__pyx_v_H));
22461         __Pyx_GIVEREF(((PyObject *)__pyx_v_H));
22462         PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_37, ((PyObject *)__pyx_v_H));
22463         __Pyx_GIVEREF(__pyx_t_12);
22464         PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_37, __pyx_t_12);
22465         __pyx_t_12 = 0;
22466         __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_5, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error)
22467         __Pyx_GOTREF(__pyx_t_10);
22468         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22469       }
22470       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22471       __pyx_t_14 = PyNumber_Add(__pyx_t_10, ((PyObject *)__pyx_v_dR)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 872, __pyx_L1_error)
22472       __Pyx_GOTREF(__pyx_t_14);
22473       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22474       __pyx_t_10 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_dS), __pyx_t_14); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 872, __pyx_L1_error)
22475       __Pyx_GOTREF(__pyx_t_10);
22476       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22477       if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 872, __pyx_L1_error)
22478       __pyx_t_36 = ((PyArrayObject *)__pyx_t_10);
22479       {
22480         __Pyx_BufFmt_StackElem __pyx_stack[1];
22481         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
22482         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22483         if (unlikely(__pyx_t_37 < 0)) {
22484           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
22485           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22486             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
22487             __Pyx_RaiseBufferFallbackError();
22488           } else {
22489             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
22490           }
22491           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
22492         }
22493         __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1];
22494         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 872, __pyx_L1_error)
22495       }
22496       __pyx_t_36 = 0;
22497       __Pyx_DECREF_SET(__pyx_v_dS, ((PyArrayObject *)__pyx_t_10));
22498       __pyx_t_10 = 0;
22499 
22500       /* "GPy/models/state_space_cython.pyx":876
22501  *             # TODO: maybe symmetrize dS
22502  *
22503  *            tmp1 = H.T / S             # <<<<<<<<<<<<<<
22504  *            tmp2 = dH.T / S
22505  *            tmp3 = dS.T / S
22506  */
22507       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_H), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 876, __pyx_L1_error)
22508       __Pyx_GOTREF(__pyx_t_10);
22509       __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_10, ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 876, __pyx_L1_error)
22510       __Pyx_GOTREF(__pyx_t_14);
22511       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22512       if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 876, __pyx_L1_error)
22513       __pyx_t_36 = ((PyArrayObject *)__pyx_t_14);
22514       {
22515         __Pyx_BufFmt_StackElem __pyx_stack[1];
22516         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp1.rcbuffer->pybuffer);
22517         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp1.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22518         if (unlikely(__pyx_t_37 < 0)) {
22519           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
22520           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp1.rcbuffer->pybuffer, (PyObject*)__pyx_v_tmp1, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22521             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
22522             __Pyx_RaiseBufferFallbackError();
22523           } else {
22524             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
22525           }
22526           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
22527         }
22528         __pyx_pybuffernd_tmp1.diminfo[0].strides = __pyx_pybuffernd_tmp1.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tmp1.diminfo[0].shape = __pyx_pybuffernd_tmp1.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tmp1.diminfo[1].strides = __pyx_pybuffernd_tmp1.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tmp1.diminfo[1].shape = __pyx_pybuffernd_tmp1.rcbuffer->pybuffer.shape[1];
22529         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 876, __pyx_L1_error)
22530       }
22531       __pyx_t_36 = 0;
22532       __Pyx_XDECREF_SET(__pyx_v_tmp1, ((PyArrayObject *)__pyx_t_14));
22533       __pyx_t_14 = 0;
22534 
22535       /* "GPy/models/state_space_cython.pyx":877
22536  *
22537  *            tmp1 = H.T / S
22538  *            tmp2 = dH.T / S             # <<<<<<<<<<<<<<
22539  *            tmp3 = dS.T / S
22540  *
22541  */
22542       __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dH), __pyx_n_s_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 877, __pyx_L1_error)
22543       __Pyx_GOTREF(__pyx_t_14);
22544       __pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_t_14, ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 877, __pyx_L1_error)
22545       __Pyx_GOTREF(__pyx_t_10);
22546       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22547       if (!(likely(((__pyx_t_10) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_10, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 877, __pyx_L1_error)
22548       __pyx_t_36 = ((PyArrayObject *)__pyx_t_10);
22549       {
22550         __Pyx_BufFmt_StackElem __pyx_stack[1];
22551         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp2.rcbuffer->pybuffer);
22552         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp2.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22553         if (unlikely(__pyx_t_37 < 0)) {
22554           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
22555           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp2.rcbuffer->pybuffer, (PyObject*)__pyx_v_tmp2, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22556             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
22557             __Pyx_RaiseBufferFallbackError();
22558           } else {
22559             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
22560           }
22561           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
22562         }
22563         __pyx_pybuffernd_tmp2.diminfo[0].strides = __pyx_pybuffernd_tmp2.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tmp2.diminfo[0].shape = __pyx_pybuffernd_tmp2.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tmp2.diminfo[1].strides = __pyx_pybuffernd_tmp2.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tmp2.diminfo[1].shape = __pyx_pybuffernd_tmp2.rcbuffer->pybuffer.shape[1];
22564         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 877, __pyx_L1_error)
22565       }
22566       __pyx_t_36 = 0;
22567       __Pyx_XDECREF_SET(__pyx_v_tmp2, ((PyArrayObject *)__pyx_t_10));
22568       __pyx_t_10 = 0;
22569 
22570       /* "GPy/models/state_space_cython.pyx":878
22571  *            tmp1 = H.T / S
22572  *            tmp2 = dH.T / S
22573  *            tmp3 = dS.T / S             # <<<<<<<<<<<<<<
22574  *
22575  *            dK = np.dot( dP_pred, tmp1) + np.dot( P_pred, tmp2) - \
22576  */
22577       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_dS), __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 878, __pyx_L1_error)
22578       __Pyx_GOTREF(__pyx_t_10);
22579       __pyx_t_14 = __Pyx_PyNumber_Divide(__pyx_t_10, ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 878, __pyx_L1_error)
22580       __Pyx_GOTREF(__pyx_t_14);
22581       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22582       if (!(likely(((__pyx_t_14) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_14, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 878, __pyx_L1_error)
22583       __pyx_t_36 = ((PyArrayObject *)__pyx_t_14);
22584       {
22585         __Pyx_BufFmt_StackElem __pyx_stack[1];
22586         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp3.rcbuffer->pybuffer);
22587         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp3.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22588         if (unlikely(__pyx_t_37 < 0)) {
22589           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
22590           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp3.rcbuffer->pybuffer, (PyObject*)__pyx_v_tmp3, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22591             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
22592             __Pyx_RaiseBufferFallbackError();
22593           } else {
22594             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
22595           }
22596           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
22597         }
22598         __pyx_pybuffernd_tmp3.diminfo[0].strides = __pyx_pybuffernd_tmp3.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tmp3.diminfo[0].shape = __pyx_pybuffernd_tmp3.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tmp3.diminfo[1].strides = __pyx_pybuffernd_tmp3.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tmp3.diminfo[1].shape = __pyx_pybuffernd_tmp3.rcbuffer->pybuffer.shape[1];
22599         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 878, __pyx_L1_error)
22600       }
22601       __pyx_t_36 = 0;
22602       __Pyx_XDECREF_SET(__pyx_v_tmp3, ((PyArrayObject *)__pyx_t_14));
22603       __pyx_t_14 = 0;
22604 
22605       /* "GPy/models/state_space_cython.pyx":880
22606  *            tmp3 = dS.T / S
22607  *
22608  *            dK = np.dot( dP_pred, tmp1) + np.dot( P_pred, tmp2) - \             # <<<<<<<<<<<<<<
22609  *                 np.dot( P_pred, np.dot( tmp1, tmp3 ) )
22610  *
22611  */
22612       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 880, __pyx_L1_error)
22613       __Pyx_GOTREF(__pyx_t_10);
22614       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
22615       __Pyx_GOTREF(__pyx_t_5);
22616       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22617       __pyx_t_10 = NULL;
22618       __pyx_t_37 = 0;
22619       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
22620         __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_5);
22621         if (likely(__pyx_t_10)) {
22622           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22623           __Pyx_INCREF(__pyx_t_10);
22624           __Pyx_INCREF(function);
22625           __Pyx_DECREF_SET(__pyx_t_5, function);
22626           __pyx_t_37 = 1;
22627         }
22628       }
22629       #if CYTHON_FAST_PYCALL
22630       if (PyFunction_Check(__pyx_t_5)) {
22631         PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_dP_pred), ((PyObject *)__pyx_v_tmp1)};
22632         __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 880, __pyx_L1_error)
22633         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22634         __Pyx_GOTREF(__pyx_t_14);
22635       } else
22636       #endif
22637       #if CYTHON_FAST_PYCCALL
22638       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
22639         PyObject *__pyx_temp[3] = {__pyx_t_10, ((PyObject *)__pyx_v_dP_pred), ((PyObject *)__pyx_v_tmp1)};
22640         __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 880, __pyx_L1_error)
22641         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
22642         __Pyx_GOTREF(__pyx_t_14);
22643       } else
22644       #endif
22645       {
22646         __pyx_t_12 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 880, __pyx_L1_error)
22647         __Pyx_GOTREF(__pyx_t_12);
22648         if (__pyx_t_10) {
22649           __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
22650         }
22651         __Pyx_INCREF(((PyObject *)__pyx_v_dP_pred));
22652         __Pyx_GIVEREF(((PyObject *)__pyx_v_dP_pred));
22653         PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_37, ((PyObject *)__pyx_v_dP_pred));
22654         __Pyx_INCREF(((PyObject *)__pyx_v_tmp1));
22655         __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp1));
22656         PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_37, ((PyObject *)__pyx_v_tmp1));
22657         __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 880, __pyx_L1_error)
22658         __Pyx_GOTREF(__pyx_t_14);
22659         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22660       }
22661       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22662       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 880, __pyx_L1_error)
22663       __Pyx_GOTREF(__pyx_t_12);
22664       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 880, __pyx_L1_error)
22665       __Pyx_GOTREF(__pyx_t_10);
22666       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22667       __pyx_t_12 = NULL;
22668       __pyx_t_37 = 0;
22669       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
22670         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
22671         if (likely(__pyx_t_12)) {
22672           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22673           __Pyx_INCREF(__pyx_t_12);
22674           __Pyx_INCREF(function);
22675           __Pyx_DECREF_SET(__pyx_t_10, function);
22676           __pyx_t_37 = 1;
22677         }
22678       }
22679       #if CYTHON_FAST_PYCALL
22680       if (PyFunction_Check(__pyx_t_10)) {
22681         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_P_pred), ((PyObject *)__pyx_v_tmp2)};
22682         __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
22683         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22684         __Pyx_GOTREF(__pyx_t_5);
22685       } else
22686       #endif
22687       #if CYTHON_FAST_PYCCALL
22688       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
22689         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_P_pred), ((PyObject *)__pyx_v_tmp2)};
22690         __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
22691         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22692         __Pyx_GOTREF(__pyx_t_5);
22693       } else
22694       #endif
22695       {
22696         __pyx_t_7 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 880, __pyx_L1_error)
22697         __Pyx_GOTREF(__pyx_t_7);
22698         if (__pyx_t_12) {
22699           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
22700         }
22701         __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
22702         __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
22703         PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_37, ((PyObject *)__pyx_v_P_pred));
22704         __Pyx_INCREF(((PyObject *)__pyx_v_tmp2));
22705         __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp2));
22706         PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_37, ((PyObject *)__pyx_v_tmp2));
22707         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
22708         __Pyx_GOTREF(__pyx_t_5);
22709         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22710       }
22711       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22712       __pyx_t_10 = PyNumber_Add(__pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 880, __pyx_L1_error)
22713       __Pyx_GOTREF(__pyx_t_10);
22714       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22715       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22716 
22717       /* "GPy/models/state_space_cython.pyx":881
22718  *
22719  *            dK = np.dot( dP_pred, tmp1) + np.dot( P_pred, tmp2) - \
22720  *                 np.dot( P_pred, np.dot( tmp1, tmp3 ) )             # <<<<<<<<<<<<<<
22721  *
22722  *             # terms required for the next step, save this for each parameter
22723  */
22724       __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 881, __pyx_L1_error)
22725       __Pyx_GOTREF(__pyx_t_14);
22726       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 881, __pyx_L1_error)
22727       __Pyx_GOTREF(__pyx_t_7);
22728       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22729       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 881, __pyx_L1_error)
22730       __Pyx_GOTREF(__pyx_t_12);
22731       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_dot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error)
22732       __Pyx_GOTREF(__pyx_t_9);
22733       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
22734       __pyx_t_12 = NULL;
22735       __pyx_t_37 = 0;
22736       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
22737         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
22738         if (likely(__pyx_t_12)) {
22739           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
22740           __Pyx_INCREF(__pyx_t_12);
22741           __Pyx_INCREF(function);
22742           __Pyx_DECREF_SET(__pyx_t_9, function);
22743           __pyx_t_37 = 1;
22744         }
22745       }
22746       #if CYTHON_FAST_PYCALL
22747       if (PyFunction_Check(__pyx_t_9)) {
22748         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_tmp1), ((PyObject *)__pyx_v_tmp3)};
22749         __pyx_t_14 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 881, __pyx_L1_error)
22750         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22751         __Pyx_GOTREF(__pyx_t_14);
22752       } else
22753       #endif
22754       #if CYTHON_FAST_PYCCALL
22755       if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
22756         PyObject *__pyx_temp[3] = {__pyx_t_12, ((PyObject *)__pyx_v_tmp1), ((PyObject *)__pyx_v_tmp3)};
22757         __pyx_t_14 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 881, __pyx_L1_error)
22758         __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
22759         __Pyx_GOTREF(__pyx_t_14);
22760       } else
22761       #endif
22762       {
22763         __pyx_t_1 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
22764         __Pyx_GOTREF(__pyx_t_1);
22765         if (__pyx_t_12) {
22766           __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL;
22767         }
22768         __Pyx_INCREF(((PyObject *)__pyx_v_tmp1));
22769         __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp1));
22770         PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_37, ((PyObject *)__pyx_v_tmp1));
22771         __Pyx_INCREF(((PyObject *)__pyx_v_tmp3));
22772         __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp3));
22773         PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_37, ((PyObject *)__pyx_v_tmp3));
22774         __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 881, __pyx_L1_error)
22775         __Pyx_GOTREF(__pyx_t_14);
22776         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22777       }
22778       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
22779       __pyx_t_9 = NULL;
22780       __pyx_t_37 = 0;
22781       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
22782         __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
22783         if (likely(__pyx_t_9)) {
22784           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
22785           __Pyx_INCREF(__pyx_t_9);
22786           __Pyx_INCREF(function);
22787           __Pyx_DECREF_SET(__pyx_t_7, function);
22788           __pyx_t_37 = 1;
22789         }
22790       }
22791       #if CYTHON_FAST_PYCALL
22792       if (PyFunction_Check(__pyx_t_7)) {
22793         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_P_pred), __pyx_t_14};
22794         __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 881, __pyx_L1_error)
22795         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
22796         __Pyx_GOTREF(__pyx_t_5);
22797         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22798       } else
22799       #endif
22800       #if CYTHON_FAST_PYCCALL
22801       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
22802         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_P_pred), __pyx_t_14};
22803         __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 881, __pyx_L1_error)
22804         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
22805         __Pyx_GOTREF(__pyx_t_5);
22806         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22807       } else
22808       #endif
22809       {
22810         __pyx_t_1 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
22811         __Pyx_GOTREF(__pyx_t_1);
22812         if (__pyx_t_9) {
22813           __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9); __pyx_t_9 = NULL;
22814         }
22815         __Pyx_INCREF(((PyObject *)__pyx_v_P_pred));
22816         __Pyx_GIVEREF(((PyObject *)__pyx_v_P_pred));
22817         PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_37, ((PyObject *)__pyx_v_P_pred));
22818         __Pyx_GIVEREF(__pyx_t_14);
22819         PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_37, __pyx_t_14);
22820         __pyx_t_14 = 0;
22821         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 881, __pyx_L1_error)
22822         __Pyx_GOTREF(__pyx_t_5);
22823         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22824       }
22825       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22826 
22827       /* "GPy/models/state_space_cython.pyx":880
22828  *            tmp3 = dS.T / S
22829  *
22830  *            dK = np.dot( dP_pred, tmp1) + np.dot( P_pred, tmp2) - \             # <<<<<<<<<<<<<<
22831  *                 np.dot( P_pred, np.dot( tmp1, tmp3 ) )
22832  *
22833  */
22834       __pyx_t_7 = PyNumber_Subtract(__pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 880, __pyx_L1_error)
22835       __Pyx_GOTREF(__pyx_t_7);
22836       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22837       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22838       if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 880, __pyx_L1_error)
22839       __pyx_t_36 = ((PyArrayObject *)__pyx_t_7);
22840       {
22841         __Pyx_BufFmt_StackElem __pyx_stack[1];
22842         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dK.rcbuffer->pybuffer);
22843         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dK.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
22844         if (unlikely(__pyx_t_37 < 0)) {
22845           PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
22846           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dK.rcbuffer->pybuffer, (PyObject*)__pyx_v_dK, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
22847             Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
22848             __Pyx_RaiseBufferFallbackError();
22849           } else {
22850             PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
22851           }
22852           __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
22853         }
22854         __pyx_pybuffernd_dK.diminfo[0].strides = __pyx_pybuffernd_dK.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dK.diminfo[0].shape = __pyx_pybuffernd_dK.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dK.diminfo[1].strides = __pyx_pybuffernd_dK.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dK.diminfo[1].shape = __pyx_pybuffernd_dK.rcbuffer->pybuffer.shape[1];
22855         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 880, __pyx_L1_error)
22856       }
22857       __pyx_t_36 = 0;
22858       __Pyx_XDECREF_SET(__pyx_v_dK, ((PyArrayObject *)__pyx_t_7));
22859       __pyx_t_7 = 0;
22860 
22861       /* "GPy/models/state_space_cython.pyx":884
22862  *
22863  *             # terms required for the next step, save this for each parameter
22864  *            dm_upd[:,:,param] = dm_pred + np.dot(dK, v) + np.dot(K, dv)             # <<<<<<<<<<<<<<
22865  *
22866  *            dP_upd[:,:,param] = -np.dot(dK, np.dot(S, K.T))
22867  */
22868       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
22869       __Pyx_GOTREF(__pyx_t_5);
22870       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dot); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 884, __pyx_L1_error)
22871       __Pyx_GOTREF(__pyx_t_10);
22872       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22873       __pyx_t_5 = NULL;
22874       __pyx_t_37 = 0;
22875       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
22876         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_10);
22877         if (likely(__pyx_t_5)) {
22878           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
22879           __Pyx_INCREF(__pyx_t_5);
22880           __Pyx_INCREF(function);
22881           __Pyx_DECREF_SET(__pyx_t_10, function);
22882           __pyx_t_37 = 1;
22883         }
22884       }
22885       #if CYTHON_FAST_PYCALL
22886       if (PyFunction_Check(__pyx_t_10)) {
22887         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_dK), ((PyObject *)__pyx_v_v)};
22888         __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22889         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22890         __Pyx_GOTREF(__pyx_t_7);
22891       } else
22892       #endif
22893       #if CYTHON_FAST_PYCCALL
22894       if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
22895         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_dK), ((PyObject *)__pyx_v_v)};
22896         __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22897         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
22898         __Pyx_GOTREF(__pyx_t_7);
22899       } else
22900       #endif
22901       {
22902         __pyx_t_1 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
22903         __Pyx_GOTREF(__pyx_t_1);
22904         if (__pyx_t_5) {
22905           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
22906         }
22907         __Pyx_INCREF(((PyObject *)__pyx_v_dK));
22908         __Pyx_GIVEREF(((PyObject *)__pyx_v_dK));
22909         PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_37, ((PyObject *)__pyx_v_dK));
22910         __Pyx_INCREF(((PyObject *)__pyx_v_v));
22911         __Pyx_GIVEREF(((PyObject *)__pyx_v_v));
22912         PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_37, ((PyObject *)__pyx_v_v));
22913         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22914         __Pyx_GOTREF(__pyx_t_7);
22915         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22916       }
22917       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22918       __pyx_t_10 = PyNumber_Add(((PyObject *)__pyx_v_dm_pred), __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 884, __pyx_L1_error)
22919       __Pyx_GOTREF(__pyx_t_10);
22920       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22921       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
22922       __Pyx_GOTREF(__pyx_t_1);
22923       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
22924       __Pyx_GOTREF(__pyx_t_5);
22925       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22926       __pyx_t_1 = NULL;
22927       __pyx_t_37 = 0;
22928       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
22929         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
22930         if (likely(__pyx_t_1)) {
22931           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
22932           __Pyx_INCREF(__pyx_t_1);
22933           __Pyx_INCREF(function);
22934           __Pyx_DECREF_SET(__pyx_t_5, function);
22935           __pyx_t_37 = 1;
22936         }
22937       }
22938       #if CYTHON_FAST_PYCALL
22939       if (PyFunction_Check(__pyx_t_5)) {
22940         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_K), ((PyObject *)__pyx_v_dv)};
22941         __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22942         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22943         __Pyx_GOTREF(__pyx_t_7);
22944       } else
22945       #endif
22946       #if CYTHON_FAST_PYCCALL
22947       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
22948         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_K), ((PyObject *)__pyx_v_dv)};
22949         __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22950         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
22951         __Pyx_GOTREF(__pyx_t_7);
22952       } else
22953       #endif
22954       {
22955         __pyx_t_14 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 884, __pyx_L1_error)
22956         __Pyx_GOTREF(__pyx_t_14);
22957         if (__pyx_t_1) {
22958           __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_1); __pyx_t_1 = NULL;
22959         }
22960         __Pyx_INCREF(((PyObject *)__pyx_v_K));
22961         __Pyx_GIVEREF(((PyObject *)__pyx_v_K));
22962         PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_37, ((PyObject *)__pyx_v_K));
22963         __Pyx_INCREF(((PyObject *)__pyx_v_dv));
22964         __Pyx_GIVEREF(((PyObject *)__pyx_v_dv));
22965         PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_37, ((PyObject *)__pyx_v_dv));
22966         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_14, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22967         __Pyx_GOTREF(__pyx_t_7);
22968         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
22969       }
22970       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22971       __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
22972       __Pyx_GOTREF(__pyx_t_5);
22973       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22974       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
22975       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
22976       __Pyx_GOTREF(__pyx_t_7);
22977       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 884, __pyx_L1_error)
22978       __Pyx_GOTREF(__pyx_t_10);
22979       __Pyx_INCREF(__pyx_slice__10);
22980       __Pyx_GIVEREF(__pyx_slice__10);
22981       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__10);
22982       __Pyx_INCREF(__pyx_slice__10);
22983       __Pyx_GIVEREF(__pyx_slice__10);
22984       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__10);
22985       __Pyx_GIVEREF(__pyx_t_7);
22986       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_7);
22987       __pyx_t_7 = 0;
22988       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dm_upd), __pyx_t_10, __pyx_t_5) < 0)) __PYX_ERR(0, 884, __pyx_L1_error)
22989       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
22990       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22991 
22992       /* "GPy/models/state_space_cython.pyx":886
22993  *            dm_upd[:,:,param] = dm_pred + np.dot(dK, v) + np.dot(K, dv)
22994  *
22995  *            dP_upd[:,:,param] = -np.dot(dK, np.dot(S, K.T))             # <<<<<<<<<<<<<<
22996  *            dP_upd[:,:,param] += dP_upd[:,:,param].T
22997  *            dP_upd[:,:,param] += dP_pred - np.dot(K , np.dot( dS, K.T))
22998  */
22999       __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error)
23000       __Pyx_GOTREF(__pyx_t_10);
23001       __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_dot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 886, __pyx_L1_error)
23002       __Pyx_GOTREF(__pyx_t_7);
23003       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23004       __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 886, __pyx_L1_error)
23005       __Pyx_GOTREF(__pyx_t_14);
23006       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 886, __pyx_L1_error)
23007       __Pyx_GOTREF(__pyx_t_1);
23008       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23009       __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_K), __pyx_n_s_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 886, __pyx_L1_error)
23010       __Pyx_GOTREF(__pyx_t_14);
23011       __pyx_t_9 = NULL;
23012       __pyx_t_37 = 0;
23013       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23014         __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
23015         if (likely(__pyx_t_9)) {
23016           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23017           __Pyx_INCREF(__pyx_t_9);
23018           __Pyx_INCREF(function);
23019           __Pyx_DECREF_SET(__pyx_t_1, function);
23020           __pyx_t_37 = 1;
23021         }
23022       }
23023       #if CYTHON_FAST_PYCALL
23024       if (PyFunction_Check(__pyx_t_1)) {
23025         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_S), __pyx_t_14};
23026         __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error)
23027         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23028         __Pyx_GOTREF(__pyx_t_10);
23029         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23030       } else
23031       #endif
23032       #if CYTHON_FAST_PYCCALL
23033       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
23034         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_S), __pyx_t_14};
23035         __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error)
23036         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23037         __Pyx_GOTREF(__pyx_t_10);
23038         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23039       } else
23040       #endif
23041       {
23042         __pyx_t_12 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 886, __pyx_L1_error)
23043         __Pyx_GOTREF(__pyx_t_12);
23044         if (__pyx_t_9) {
23045           __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
23046         }
23047         __Pyx_INCREF(((PyObject *)__pyx_v_S));
23048         __Pyx_GIVEREF(((PyObject *)__pyx_v_S));
23049         PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_37, ((PyObject *)__pyx_v_S));
23050         __Pyx_GIVEREF(__pyx_t_14);
23051         PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_37, __pyx_t_14);
23052         __pyx_t_14 = 0;
23053         __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error)
23054         __Pyx_GOTREF(__pyx_t_10);
23055         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23056       }
23057       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23058       __pyx_t_1 = NULL;
23059       __pyx_t_37 = 0;
23060       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
23061         __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
23062         if (likely(__pyx_t_1)) {
23063           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
23064           __Pyx_INCREF(__pyx_t_1);
23065           __Pyx_INCREF(function);
23066           __Pyx_DECREF_SET(__pyx_t_7, function);
23067           __pyx_t_37 = 1;
23068         }
23069       }
23070       #if CYTHON_FAST_PYCALL
23071       if (PyFunction_Check(__pyx_t_7)) {
23072         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dK), __pyx_t_10};
23073         __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
23074         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23075         __Pyx_GOTREF(__pyx_t_5);
23076         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23077       } else
23078       #endif
23079       #if CYTHON_FAST_PYCCALL
23080       if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
23081         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_dK), __pyx_t_10};
23082         __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
23083         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
23084         __Pyx_GOTREF(__pyx_t_5);
23085         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23086       } else
23087       #endif
23088       {
23089         __pyx_t_12 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 886, __pyx_L1_error)
23090         __Pyx_GOTREF(__pyx_t_12);
23091         if (__pyx_t_1) {
23092           __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
23093         }
23094         __Pyx_INCREF(((PyObject *)__pyx_v_dK));
23095         __Pyx_GIVEREF(((PyObject *)__pyx_v_dK));
23096         PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_37, ((PyObject *)__pyx_v_dK));
23097         __Pyx_GIVEREF(__pyx_t_10);
23098         PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_37, __pyx_t_10);
23099         __pyx_t_10 = 0;
23100         __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
23101         __Pyx_GOTREF(__pyx_t_5);
23102         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23103       }
23104       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23105       __pyx_t_7 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 886, __pyx_L1_error)
23106       __Pyx_GOTREF(__pyx_t_7);
23107       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23108       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
23109       __Pyx_GOTREF(__pyx_t_5);
23110       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 886, __pyx_L1_error)
23111       __Pyx_GOTREF(__pyx_t_12);
23112       __Pyx_INCREF(__pyx_slice__10);
23113       __Pyx_GIVEREF(__pyx_slice__10);
23114       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
23115       __Pyx_INCREF(__pyx_slice__10);
23116       __Pyx_GIVEREF(__pyx_slice__10);
23117       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
23118       __Pyx_GIVEREF(__pyx_t_5);
23119       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_5);
23120       __pyx_t_5 = 0;
23121       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_12, __pyx_t_7) < 0)) __PYX_ERR(0, 886, __pyx_L1_error)
23122       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23123       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23124 
23125       /* "GPy/models/state_space_cython.pyx":887
23126  *
23127  *            dP_upd[:,:,param] = -np.dot(dK, np.dot(S, K.T))
23128  *            dP_upd[:,:,param] += dP_upd[:,:,param].T             # <<<<<<<<<<<<<<
23129  *            dP_upd[:,:,param] += dP_pred - np.dot(K , np.dot( dS, K.T))
23130  *
23131  */
23132       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L1_error)
23133       __Pyx_GOTREF(__pyx_t_7);
23134       __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 887, __pyx_L1_error)
23135       __Pyx_GOTREF(__pyx_t_12);
23136       __Pyx_INCREF(__pyx_slice__10);
23137       __Pyx_GIVEREF(__pyx_slice__10);
23138       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_slice__10);
23139       __Pyx_INCREF(__pyx_slice__10);
23140       __Pyx_GIVEREF(__pyx_slice__10);
23141       PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice__10);
23142       __Pyx_GIVEREF(__pyx_t_7);
23143       PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_7);
23144       __pyx_t_7 = 0;
23145       __pyx_t_7 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L1_error)
23146       __Pyx_GOTREF(__pyx_t_7);
23147       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error)
23148       __Pyx_GOTREF(__pyx_t_5);
23149       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 887, __pyx_L1_error)
23150       __Pyx_GOTREF(__pyx_t_10);
23151       __Pyx_INCREF(__pyx_slice__10);
23152       __Pyx_GIVEREF(__pyx_slice__10);
23153       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__10);
23154       __Pyx_INCREF(__pyx_slice__10);
23155       __Pyx_GIVEREF(__pyx_slice__10);
23156       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__10);
23157       __Pyx_GIVEREF(__pyx_t_5);
23158       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
23159       __pyx_t_5 = 0;
23160       __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error)
23161       __Pyx_GOTREF(__pyx_t_5);
23162       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23163       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_T); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 887, __pyx_L1_error)
23164       __Pyx_GOTREF(__pyx_t_10);
23165       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23166       __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 887, __pyx_L1_error)
23167       __Pyx_GOTREF(__pyx_t_5);
23168       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23169       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23170       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_12, __pyx_t_5) < 0)) __PYX_ERR(0, 887, __pyx_L1_error)
23171       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23172       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23173 
23174       /* "GPy/models/state_space_cython.pyx":888
23175  *            dP_upd[:,:,param] = -np.dot(dK, np.dot(S, K.T))
23176  *            dP_upd[:,:,param] += dP_upd[:,:,param].T
23177  *            dP_upd[:,:,param] += dP_pred - np.dot(K , np.dot( dS, K.T))             # <<<<<<<<<<<<<<
23178  *
23179  *            dP_upd[:,:,param] = 0.5*(dP_upd[:,:,param] + dP_upd[:,:,param].T) #symmetrize
23180  */
23181       __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 888, __pyx_L1_error)
23182       __Pyx_GOTREF(__pyx_t_12);
23183       __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
23184       __Pyx_GOTREF(__pyx_t_5);
23185       __Pyx_INCREF(__pyx_slice__10);
23186       __Pyx_GIVEREF(__pyx_slice__10);
23187       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__10);
23188       __Pyx_INCREF(__pyx_slice__10);
23189       __Pyx_GIVEREF(__pyx_slice__10);
23190       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__10);
23191       __Pyx_GIVEREF(__pyx_t_12);
23192       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_12);
23193       __pyx_t_12 = 0;
23194       __pyx_t_12 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 888, __pyx_L1_error)
23195       __Pyx_GOTREF(__pyx_t_12);
23196       __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
23197       __Pyx_GOTREF(__pyx_t_7);
23198       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
23199       __Pyx_GOTREF(__pyx_t_1);
23200       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23201       __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_np); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 888, __pyx_L1_error)
23202       __Pyx_GOTREF(__pyx_t_14);
23203       __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_dot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 888, __pyx_L1_error)
23204       __Pyx_GOTREF(__pyx_t_9);
23205       __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23206       __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_K), __pyx_n_s_T); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 888, __pyx_L1_error)
23207       __Pyx_GOTREF(__pyx_t_14);
23208       __pyx_t_8 = NULL;
23209       __pyx_t_37 = 0;
23210       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_9))) {
23211         __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_9);
23212         if (likely(__pyx_t_8)) {
23213           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
23214           __Pyx_INCREF(__pyx_t_8);
23215           __Pyx_INCREF(function);
23216           __Pyx_DECREF_SET(__pyx_t_9, function);
23217           __pyx_t_37 = 1;
23218         }
23219       }
23220       #if CYTHON_FAST_PYCALL
23221       if (PyFunction_Check(__pyx_t_9)) {
23222         PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_dS), __pyx_t_14};
23223         __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
23224         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23225         __Pyx_GOTREF(__pyx_t_7);
23226         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23227       } else
23228       #endif
23229       #if CYTHON_FAST_PYCCALL
23230       if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
23231         PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_dS), __pyx_t_14};
23232         __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
23233         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
23234         __Pyx_GOTREF(__pyx_t_7);
23235         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
23236       } else
23237       #endif
23238       {
23239         __pyx_t_11 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 888, __pyx_L1_error)
23240         __Pyx_GOTREF(__pyx_t_11);
23241         if (__pyx_t_8) {
23242           __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8); __pyx_t_8 = NULL;
23243         }
23244         __Pyx_INCREF(((PyObject *)__pyx_v_dS));
23245         __Pyx_GIVEREF(((PyObject *)__pyx_v_dS));
23246         PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_37, ((PyObject *)__pyx_v_dS));
23247         __Pyx_GIVEREF(__pyx_t_14);
23248         PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_37, __pyx_t_14);
23249         __pyx_t_14 = 0;
23250         __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 888, __pyx_L1_error)
23251         __Pyx_GOTREF(__pyx_t_7);
23252         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23253       }
23254       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
23255       __pyx_t_9 = NULL;
23256       __pyx_t_37 = 0;
23257       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
23258         __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
23259         if (likely(__pyx_t_9)) {
23260           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23261           __Pyx_INCREF(__pyx_t_9);
23262           __Pyx_INCREF(function);
23263           __Pyx_DECREF_SET(__pyx_t_1, function);
23264           __pyx_t_37 = 1;
23265         }
23266       }
23267       #if CYTHON_FAST_PYCALL
23268       if (PyFunction_Check(__pyx_t_1)) {
23269         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_K), __pyx_t_7};
23270         __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 888, __pyx_L1_error)
23271         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23272         __Pyx_GOTREF(__pyx_t_10);
23273         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23274       } else
23275       #endif
23276       #if CYTHON_FAST_PYCCALL
23277       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
23278         PyObject *__pyx_temp[3] = {__pyx_t_9, ((PyObject *)__pyx_v_K), __pyx_t_7};
23279         __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 888, __pyx_L1_error)
23280         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
23281         __Pyx_GOTREF(__pyx_t_10);
23282         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23283       } else
23284       #endif
23285       {
23286         __pyx_t_11 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 888, __pyx_L1_error)
23287         __Pyx_GOTREF(__pyx_t_11);
23288         if (__pyx_t_9) {
23289           __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
23290         }
23291         __Pyx_INCREF(((PyObject *)__pyx_v_K));
23292         __Pyx_GIVEREF(((PyObject *)__pyx_v_K));
23293         PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_37, ((PyObject *)__pyx_v_K));
23294         __Pyx_GIVEREF(__pyx_t_7);
23295         PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_37, __pyx_t_7);
23296         __pyx_t_7 = 0;
23297         __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 888, __pyx_L1_error)
23298         __Pyx_GOTREF(__pyx_t_10);
23299         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23300       }
23301       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23302       __pyx_t_1 = PyNumber_Subtract(((PyObject *)__pyx_v_dP_pred), __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __pyx_L1_error)
23303       __Pyx_GOTREF(__pyx_t_1);
23304       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23305       __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_t_12, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 888, __pyx_L1_error)
23306       __Pyx_GOTREF(__pyx_t_10);
23307       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23308       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23309       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_5, __pyx_t_10) < 0)) __PYX_ERR(0, 888, __pyx_L1_error)
23310       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23311       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23312 
23313       /* "GPy/models/state_space_cython.pyx":890
23314  *            dP_upd[:,:,param] += dP_pred - np.dot(K , np.dot( dS, K.T))
23315  *
23316  *            dP_upd[:,:,param] = 0.5*(dP_upd[:,:,param] + dP_upd[:,:,param].T) #symmetrize             # <<<<<<<<<<<<<<
23317  *            # computing the likelihood change for each parameter:
23318  *            tmp5 = v / S
23319  */
23320       __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
23321       __Pyx_GOTREF(__pyx_t_5);
23322       __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
23323       __Pyx_GOTREF(__pyx_t_10);
23324       __Pyx_INCREF(__pyx_slice__10);
23325       __Pyx_GIVEREF(__pyx_slice__10);
23326       PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_slice__10);
23327       __Pyx_INCREF(__pyx_slice__10);
23328       __Pyx_GIVEREF(__pyx_slice__10);
23329       PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_slice__10);
23330       __Pyx_GIVEREF(__pyx_t_5);
23331       PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_5);
23332       __pyx_t_5 = 0;
23333       __pyx_t_5 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
23334       __Pyx_GOTREF(__pyx_t_5);
23335       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23336       __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
23337       __Pyx_GOTREF(__pyx_t_10);
23338       __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
23339       __Pyx_GOTREF(__pyx_t_1);
23340       __Pyx_INCREF(__pyx_slice__10);
23341       __Pyx_GIVEREF(__pyx_slice__10);
23342       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_slice__10);
23343       __Pyx_INCREF(__pyx_slice__10);
23344       __Pyx_GIVEREF(__pyx_slice__10);
23345       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
23346       __Pyx_GIVEREF(__pyx_t_10);
23347       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_10);
23348       __pyx_t_10 = 0;
23349       __pyx_t_10 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
23350       __Pyx_GOTREF(__pyx_t_10);
23351       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23352       __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_T); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
23353       __Pyx_GOTREF(__pyx_t_1);
23354       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23355       __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
23356       __Pyx_GOTREF(__pyx_t_10);
23357       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23358       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23359       __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
23360       __Pyx_GOTREF(__pyx_t_1);
23361       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23362       __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 890, __pyx_L1_error)
23363       __Pyx_GOTREF(__pyx_t_10);
23364       __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
23365       __Pyx_GOTREF(__pyx_t_5);
23366       __Pyx_INCREF(__pyx_slice__10);
23367       __Pyx_GIVEREF(__pyx_slice__10);
23368       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_slice__10);
23369       __Pyx_INCREF(__pyx_slice__10);
23370       __Pyx_GIVEREF(__pyx_slice__10);
23371       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__10);
23372       __Pyx_GIVEREF(__pyx_t_10);
23373       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_10);
23374       __pyx_t_10 = 0;
23375       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_dP_upd), __pyx_t_5, __pyx_t_1) < 0)) __PYX_ERR(0, 890, __pyx_L1_error)
23376       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23377       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23378 
23379       /* "GPy/models/state_space_cython.pyx":892
23380  *            dP_upd[:,:,param] = 0.5*(dP_upd[:,:,param] + dP_upd[:,:,param].T) #symmetrize
23381  *            # computing the likelihood change for each parameter:
23382  *            tmp5 = v / S             # <<<<<<<<<<<<<<
23383  *
23384  *
23385  */
23386       __pyx_t_1 = __Pyx_PyNumber_Divide(((PyObject *)__pyx_v_v), ((PyObject *)__pyx_v_S)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 892, __pyx_L1_error)
23387       __Pyx_GOTREF(__pyx_t_1);
23388       if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 892, __pyx_L1_error)
23389       __pyx_t_36 = ((PyArrayObject *)__pyx_t_1);
23390       {
23391         __Pyx_BufFmt_StackElem __pyx_stack[1];
23392         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp5.rcbuffer->pybuffer);
23393         __pyx_t_37 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp5.rcbuffer->pybuffer, (PyObject*)__pyx_t_36, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
23394         if (unlikely(__pyx_t_37 < 0)) {
23395           PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
23396           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_tmp5.rcbuffer->pybuffer, (PyObject*)__pyx_v_tmp5, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
23397             Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
23398             __Pyx_RaiseBufferFallbackError();
23399           } else {
23400             PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
23401           }
23402           __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
23403         }
23404         __pyx_pybuffernd_tmp5.diminfo[0].strides = __pyx_pybuffernd_tmp5.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_tmp5.diminfo[0].shape = __pyx_pybuffernd_tmp5.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_tmp5.diminfo[1].strides = __pyx_pybuffernd_tmp5.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_tmp5.diminfo[1].shape = __pyx_pybuffernd_tmp5.rcbuffer->pybuffer.shape[1];
23405         if (unlikely(__pyx_t_37 < 0)) __PYX_ERR(0, 892, __pyx_L1_error)
23406       }
23407       __pyx_t_36 = 0;
23408       __Pyx_XDECREF_SET(__pyx_v_tmp5, ((PyArrayObject *)__pyx_t_1));
23409       __pyx_t_1 = 0;
23410 
23411       /* "GPy/models/state_space_cython.pyx":895
23412  *
23413  *
23414  *            d_log_likelihood_update[param,:] = -(0.5*np.sum(np.diag(tmp3)) + \             # <<<<<<<<<<<<<<
23415  *                np.sum(tmp5*dv, axis=0) - 0.5 * np.sum(tmp5 * np.dot(dS, tmp5), axis=0) )
23416  *
23417  */
23418       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
23419       __Pyx_GOTREF(__pyx_t_5);
23420       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 895, __pyx_L1_error)
23421       __Pyx_GOTREF(__pyx_t_10);
23422       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23423       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 895, __pyx_L1_error)
23424       __Pyx_GOTREF(__pyx_t_12);
23425       __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_diag); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 895, __pyx_L1_error)
23426       __Pyx_GOTREF(__pyx_t_11);
23427       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23428       __pyx_t_12 = NULL;
23429       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
23430         __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
23431         if (likely(__pyx_t_12)) {
23432           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
23433           __Pyx_INCREF(__pyx_t_12);
23434           __Pyx_INCREF(function);
23435           __Pyx_DECREF_SET(__pyx_t_11, function);
23436         }
23437       }
23438       __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, ((PyObject *)__pyx_v_tmp3)) : __Pyx_PyObject_CallOneArg(__pyx_t_11, ((PyObject *)__pyx_v_tmp3));
23439       __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
23440       if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
23441       __Pyx_GOTREF(__pyx_t_5);
23442       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23443       __pyx_t_11 = NULL;
23444       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
23445         __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
23446         if (likely(__pyx_t_11)) {
23447           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
23448           __Pyx_INCREF(__pyx_t_11);
23449           __Pyx_INCREF(function);
23450           __Pyx_DECREF_SET(__pyx_t_10, function);
23451         }
23452       }
23453       __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_5);
23454       __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23455       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23456       if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
23457       __Pyx_GOTREF(__pyx_t_1);
23458       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23459       __pyx_t_10 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 895, __pyx_L1_error)
23460       __Pyx_GOTREF(__pyx_t_10);
23461       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23462 
23463       /* "GPy/models/state_space_cython.pyx":896
23464  *
23465  *            d_log_likelihood_update[param,:] = -(0.5*np.sum(np.diag(tmp3)) + \
23466  *                np.sum(tmp5*dv, axis=0) - 0.5 * np.sum(tmp5 * np.dot(dS, tmp5), axis=0) )             # <<<<<<<<<<<<<<
23467  *
23468  *         # Compute the actual updates for mean of the states. Variance update
23469  */
23470       __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
23471       __Pyx_GOTREF(__pyx_t_1);
23472       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
23473       __Pyx_GOTREF(__pyx_t_5);
23474       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23475       __pyx_t_1 = PyNumber_Multiply(((PyObject *)__pyx_v_tmp5), ((PyObject *)__pyx_v_dv)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
23476       __Pyx_GOTREF(__pyx_t_1);
23477       __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 896, __pyx_L1_error)
23478       __Pyx_GOTREF(__pyx_t_11);
23479       __Pyx_GIVEREF(__pyx_t_1);
23480       PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1);
23481       __pyx_t_1 = 0;
23482       __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error)
23483       __Pyx_GOTREF(__pyx_t_1);
23484       if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 896, __pyx_L1_error)
23485       __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23486       __Pyx_GOTREF(__pyx_t_12);
23487       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23488       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23489       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23490 
23491       /* "GPy/models/state_space_cython.pyx":895
23492  *
23493  *
23494  *            d_log_likelihood_update[param,:] = -(0.5*np.sum(np.diag(tmp3)) + \             # <<<<<<<<<<<<<<
23495  *                np.sum(tmp5*dv, axis=0) - 0.5 * np.sum(tmp5 * np.dot(dS, tmp5), axis=0) )
23496  *
23497  */
23498       __pyx_t_1 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
23499       __Pyx_GOTREF(__pyx_t_1);
23500       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23501       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23502 
23503       /* "GPy/models/state_space_cython.pyx":896
23504  *
23505  *            d_log_likelihood_update[param,:] = -(0.5*np.sum(np.diag(tmp3)) + \
23506  *                np.sum(tmp5*dv, axis=0) - 0.5 * np.sum(tmp5 * np.dot(dS, tmp5), axis=0) )             # <<<<<<<<<<<<<<
23507  *
23508  *         # Compute the actual updates for mean of the states. Variance update
23509  */
23510       __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_np); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23511       __Pyx_GOTREF(__pyx_t_12);
23512       __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sum); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 896, __pyx_L1_error)
23513       __Pyx_GOTREF(__pyx_t_10);
23514       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23515       __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 896, __pyx_L1_error)
23516       __Pyx_GOTREF(__pyx_t_11);
23517       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
23518       __Pyx_GOTREF(__pyx_t_5);
23519       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
23520       __pyx_t_11 = NULL;
23521       __pyx_t_37 = 0;
23522       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
23523         __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5);
23524         if (likely(__pyx_t_11)) {
23525           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
23526           __Pyx_INCREF(__pyx_t_11);
23527           __Pyx_INCREF(function);
23528           __Pyx_DECREF_SET(__pyx_t_5, function);
23529           __pyx_t_37 = 1;
23530         }
23531       }
23532       #if CYTHON_FAST_PYCALL
23533       if (PyFunction_Check(__pyx_t_5)) {
23534         PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_dS), ((PyObject *)__pyx_v_tmp5)};
23535         __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23536         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23537         __Pyx_GOTREF(__pyx_t_12);
23538       } else
23539       #endif
23540       #if CYTHON_FAST_PYCCALL
23541       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
23542         PyObject *__pyx_temp[3] = {__pyx_t_11, ((PyObject *)__pyx_v_dS), ((PyObject *)__pyx_v_tmp5)};
23543         __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_37, 2+__pyx_t_37); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23544         __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
23545         __Pyx_GOTREF(__pyx_t_12);
23546       } else
23547       #endif
23548       {
23549         __pyx_t_7 = PyTuple_New(2+__pyx_t_37); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 896, __pyx_L1_error)
23550         __Pyx_GOTREF(__pyx_t_7);
23551         if (__pyx_t_11) {
23552           __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_11); __pyx_t_11 = NULL;
23553         }
23554         __Pyx_INCREF(((PyObject *)__pyx_v_dS));
23555         __Pyx_GIVEREF(((PyObject *)__pyx_v_dS));
23556         PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_37, ((PyObject *)__pyx_v_dS));
23557         __Pyx_INCREF(((PyObject *)__pyx_v_tmp5));
23558         __Pyx_GIVEREF(((PyObject *)__pyx_v_tmp5));
23559         PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_37, ((PyObject *)__pyx_v_tmp5));
23560         __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23561         __Pyx_GOTREF(__pyx_t_12);
23562         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23563       }
23564       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23565       __pyx_t_5 = PyNumber_Multiply(((PyObject *)__pyx_v_tmp5), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
23566       __Pyx_GOTREF(__pyx_t_5);
23567       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23568       __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 896, __pyx_L1_error)
23569       __Pyx_GOTREF(__pyx_t_12);
23570       __Pyx_GIVEREF(__pyx_t_5);
23571       PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_5);
23572       __pyx_t_5 = 0;
23573       __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
23574       __Pyx_GOTREF(__pyx_t_5);
23575       if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 896, __pyx_L1_error)
23576       __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 896, __pyx_L1_error)
23577       __Pyx_GOTREF(__pyx_t_7);
23578       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
23579       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
23580       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23581       __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 896, __pyx_L1_error)
23582       __Pyx_GOTREF(__pyx_t_5);
23583       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23584       __pyx_t_7 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 896, __pyx_L1_error)
23585       __Pyx_GOTREF(__pyx_t_7);
23586       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23587       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23588 
23589       /* "GPy/models/state_space_cython.pyx":895
23590  *
23591  *
23592  *            d_log_likelihood_update[param,:] = -(0.5*np.sum(np.diag(tmp3)) + \             # <<<<<<<<<<<<<<
23593  *                np.sum(tmp5*dv, axis=0) - 0.5 * np.sum(tmp5 * np.dot(dS, tmp5), axis=0) )
23594  *
23595  */
23596       __pyx_t_5 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 895, __pyx_L1_error)
23597       __Pyx_GOTREF(__pyx_t_5);
23598       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
23599       __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_param); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 895, __pyx_L1_error)
23600       __Pyx_GOTREF(__pyx_t_7);
23601       __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error)
23602       __Pyx_GOTREF(__pyx_t_1);
23603       __Pyx_GIVEREF(__pyx_t_7);
23604       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7);
23605       __Pyx_INCREF(__pyx_slice__10);
23606       __Pyx_GIVEREF(__pyx_slice__10);
23607       PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
23608       __pyx_t_7 = 0;
23609       if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_d_log_likelihood_update), __pyx_t_1, __pyx_t_5) < 0)) __PYX_ERR(0, 895, __pyx_L1_error)
23610       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23611       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23612     }
23613 
23614     /* "GPy/models/state_space_cython.pyx":846
23615  *     cdef tuple ret
23616  *
23617  *     if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
23618  *         dm_pred_all_params = p_dm # derivativas of the prediction phase
23619  *         dP_pred_all_params = p_dP
23620  */
23621     goto __pyx_L7;
23622   }
23623 
23624   /* "GPy/models/state_space_cython.pyx":901
23625  *         # is computed earlier.
23626  *     else:
23627  *         dm_upd = None             # <<<<<<<<<<<<<<
23628  *         dP_upd = None
23629  *         d_log_likelihood_update = None
23630  */
23631   /*else*/ {
23632     __pyx_t_31 = ((PyArrayObject *)Py_None);
23633     {
23634       __Pyx_BufFmt_StackElem __pyx_stack[1];
23635       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
23636       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
23637       if (unlikely(__pyx_t_13 < 0)) {
23638         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
23639         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
23640           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
23641           __Pyx_RaiseBufferFallbackError();
23642         } else {
23643           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
23644         }
23645         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
23646       }
23647       __pyx_pybuffernd_dm_upd.diminfo[0].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_upd.diminfo[0].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_upd.diminfo[1].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_upd.diminfo[1].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_upd.diminfo[2].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_upd.diminfo[2].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[2];
23648       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 901, __pyx_L1_error)
23649     }
23650     __pyx_t_31 = 0;
23651     __Pyx_INCREF(Py_None);
23652     __pyx_v_dm_upd = ((PyArrayObject *)Py_None);
23653 
23654     /* "GPy/models/state_space_cython.pyx":902
23655  *     else:
23656  *         dm_upd = None
23657  *         dP_upd = None             # <<<<<<<<<<<<<<
23658  *         d_log_likelihood_update = None
23659  *
23660  */
23661     __pyx_t_32 = ((PyArrayObject *)Py_None);
23662     {
23663       __Pyx_BufFmt_StackElem __pyx_stack[1];
23664       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
23665       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
23666       if (unlikely(__pyx_t_13 < 0)) {
23667         PyErr_Fetch(&__pyx_t_25, &__pyx_t_26, &__pyx_t_27);
23668         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
23669           Py_XDECREF(__pyx_t_25); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_27);
23670           __Pyx_RaiseBufferFallbackError();
23671         } else {
23672           PyErr_Restore(__pyx_t_25, __pyx_t_26, __pyx_t_27);
23673         }
23674         __pyx_t_25 = __pyx_t_26 = __pyx_t_27 = 0;
23675       }
23676       __pyx_pybuffernd_dP_upd.diminfo[0].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_upd.diminfo[0].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_upd.diminfo[1].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_upd.diminfo[1].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_upd.diminfo[2].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_upd.diminfo[2].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[2];
23677       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
23678     }
23679     __pyx_t_32 = 0;
23680     __Pyx_INCREF(Py_None);
23681     __pyx_v_dP_upd = ((PyArrayObject *)Py_None);
23682 
23683     /* "GPy/models/state_space_cython.pyx":903
23684  *         dm_upd = None
23685  *         dP_upd = None
23686  *         d_log_likelihood_update = None             # <<<<<<<<<<<<<<
23687  *
23688  *     m_upd = m_pred + K.dot( v )
23689  */
23690     __pyx_t_33 = ((PyArrayObject *)Py_None);
23691     {
23692       __Pyx_BufFmt_StackElem __pyx_stack[1];
23693       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
23694       __pyx_t_13 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_33, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
23695       if (unlikely(__pyx_t_13 < 0)) {
23696         PyErr_Fetch(&__pyx_t_27, &__pyx_t_26, &__pyx_t_25);
23697         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
23698           Py_XDECREF(__pyx_t_27); Py_XDECREF(__pyx_t_26); Py_XDECREF(__pyx_t_25);
23699           __Pyx_RaiseBufferFallbackError();
23700         } else {
23701           PyErr_Restore(__pyx_t_27, __pyx_t_26, __pyx_t_25);
23702         }
23703         __pyx_t_27 = __pyx_t_26 = __pyx_t_25 = 0;
23704       }
23705       __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[1];
23706       if (unlikely(__pyx_t_13 < 0)) __PYX_ERR(0, 903, __pyx_L1_error)
23707     }
23708     __pyx_t_33 = 0;
23709     __Pyx_INCREF(Py_None);
23710     __pyx_v_d_log_likelihood_update = ((PyArrayObject *)Py_None);
23711   }
23712   __pyx_L7:;
23713 
23714   /* "GPy/models/state_space_cython.pyx":905
23715  *         d_log_likelihood_update = None
23716  *
23717  *     m_upd = m_pred + K.dot( v )             # <<<<<<<<<<<<<<
23718  *
23719  *     ret = (P_upd,S_upd,U_upd)
23720  */
23721   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_K), __pyx_n_s_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
23722   __Pyx_GOTREF(__pyx_t_1);
23723   __pyx_t_7 = NULL;
23724   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
23725     __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
23726     if (likely(__pyx_t_7)) {
23727       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
23728       __Pyx_INCREF(__pyx_t_7);
23729       __Pyx_INCREF(function);
23730       __Pyx_DECREF_SET(__pyx_t_1, function);
23731     }
23732   }
23733   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, ((PyObject *)__pyx_v_v)) : __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_v));
23734   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
23735   if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 905, __pyx_L1_error)
23736   __Pyx_GOTREF(__pyx_t_5);
23737   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23738   __pyx_t_1 = PyNumber_Add(((PyObject *)__pyx_v_m_pred), __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error)
23739   __Pyx_GOTREF(__pyx_t_1);
23740   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
23741   __pyx_v_m_upd = __pyx_t_1;
23742   __pyx_t_1 = 0;
23743 
23744   /* "GPy/models/state_space_cython.pyx":907
23745  *     m_upd = m_pred + K.dot( v )
23746  *
23747  *     ret = (P_upd,S_upd,U_upd)             # <<<<<<<<<<<<<<
23748  *     return m_upd, ret, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update
23749  *
23750  */
23751   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
23752   __Pyx_GOTREF(__pyx_t_1);
23753   __Pyx_INCREF(((PyObject *)__pyx_v_P_upd));
23754   __Pyx_GIVEREF(((PyObject *)__pyx_v_P_upd));
23755   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_P_upd));
23756   __Pyx_INCREF(((PyObject *)__pyx_v_S_upd));
23757   __Pyx_GIVEREF(((PyObject *)__pyx_v_S_upd));
23758   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_S_upd));
23759   __Pyx_INCREF(((PyObject *)__pyx_v_U_upd));
23760   __Pyx_GIVEREF(((PyObject *)__pyx_v_U_upd));
23761   PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_U_upd));
23762   __pyx_v_ret = ((PyObject*)__pyx_t_1);
23763   __pyx_t_1 = 0;
23764 
23765   /* "GPy/models/state_space_cython.pyx":908
23766  *
23767  *     ret = (P_upd,S_upd,U_upd)
23768  *     return m_upd, ret, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update             # <<<<<<<<<<<<<<
23769  *
23770  *
23771  */
23772   __Pyx_XDECREF(__pyx_r);
23773   __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
23774   __Pyx_GOTREF(__pyx_t_1);
23775   __Pyx_INCREF(__pyx_v_m_upd);
23776   __Pyx_GIVEREF(__pyx_v_m_upd);
23777   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_m_upd);
23778   __Pyx_INCREF(__pyx_v_ret);
23779   __Pyx_GIVEREF(__pyx_v_ret);
23780   PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ret);
23781   __Pyx_INCREF(((PyObject *)__pyx_v_log_likelihood_update));
23782   __Pyx_GIVEREF(((PyObject *)__pyx_v_log_likelihood_update));
23783   PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_log_likelihood_update));
23784   __Pyx_INCREF(((PyObject *)__pyx_v_dm_upd));
23785   __Pyx_GIVEREF(((PyObject *)__pyx_v_dm_upd));
23786   PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_dm_upd));
23787   __Pyx_INCREF(((PyObject *)__pyx_v_dP_upd));
23788   __Pyx_GIVEREF(((PyObject *)__pyx_v_dP_upd));
23789   PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_dP_upd));
23790   __Pyx_INCREF(((PyObject *)__pyx_v_d_log_likelihood_update));
23791   __Pyx_GIVEREF(((PyObject *)__pyx_v_d_log_likelihood_update));
23792   PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)__pyx_v_d_log_likelihood_update));
23793   __pyx_r = __pyx_t_1;
23794   __pyx_t_1 = 0;
23795   goto __pyx_L0;
23796 
23797   /* "GPy/models/state_space_cython.pyx":686
23798  *
23799  * @cython.boundscheck(False)
23800  * def _kalman_update_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m, tuple p_P,             # <<<<<<<<<<<<<<
23801  *                             Measurement_Callables_Cython p_measurement_callables,
23802  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
23803  */
23804 
23805   /* function exit code */
23806   __pyx_L1_error:;
23807   __Pyx_XDECREF(__pyx_t_1);
23808   __Pyx_XDECREF(__pyx_t_5);
23809   __Pyx_XDECREF(__pyx_t_7);
23810   __Pyx_XDECREF(__pyx_t_8);
23811   __Pyx_XDECREF(__pyx_t_9);
23812   __Pyx_XDECREF(__pyx_t_10);
23813   __Pyx_XDECREF(__pyx_t_11);
23814   __Pyx_XDECREF(__pyx_t_12);
23815   __Pyx_XDECREF(__pyx_t_14);
23816   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
23817     __Pyx_PyThreadState_declare
23818     __Pyx_PyThreadState_assign
23819     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
23820     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
23821     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_K.rcbuffer->pybuffer);
23822     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
23823     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_upd.rcbuffer->pybuffer);
23824     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
23825     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R_isr.rcbuffer->pybuffer);
23826     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
23827     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_pred.rcbuffer->pybuffer);
23828     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_svd.rcbuffer->pybuffer);
23829     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_upd.rcbuffer->pybuffer);
23830     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
23831     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U_upd.rcbuffer->pybuffer);
23832     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_pred.rcbuffer->pybuffer);
23833     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
23834     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH.rcbuffer->pybuffer);
23835     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer);
23836     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dK.rcbuffer->pybuffer);
23837     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
23838     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer);
23839     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
23840     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
23841     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer);
23842     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
23843     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
23844     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
23845     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer);
23846     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
23847     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
23848     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
23849     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
23850     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_measurement.rcbuffer->pybuffer);
23851     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer);
23852     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer);
23853     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer);
23854     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer);
23855     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp1.rcbuffer->pybuffer);
23856     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp2.rcbuffer->pybuffer);
23857     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp3.rcbuffer->pybuffer);
23858     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp5.rcbuffer->pybuffer);
23859     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
23860   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
23861   __Pyx_AddTraceback("GPy.models.state_space_cython._kalman_update_step_SVD_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
23862   __pyx_r = NULL;
23863   goto __pyx_L2;
23864   __pyx_L0:;
23865   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_H.rcbuffer->pybuffer);
23866   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_K.rcbuffer->pybuffer);
23867   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_pred.rcbuffer->pybuffer);
23868   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_upd.rcbuffer->pybuffer);
23869   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R.rcbuffer->pybuffer);
23870   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_R_isr.rcbuffer->pybuffer);
23871   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
23872   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_pred.rcbuffer->pybuffer);
23873   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_svd.rcbuffer->pybuffer);
23874   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S_upd.rcbuffer->pybuffer);
23875   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
23876   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U_upd.rcbuffer->pybuffer);
23877   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_V_pred.rcbuffer->pybuffer);
23878   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
23879   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH.rcbuffer->pybuffer);
23880   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dH_all_params.rcbuffer->pybuffer);
23881   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dK.rcbuffer->pybuffer);
23882   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
23883   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred_all_params.rcbuffer->pybuffer);
23884   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
23885   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR.rcbuffer->pybuffer);
23886   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dR_all_params.rcbuffer->pybuffer);
23887   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
23888   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
23889   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
23890   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred_all_params.rcbuffer->pybuffer);
23891   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
23892   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dv.rcbuffer->pybuffer);
23893   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
23894   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
23895   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_measurement.rcbuffer->pybuffer);
23896   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dP.rcbuffer->pybuffer);
23897   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_dm.rcbuffer->pybuffer);
23898   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_p_m.rcbuffer->pybuffer);
23899   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_svd_2_matr.rcbuffer->pybuffer);
23900   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp1.rcbuffer->pybuffer);
23901   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp2.rcbuffer->pybuffer);
23902   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp3.rcbuffer->pybuffer);
23903   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_tmp5.rcbuffer->pybuffer);
23904   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
23905   __pyx_L2:;
23906   __Pyx_XDECREF((PyObject *)__pyx_v_m_pred);
23907   __Pyx_XDECREF((PyObject *)__pyx_v_P_pred);
23908   __Pyx_XDECREF((PyObject *)__pyx_v_S_pred);
23909   __Pyx_XDECREF((PyObject *)__pyx_v_V_pred);
23910   __Pyx_XDECREF((PyObject *)__pyx_v_H);
23911   __Pyx_XDECREF((PyObject *)__pyx_v_R);
23912   __Pyx_XDECREF((PyObject *)__pyx_v_R_isr);
23913   __Pyx_XDECREF((PyObject *)__pyx_v_log_likelihood_update);
23914   __Pyx_XDECREF((PyObject *)__pyx_v_v);
23915   __Pyx_XDECREF((PyObject *)__pyx_v_svd_2_matr);
23916   __Pyx_XDECREF(__pyx_v_res);
23917   __Pyx_XDECREF((PyObject *)__pyx_v_U);
23918   __Pyx_XDECREF((PyObject *)__pyx_v_S_svd);
23919   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
23920   __Pyx_XDECREF((PyObject *)__pyx_v_U_upd);
23921   __Pyx_XDECREF((PyObject *)__pyx_v_S_upd);
23922   __Pyx_XDECREF((PyObject *)__pyx_v_P_upd);
23923   __Pyx_XDECREF((PyObject *)__pyx_v_S);
23924   __Pyx_XDECREF((PyObject *)__pyx_v_K);
23925   __Pyx_XDECREF((PyObject *)__pyx_v_dm_upd);
23926   __Pyx_XDECREF((PyObject *)__pyx_v_dP_upd);
23927   __Pyx_XDECREF((PyObject *)__pyx_v_d_log_likelihood_update);
23928   __Pyx_XDECREF((PyObject *)__pyx_v_dm_pred_all_params);
23929   __Pyx_XDECREF((PyObject *)__pyx_v_dP_pred_all_params);
23930   __Pyx_XDECREF((PyObject *)__pyx_v_dH_all_params);
23931   __Pyx_XDECREF((PyObject *)__pyx_v_dR_all_params);
23932   __Pyx_XDECREF((PyObject *)__pyx_v_dH);
23933   __Pyx_XDECREF((PyObject *)__pyx_v_dR);
23934   __Pyx_XDECREF((PyObject *)__pyx_v_dm_pred);
23935   __Pyx_XDECREF((PyObject *)__pyx_v_dP_pred);
23936   __Pyx_XDECREF((PyObject *)__pyx_v_dv);
23937   __Pyx_XDECREF((PyObject *)__pyx_v_dS);
23938   __Pyx_XDECREF((PyObject *)__pyx_v_tmp1);
23939   __Pyx_XDECREF((PyObject *)__pyx_v_tmp2);
23940   __Pyx_XDECREF((PyObject *)__pyx_v_tmp3);
23941   __Pyx_XDECREF((PyObject *)__pyx_v_dK);
23942   __Pyx_XDECREF((PyObject *)__pyx_v_tmp5);
23943   __Pyx_XDECREF(__pyx_v_ret);
23944   __Pyx_XDECREF(__pyx_v_m_upd);
23945   __Pyx_XGIVEREF(__pyx_r);
23946   __Pyx_RefNannyFinishContext();
23947   return __pyx_r;
23948 }
23949 
23950 /* "GPy/models/state_space_cython.pyx":912
23951  *
23952  * @cython.boundscheck(False)
23953  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,             # <<<<<<<<<<<<<<
23954  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
23955  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
23956  */
23957 
23958 /* Python wrapper */
23959 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
23960 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython = {"_cont_discr_kalman_filter_raw_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)23961 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
23962   int __pyx_v_state_dim;
23963   struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables = 0;
23964   struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables = 0;
23965   CYTHON_UNUSED PyObject *__pyx_v_X = 0;
23966   PyObject *__pyx_v_Y = 0;
23967   PyArrayObject *__pyx_v_m_init = 0;
23968   PyArrayObject *__pyx_v_P_init = 0;
23969   CYTHON_UNUSED PyObject *__pyx_v_p_kalman_filter_type = 0;
23970   int __pyx_v_calc_log_likelihood;
23971   int __pyx_v_calc_grad_log_likelihood;
23972   int __pyx_v_grad_params_no;
23973   PyArrayObject *__pyx_v_dm_init = 0;
23974   PyArrayObject *__pyx_v_dP_init = 0;
23975   int __pyx_lineno = 0;
23976   const char *__pyx_filename = NULL;
23977   int __pyx_clineno = 0;
23978   PyObject *__pyx_r = 0;
23979   __Pyx_RefNannyDeclarations
23980   __Pyx_RefNannySetupContext("_cont_discr_kalman_filter_raw_Cython (wrapper)", 0);
23981   {
23982     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_state_dim,&__pyx_n_s_p_dynamic_callables,&__pyx_n_s_p_measurement_callables,&__pyx_n_s_X,&__pyx_n_s_Y,&__pyx_n_s_m_init,&__pyx_n_s_P_init,&__pyx_n_s_p_kalman_filter_type,&__pyx_n_s_calc_log_likelihood,&__pyx_n_s_calc_grad_log_likelihood,&__pyx_n_s_grad_params_no,&__pyx_n_s_dm_init,&__pyx_n_s_dP_init,0};
23983     PyObject* values[13] = {0,0,0,0,0,0,0,0,0,0,0,0,0};
23984 
23985     /* "GPy/models/state_space_cython.pyx":914
23986  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,
23987  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
23988  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,             # <<<<<<<<<<<<<<
23989  *                                   p_kalman_filter_type='regular',
23990  *                                   bint calc_log_likelihood=False,
23991  */
23992     values[5] = (PyObject *)((PyArrayObject *)Py_None);
23993     values[6] = (PyObject *)((PyArrayObject *)Py_None);
23994     values[7] = ((PyObject *)__pyx_n_s_regular);
23995 
23996     /* "GPy/models/state_space_cython.pyx":919
23997  *                                   bint calc_grad_log_likelihood=False,
23998  *                                   int grad_params_no=0,
23999  *                                   np.ndarray[DTYPE_t, ndim=3] dm_init=None,             # <<<<<<<<<<<<<<
24000  *                                   np.ndarray[DTYPE_t, ndim=3] dP_init=None):
24001  *
24002  */
24003     values[11] = (PyObject *)((PyArrayObject *)Py_None);
24004 
24005     /* "GPy/models/state_space_cython.pyx":920
24006  *                                   int grad_params_no=0,
24007  *                                   np.ndarray[DTYPE_t, ndim=3] dm_init=None,
24008  *                                   np.ndarray[DTYPE_t, ndim=3] dP_init=None):             # <<<<<<<<<<<<<<
24009  *
24010  *     cdef int steps_no = Y.shape[0] # number of steps in the Kalman Filter
24011  */
24012     values[12] = (PyObject *)((PyArrayObject *)Py_None);
24013     if (unlikely(__pyx_kwds)) {
24014       Py_ssize_t kw_args;
24015       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
24016       switch (pos_args) {
24017         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
24018         CYTHON_FALLTHROUGH;
24019         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
24020         CYTHON_FALLTHROUGH;
24021         case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
24022         CYTHON_FALLTHROUGH;
24023         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
24024         CYTHON_FALLTHROUGH;
24025         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
24026         CYTHON_FALLTHROUGH;
24027         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
24028         CYTHON_FALLTHROUGH;
24029         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
24030         CYTHON_FALLTHROUGH;
24031         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
24032         CYTHON_FALLTHROUGH;
24033         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
24034         CYTHON_FALLTHROUGH;
24035         case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
24036         CYTHON_FALLTHROUGH;
24037         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24038         CYTHON_FALLTHROUGH;
24039         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24040         CYTHON_FALLTHROUGH;
24041         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24042         CYTHON_FALLTHROUGH;
24043         case  0: break;
24044         default: goto __pyx_L5_argtuple_error;
24045       }
24046       kw_args = PyDict_Size(__pyx_kwds);
24047       switch (pos_args) {
24048         case  0:
24049         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_state_dim)) != 0)) kw_args--;
24050         else goto __pyx_L5_argtuple_error;
24051         CYTHON_FALLTHROUGH;
24052         case  1:
24053         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_dynamic_callables)) != 0)) kw_args--;
24054         else {
24055           __Pyx_RaiseArgtupleInvalid("_cont_discr_kalman_filter_raw_Cython", 0, 5, 13, 1); __PYX_ERR(0, 912, __pyx_L3_error)
24056         }
24057         CYTHON_FALLTHROUGH;
24058         case  2:
24059         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_measurement_callables)) != 0)) kw_args--;
24060         else {
24061           __Pyx_RaiseArgtupleInvalid("_cont_discr_kalman_filter_raw_Cython", 0, 5, 13, 2); __PYX_ERR(0, 912, __pyx_L3_error)
24062         }
24063         CYTHON_FALLTHROUGH;
24064         case  3:
24065         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_X)) != 0)) kw_args--;
24066         else {
24067           __Pyx_RaiseArgtupleInvalid("_cont_discr_kalman_filter_raw_Cython", 0, 5, 13, 3); __PYX_ERR(0, 912, __pyx_L3_error)
24068         }
24069         CYTHON_FALLTHROUGH;
24070         case  4:
24071         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Y)) != 0)) kw_args--;
24072         else {
24073           __Pyx_RaiseArgtupleInvalid("_cont_discr_kalman_filter_raw_Cython", 0, 5, 13, 4); __PYX_ERR(0, 912, __pyx_L3_error)
24074         }
24075         CYTHON_FALLTHROUGH;
24076         case  5:
24077         if (kw_args > 0) {
24078           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_m_init);
24079           if (value) { values[5] = value; kw_args--; }
24080         }
24081         CYTHON_FALLTHROUGH;
24082         case  6:
24083         if (kw_args > 0) {
24084           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_P_init);
24085           if (value) { values[6] = value; kw_args--; }
24086         }
24087         CYTHON_FALLTHROUGH;
24088         case  7:
24089         if (kw_args > 0) {
24090           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_p_kalman_filter_type);
24091           if (value) { values[7] = value; kw_args--; }
24092         }
24093         CYTHON_FALLTHROUGH;
24094         case  8:
24095         if (kw_args > 0) {
24096           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calc_log_likelihood);
24097           if (value) { values[8] = value; kw_args--; }
24098         }
24099         CYTHON_FALLTHROUGH;
24100         case  9:
24101         if (kw_args > 0) {
24102           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_calc_grad_log_likelihood);
24103           if (value) { values[9] = value; kw_args--; }
24104         }
24105         CYTHON_FALLTHROUGH;
24106         case 10:
24107         if (kw_args > 0) {
24108           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_grad_params_no);
24109           if (value) { values[10] = value; kw_args--; }
24110         }
24111         CYTHON_FALLTHROUGH;
24112         case 11:
24113         if (kw_args > 0) {
24114           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dm_init);
24115           if (value) { values[11] = value; kw_args--; }
24116         }
24117         CYTHON_FALLTHROUGH;
24118         case 12:
24119         if (kw_args > 0) {
24120           PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dP_init);
24121           if (value) { values[12] = value; kw_args--; }
24122         }
24123       }
24124       if (unlikely(kw_args > 0)) {
24125         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_cont_discr_kalman_filter_raw_Cython") < 0)) __PYX_ERR(0, 912, __pyx_L3_error)
24126       }
24127     } else {
24128       switch (PyTuple_GET_SIZE(__pyx_args)) {
24129         case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
24130         CYTHON_FALLTHROUGH;
24131         case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
24132         CYTHON_FALLTHROUGH;
24133         case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
24134         CYTHON_FALLTHROUGH;
24135         case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
24136         CYTHON_FALLTHROUGH;
24137         case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
24138         CYTHON_FALLTHROUGH;
24139         case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
24140         CYTHON_FALLTHROUGH;
24141         case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
24142         CYTHON_FALLTHROUGH;
24143         case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
24144         CYTHON_FALLTHROUGH;
24145         case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
24146         values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
24147         values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
24148         values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
24149         values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
24150         break;
24151         default: goto __pyx_L5_argtuple_error;
24152       }
24153     }
24154     __pyx_v_state_dim = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_state_dim == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L3_error)
24155     __pyx_v_p_dynamic_callables = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)values[1]);
24156     __pyx_v_p_measurement_callables = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)values[2]);
24157     __pyx_v_X = values[3];
24158     __pyx_v_Y = values[4];
24159     __pyx_v_m_init = ((PyArrayObject *)values[5]);
24160     __pyx_v_P_init = ((PyArrayObject *)values[6]);
24161     __pyx_v_p_kalman_filter_type = values[7];
24162     if (values[8]) {
24163       __pyx_v_calc_log_likelihood = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_calc_log_likelihood == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 916, __pyx_L3_error)
24164     } else {
24165 
24166       /* "GPy/models/state_space_cython.pyx":916
24167  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
24168  *                                   p_kalman_filter_type='regular',
24169  *                                   bint calc_log_likelihood=False,             # <<<<<<<<<<<<<<
24170  *                                   bint calc_grad_log_likelihood=False,
24171  *                                   int grad_params_no=0,
24172  */
24173       __pyx_v_calc_log_likelihood = ((int)0);
24174     }
24175     if (values[9]) {
24176       __pyx_v_calc_grad_log_likelihood = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_calc_grad_log_likelihood == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 917, __pyx_L3_error)
24177     } else {
24178 
24179       /* "GPy/models/state_space_cython.pyx":917
24180  *                                   p_kalman_filter_type='regular',
24181  *                                   bint calc_log_likelihood=False,
24182  *                                   bint calc_grad_log_likelihood=False,             # <<<<<<<<<<<<<<
24183  *                                   int grad_params_no=0,
24184  *                                   np.ndarray[DTYPE_t, ndim=3] dm_init=None,
24185  */
24186       __pyx_v_calc_grad_log_likelihood = ((int)0);
24187     }
24188     if (values[10]) {
24189       __pyx_v_grad_params_no = __Pyx_PyInt_As_int(values[10]); if (unlikely((__pyx_v_grad_params_no == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 918, __pyx_L3_error)
24190     } else {
24191       __pyx_v_grad_params_no = ((int)0);
24192     }
24193     __pyx_v_dm_init = ((PyArrayObject *)values[11]);
24194     __pyx_v_dP_init = ((PyArrayObject *)values[12]);
24195   }
24196   goto __pyx_L4_argument_unpacking_done;
24197   __pyx_L5_argtuple_error:;
24198   __Pyx_RaiseArgtupleInvalid("_cont_discr_kalman_filter_raw_Cython", 0, 5, 13, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 912, __pyx_L3_error)
24199   __pyx_L3_error:;
24200   __Pyx_AddTraceback("GPy.models.state_space_cython._cont_discr_kalman_filter_raw_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
24201   __Pyx_RefNannyFinishContext();
24202   return NULL;
24203   __pyx_L4_argument_unpacking_done:;
24204   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_dynamic_callables), __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython, 1, "p_dynamic_callables", 0))) __PYX_ERR(0, 912, __pyx_L1_error)
24205   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p_measurement_callables), __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython, 1, "p_measurement_callables", 0))) __PYX_ERR(0, 913, __pyx_L1_error)
24206   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_m_init), __pyx_ptype_5numpy_ndarray, 1, "m_init", 0))) __PYX_ERR(0, 914, __pyx_L1_error)
24207   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_P_init), __pyx_ptype_5numpy_ndarray, 1, "P_init", 0))) __PYX_ERR(0, 914, __pyx_L1_error)
24208   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm_init), __pyx_ptype_5numpy_ndarray, 1, "dm_init", 0))) __PYX_ERR(0, 919, __pyx_L1_error)
24209   if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dP_init), __pyx_ptype_5numpy_ndarray, 1, "dP_init", 0))) __PYX_ERR(0, 920, __pyx_L1_error)
24210   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_4_cont_discr_kalman_filter_raw_Cython(__pyx_self, __pyx_v_state_dim, __pyx_v_p_dynamic_callables, __pyx_v_p_measurement_callables, __pyx_v_X, __pyx_v_Y, __pyx_v_m_init, __pyx_v_P_init, __pyx_v_p_kalman_filter_type, __pyx_v_calc_log_likelihood, __pyx_v_calc_grad_log_likelihood, __pyx_v_grad_params_no, __pyx_v_dm_init, __pyx_v_dP_init);
24211 
24212   /* "GPy/models/state_space_cython.pyx":912
24213  *
24214  * @cython.boundscheck(False)
24215  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,             # <<<<<<<<<<<<<<
24216  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
24217  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
24218  */
24219 
24220   /* function exit code */
24221   goto __pyx_L0;
24222   __pyx_L1_error:;
24223   __pyx_r = NULL;
24224   __pyx_L0:;
24225   __Pyx_RefNannyFinishContext();
24226   return __pyx_r;
24227 }
24228 
__pyx_pf_3GPy_6models_18state_space_cython_4_cont_discr_kalman_filter_raw_Cython(CYTHON_UNUSED PyObject * __pyx_self,int __pyx_v_state_dim,struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v_p_dynamic_callables,struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v_p_measurement_callables,CYTHON_UNUSED PyObject * __pyx_v_X,PyObject * __pyx_v_Y,PyArrayObject * __pyx_v_m_init,PyArrayObject * __pyx_v_P_init,CYTHON_UNUSED PyObject * __pyx_v_p_kalman_filter_type,int __pyx_v_calc_log_likelihood,int __pyx_v_calc_grad_log_likelihood,int __pyx_v_grad_params_no,PyArrayObject * __pyx_v_dm_init,PyArrayObject * __pyx_v_dP_init)24229 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_4_cont_discr_kalman_filter_raw_Cython(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_state_dim, struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v_p_dynamic_callables, struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v_p_measurement_callables, CYTHON_UNUSED PyObject *__pyx_v_X, PyObject *__pyx_v_Y, PyArrayObject *__pyx_v_m_init, PyArrayObject *__pyx_v_P_init, CYTHON_UNUSED PyObject *__pyx_v_p_kalman_filter_type, int __pyx_v_calc_log_likelihood, int __pyx_v_calc_grad_log_likelihood, int __pyx_v_grad_params_no, PyArrayObject *__pyx_v_dm_init, PyArrayObject *__pyx_v_dP_init) {
24230   int __pyx_v_steps_no;
24231   int __pyx_v_time_series_no;
24232   PyArrayObject *__pyx_v_M = 0;
24233   PyArrayObject *__pyx_v_P = 0;
24234   PyArrayObject *__pyx_v_U = 0;
24235   PyArrayObject *__pyx_v_S = 0;
24236   CYTHON_UNUSED PyArrayObject *__pyx_v_Vh = 0;
24237   PyObject *__pyx_v_P_upd = 0;
24238   PyArrayObject *__pyx_v_log_likelihood = 0;
24239   PyArrayObject *__pyx_v_grad_log_likelihood = 0;
24240   PyArrayObject *__pyx_v_dm_upd = 0;
24241   PyArrayObject *__pyx_v_dP_upd = 0;
24242   PyArrayObject *__pyx_v_prev_mean = 0;
24243   PyArrayObject *__pyx_v_k_measurment = 0;
24244   PyArrayObject *__pyx_v_m_pred = 0;
24245   PyArrayObject *__pyx_v_m_upd = 0;
24246   PyObject *__pyx_v_P_pred = 0;
24247   PyArrayObject *__pyx_v_dm_pred = 0;
24248   PyArrayObject *__pyx_v_dP_pred = 0;
24249   PyArrayObject *__pyx_v_log_likelihood_update = 0;
24250   PyArrayObject *__pyx_v_d_log_likelihood_update = 0;
24251   int __pyx_v_k;
24252   __Pyx_LocalBuf_ND __pyx_pybuffernd_M;
24253   __Pyx_Buffer __pyx_pybuffer_M;
24254   __Pyx_LocalBuf_ND __pyx_pybuffernd_P;
24255   __Pyx_Buffer __pyx_pybuffer_P;
24256   __Pyx_LocalBuf_ND __pyx_pybuffernd_P_init;
24257   __Pyx_Buffer __pyx_pybuffer_P_init;
24258   __Pyx_LocalBuf_ND __pyx_pybuffernd_S;
24259   __Pyx_Buffer __pyx_pybuffer_S;
24260   __Pyx_LocalBuf_ND __pyx_pybuffernd_U;
24261   __Pyx_Buffer __pyx_pybuffer_U;
24262   __Pyx_LocalBuf_ND __pyx_pybuffernd_Vh;
24263   __Pyx_Buffer __pyx_pybuffer_Vh;
24264   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_init;
24265   __Pyx_Buffer __pyx_pybuffer_dP_init;
24266   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_pred;
24267   __Pyx_Buffer __pyx_pybuffer_dP_pred;
24268   __Pyx_LocalBuf_ND __pyx_pybuffernd_dP_upd;
24269   __Pyx_Buffer __pyx_pybuffer_dP_upd;
24270   __Pyx_LocalBuf_ND __pyx_pybuffernd_d_log_likelihood_update;
24271   __Pyx_Buffer __pyx_pybuffer_d_log_likelihood_update;
24272   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_init;
24273   __Pyx_Buffer __pyx_pybuffer_dm_init;
24274   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_pred;
24275   __Pyx_Buffer __pyx_pybuffer_dm_pred;
24276   __Pyx_LocalBuf_ND __pyx_pybuffernd_dm_upd;
24277   __Pyx_Buffer __pyx_pybuffer_dm_upd;
24278   __Pyx_LocalBuf_ND __pyx_pybuffernd_grad_log_likelihood;
24279   __Pyx_Buffer __pyx_pybuffer_grad_log_likelihood;
24280   __Pyx_LocalBuf_ND __pyx_pybuffernd_k_measurment;
24281   __Pyx_Buffer __pyx_pybuffer_k_measurment;
24282   __Pyx_LocalBuf_ND __pyx_pybuffernd_log_likelihood;
24283   __Pyx_Buffer __pyx_pybuffer_log_likelihood;
24284   __Pyx_LocalBuf_ND __pyx_pybuffernd_log_likelihood_update;
24285   __Pyx_Buffer __pyx_pybuffer_log_likelihood_update;
24286   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_init;
24287   __Pyx_Buffer __pyx_pybuffer_m_init;
24288   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_pred;
24289   __Pyx_Buffer __pyx_pybuffer_m_pred;
24290   __Pyx_LocalBuf_ND __pyx_pybuffernd_m_upd;
24291   __Pyx_Buffer __pyx_pybuffer_m_upd;
24292   __Pyx_LocalBuf_ND __pyx_pybuffernd_prev_mean;
24293   __Pyx_Buffer __pyx_pybuffer_prev_mean;
24294   PyObject *__pyx_r = NULL;
24295   __Pyx_RefNannyDeclarations
24296   PyObject *__pyx_t_1 = NULL;
24297   PyObject *__pyx_t_2 = NULL;
24298   int __pyx_t_3;
24299   PyObject *__pyx_t_4 = NULL;
24300   PyObject *__pyx_t_5 = NULL;
24301   PyObject *__pyx_t_6 = NULL;
24302   PyArrayObject *__pyx_t_7 = NULL;
24303   PyObject *__pyx_t_8 = NULL;
24304   PyArrayObject *__pyx_t_9 = NULL;
24305   PyArrayObject *__pyx_t_10 = NULL;
24306   PyObject *__pyx_t_11 = NULL;
24307   PyObject *__pyx_t_12 = NULL;
24308   PyObject *__pyx_t_13 = NULL;
24309   PyObject *(*__pyx_t_14)(PyObject *);
24310   PyArrayObject *__pyx_t_15 = NULL;
24311   PyArrayObject *__pyx_t_16 = NULL;
24312   PyArrayObject *__pyx_t_17 = NULL;
24313   PyArrayObject *__pyx_t_18 = NULL;
24314   PyArrayObject *__pyx_t_19 = NULL;
24315   int __pyx_t_20;
24316   int __pyx_t_21;
24317   PyArrayObject *__pyx_t_22 = NULL;
24318   int __pyx_t_23;
24319   PyArrayObject *__pyx_t_24 = NULL;
24320   PyArrayObject *__pyx_t_25 = NULL;
24321   int __pyx_t_26;
24322   PyObject *__pyx_t_27 = NULL;
24323   PyObject *__pyx_t_28 = NULL;
24324   PyArrayObject *__pyx_t_29 = NULL;
24325   PyArrayObject *__pyx_t_30 = NULL;
24326   PyArrayObject *__pyx_t_31 = NULL;
24327   int __pyx_t_32;
24328   struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset __pyx_t_33;
24329   int __pyx_lineno = 0;
24330   const char *__pyx_filename = NULL;
24331   int __pyx_clineno = 0;
24332   __Pyx_RefNannySetupContext("_cont_discr_kalman_filter_raw_Cython", 0);
24333   __Pyx_INCREF((PyObject *)__pyx_v_P_init);
24334   __pyx_pybuffer_M.pybuffer.buf = NULL;
24335   __pyx_pybuffer_M.refcount = 0;
24336   __pyx_pybuffernd_M.data = NULL;
24337   __pyx_pybuffernd_M.rcbuffer = &__pyx_pybuffer_M;
24338   __pyx_pybuffer_P.pybuffer.buf = NULL;
24339   __pyx_pybuffer_P.refcount = 0;
24340   __pyx_pybuffernd_P.data = NULL;
24341   __pyx_pybuffernd_P.rcbuffer = &__pyx_pybuffer_P;
24342   __pyx_pybuffer_U.pybuffer.buf = NULL;
24343   __pyx_pybuffer_U.refcount = 0;
24344   __pyx_pybuffernd_U.data = NULL;
24345   __pyx_pybuffernd_U.rcbuffer = &__pyx_pybuffer_U;
24346   __pyx_pybuffer_S.pybuffer.buf = NULL;
24347   __pyx_pybuffer_S.refcount = 0;
24348   __pyx_pybuffernd_S.data = NULL;
24349   __pyx_pybuffernd_S.rcbuffer = &__pyx_pybuffer_S;
24350   __pyx_pybuffer_Vh.pybuffer.buf = NULL;
24351   __pyx_pybuffer_Vh.refcount = 0;
24352   __pyx_pybuffernd_Vh.data = NULL;
24353   __pyx_pybuffernd_Vh.rcbuffer = &__pyx_pybuffer_Vh;
24354   __pyx_pybuffer_log_likelihood.pybuffer.buf = NULL;
24355   __pyx_pybuffer_log_likelihood.refcount = 0;
24356   __pyx_pybuffernd_log_likelihood.data = NULL;
24357   __pyx_pybuffernd_log_likelihood.rcbuffer = &__pyx_pybuffer_log_likelihood;
24358   __pyx_pybuffer_grad_log_likelihood.pybuffer.buf = NULL;
24359   __pyx_pybuffer_grad_log_likelihood.refcount = 0;
24360   __pyx_pybuffernd_grad_log_likelihood.data = NULL;
24361   __pyx_pybuffernd_grad_log_likelihood.rcbuffer = &__pyx_pybuffer_grad_log_likelihood;
24362   __pyx_pybuffer_dm_upd.pybuffer.buf = NULL;
24363   __pyx_pybuffer_dm_upd.refcount = 0;
24364   __pyx_pybuffernd_dm_upd.data = NULL;
24365   __pyx_pybuffernd_dm_upd.rcbuffer = &__pyx_pybuffer_dm_upd;
24366   __pyx_pybuffer_dP_upd.pybuffer.buf = NULL;
24367   __pyx_pybuffer_dP_upd.refcount = 0;
24368   __pyx_pybuffernd_dP_upd.data = NULL;
24369   __pyx_pybuffernd_dP_upd.rcbuffer = &__pyx_pybuffer_dP_upd;
24370   __pyx_pybuffer_prev_mean.pybuffer.buf = NULL;
24371   __pyx_pybuffer_prev_mean.refcount = 0;
24372   __pyx_pybuffernd_prev_mean.data = NULL;
24373   __pyx_pybuffernd_prev_mean.rcbuffer = &__pyx_pybuffer_prev_mean;
24374   __pyx_pybuffer_k_measurment.pybuffer.buf = NULL;
24375   __pyx_pybuffer_k_measurment.refcount = 0;
24376   __pyx_pybuffernd_k_measurment.data = NULL;
24377   __pyx_pybuffernd_k_measurment.rcbuffer = &__pyx_pybuffer_k_measurment;
24378   __pyx_pybuffer_m_pred.pybuffer.buf = NULL;
24379   __pyx_pybuffer_m_pred.refcount = 0;
24380   __pyx_pybuffernd_m_pred.data = NULL;
24381   __pyx_pybuffernd_m_pred.rcbuffer = &__pyx_pybuffer_m_pred;
24382   __pyx_pybuffer_m_upd.pybuffer.buf = NULL;
24383   __pyx_pybuffer_m_upd.refcount = 0;
24384   __pyx_pybuffernd_m_upd.data = NULL;
24385   __pyx_pybuffernd_m_upd.rcbuffer = &__pyx_pybuffer_m_upd;
24386   __pyx_pybuffer_dm_pred.pybuffer.buf = NULL;
24387   __pyx_pybuffer_dm_pred.refcount = 0;
24388   __pyx_pybuffernd_dm_pred.data = NULL;
24389   __pyx_pybuffernd_dm_pred.rcbuffer = &__pyx_pybuffer_dm_pred;
24390   __pyx_pybuffer_dP_pred.pybuffer.buf = NULL;
24391   __pyx_pybuffer_dP_pred.refcount = 0;
24392   __pyx_pybuffernd_dP_pred.data = NULL;
24393   __pyx_pybuffernd_dP_pred.rcbuffer = &__pyx_pybuffer_dP_pred;
24394   __pyx_pybuffer_log_likelihood_update.pybuffer.buf = NULL;
24395   __pyx_pybuffer_log_likelihood_update.refcount = 0;
24396   __pyx_pybuffernd_log_likelihood_update.data = NULL;
24397   __pyx_pybuffernd_log_likelihood_update.rcbuffer = &__pyx_pybuffer_log_likelihood_update;
24398   __pyx_pybuffer_d_log_likelihood_update.pybuffer.buf = NULL;
24399   __pyx_pybuffer_d_log_likelihood_update.refcount = 0;
24400   __pyx_pybuffernd_d_log_likelihood_update.data = NULL;
24401   __pyx_pybuffernd_d_log_likelihood_update.rcbuffer = &__pyx_pybuffer_d_log_likelihood_update;
24402   __pyx_pybuffer_m_init.pybuffer.buf = NULL;
24403   __pyx_pybuffer_m_init.refcount = 0;
24404   __pyx_pybuffernd_m_init.data = NULL;
24405   __pyx_pybuffernd_m_init.rcbuffer = &__pyx_pybuffer_m_init;
24406   __pyx_pybuffer_P_init.pybuffer.buf = NULL;
24407   __pyx_pybuffer_P_init.refcount = 0;
24408   __pyx_pybuffernd_P_init.data = NULL;
24409   __pyx_pybuffernd_P_init.rcbuffer = &__pyx_pybuffer_P_init;
24410   __pyx_pybuffer_dm_init.pybuffer.buf = NULL;
24411   __pyx_pybuffer_dm_init.refcount = 0;
24412   __pyx_pybuffernd_dm_init.data = NULL;
24413   __pyx_pybuffernd_dm_init.rcbuffer = &__pyx_pybuffer_dm_init;
24414   __pyx_pybuffer_dP_init.pybuffer.buf = NULL;
24415   __pyx_pybuffer_dP_init.refcount = 0;
24416   __pyx_pybuffernd_dP_init.data = NULL;
24417   __pyx_pybuffernd_dP_init.rcbuffer = &__pyx_pybuffer_dP_init;
24418   {
24419     __Pyx_BufFmt_StackElem __pyx_stack[1];
24420     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_init.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_init, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 912, __pyx_L1_error)
24421   }
24422   __pyx_pybuffernd_m_init.diminfo[0].strides = __pyx_pybuffernd_m_init.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_init.diminfo[0].shape = __pyx_pybuffernd_m_init.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_init.diminfo[1].strides = __pyx_pybuffernd_m_init.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_init.diminfo[1].shape = __pyx_pybuffernd_m_init.rcbuffer->pybuffer.shape[1];
24423   {
24424     __Pyx_BufFmt_StackElem __pyx_stack[1];
24425     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_init, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) __PYX_ERR(0, 912, __pyx_L1_error)
24426   }
24427   __pyx_pybuffernd_P_init.diminfo[0].strides = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_init.diminfo[0].shape = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_init.diminfo[1].strides = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_init.diminfo[1].shape = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.shape[1];
24428   {
24429     __Pyx_BufFmt_StackElem __pyx_stack[1];
24430     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_init.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_init, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 912, __pyx_L1_error)
24431   }
24432   __pyx_pybuffernd_dm_init.diminfo[0].strides = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_init.diminfo[0].shape = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_init.diminfo[1].strides = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_init.diminfo[1].shape = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_init.diminfo[2].strides = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_init.diminfo[2].shape = __pyx_pybuffernd_dm_init.rcbuffer->pybuffer.shape[2];
24433   {
24434     __Pyx_BufFmt_StackElem __pyx_stack[1];
24435     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_init.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_init, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) __PYX_ERR(0, 912, __pyx_L1_error)
24436   }
24437   __pyx_pybuffernd_dP_init.diminfo[0].strides = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_init.diminfo[0].shape = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_init.diminfo[1].strides = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_init.diminfo[1].shape = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_init.diminfo[2].strides = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_init.diminfo[2].shape = __pyx_pybuffernd_dP_init.rcbuffer->pybuffer.shape[2];
24438 
24439   /* "GPy/models/state_space_cython.pyx":922
24440  *                                   np.ndarray[DTYPE_t, ndim=3] dP_init=None):
24441  *
24442  *     cdef int steps_no = Y.shape[0] # number of steps in the Kalman Filter             # <<<<<<<<<<<<<<
24443  *     cdef int time_series_no = Y.shape[2] # multiple time series mode
24444  *
24445  */
24446   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error)
24447   __Pyx_GOTREF(__pyx_t_1);
24448   __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error)
24449   __Pyx_GOTREF(__pyx_t_2);
24450   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24451   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L1_error)
24452   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24453   __pyx_v_steps_no = __pyx_t_3;
24454 
24455   /* "GPy/models/state_space_cython.pyx":923
24456  *
24457  *     cdef int steps_no = Y.shape[0] # number of steps in the Kalman Filter
24458  *     cdef int time_series_no = Y.shape[2] # multiple time series mode             # <<<<<<<<<<<<<<
24459  *
24460  *     # Allocate space for results
24461  */
24462   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Y, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error)
24463   __Pyx_GOTREF(__pyx_t_2);
24464   __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
24465   __Pyx_GOTREF(__pyx_t_1);
24466   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24467   __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 923, __pyx_L1_error)
24468   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24469   __pyx_v_time_series_no = __pyx_t_3;
24470 
24471   /* "GPy/models/state_space_cython.pyx":927
24472  *     # Allocate space for results
24473  *     # Mean estimations. Initial values will be included
24474  *     cdef np.ndarray[DTYPE_t, ndim=3] M = np.empty(((steps_no+1),state_dim,time_series_no), dtype=DTYPE)             # <<<<<<<<<<<<<<
24475  *     M[0,:,:] = m_init # Initialize mean values
24476  *     # Variance estimations. Initial values will be included
24477  */
24478   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
24479   __Pyx_GOTREF(__pyx_t_1);
24480   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
24481   __Pyx_GOTREF(__pyx_t_2);
24482   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24483   __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_steps_no + 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
24484   __Pyx_GOTREF(__pyx_t_1);
24485   __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_state_dim); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
24486   __Pyx_GOTREF(__pyx_t_4);
24487   __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
24488   __Pyx_GOTREF(__pyx_t_5);
24489   __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __pyx_L1_error)
24490   __Pyx_GOTREF(__pyx_t_6);
24491   __Pyx_GIVEREF(__pyx_t_1);
24492   PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
24493   __Pyx_GIVEREF(__pyx_t_4);
24494   PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
24495   __Pyx_GIVEREF(__pyx_t_5);
24496   PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_5);
24497   __pyx_t_1 = 0;
24498   __pyx_t_4 = 0;
24499   __pyx_t_5 = 0;
24500   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
24501   __Pyx_GOTREF(__pyx_t_5);
24502   __Pyx_GIVEREF(__pyx_t_6);
24503   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
24504   __pyx_t_6 = 0;
24505   __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 927, __pyx_L1_error)
24506   __Pyx_GOTREF(__pyx_t_6);
24507   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
24508   __Pyx_GOTREF(__pyx_t_4);
24509   if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
24510   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24511   __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 927, __pyx_L1_error)
24512   __Pyx_GOTREF(__pyx_t_4);
24513   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24514   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24515   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24516   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 927, __pyx_L1_error)
24517   __pyx_t_7 = ((PyArrayObject *)__pyx_t_4);
24518   {
24519     __Pyx_BufFmt_StackElem __pyx_stack[1];
24520     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_M.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
24521       __pyx_v_M = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_M.rcbuffer->pybuffer.buf = NULL;
24522       __PYX_ERR(0, 927, __pyx_L1_error)
24523     } else {__pyx_pybuffernd_M.diminfo[0].strides = __pyx_pybuffernd_M.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_M.diminfo[0].shape = __pyx_pybuffernd_M.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_M.diminfo[1].strides = __pyx_pybuffernd_M.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_M.diminfo[1].shape = __pyx_pybuffernd_M.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_M.diminfo[2].strides = __pyx_pybuffernd_M.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_M.diminfo[2].shape = __pyx_pybuffernd_M.rcbuffer->pybuffer.shape[2];
24524     }
24525   }
24526   __pyx_t_7 = 0;
24527   __pyx_v_M = ((PyArrayObject *)__pyx_t_4);
24528   __pyx_t_4 = 0;
24529 
24530   /* "GPy/models/state_space_cython.pyx":928
24531  *     # Mean estimations. Initial values will be included
24532  *     cdef np.ndarray[DTYPE_t, ndim=3] M = np.empty(((steps_no+1),state_dim,time_series_no), dtype=DTYPE)
24533  *     M[0,:,:] = m_init # Initialize mean values             # <<<<<<<<<<<<<<
24534  *     # Variance estimations. Initial values will be included
24535  *     cdef np.ndarray[DTYPE_t, ndim=3] P = np.empty(((steps_no+1),state_dim,state_dim))
24536  */
24537   if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_M), __pyx_tuple__17, ((PyObject *)__pyx_v_m_init)) < 0)) __PYX_ERR(0, 928, __pyx_L1_error)
24538 
24539   /* "GPy/models/state_space_cython.pyx":930
24540  *     M[0,:,:] = m_init # Initialize mean values
24541  *     # Variance estimations. Initial values will be included
24542  *     cdef np.ndarray[DTYPE_t, ndim=3] P = np.empty(((steps_no+1),state_dim,state_dim))             # <<<<<<<<<<<<<<
24543  *     P_init = 0.5*( P_init + P_init.T) # symmetrize initial covariance. In some ustable cases this is uiseful
24544  *     P[0,:,:] = P_init # Initialize initial covariance matrix
24545  */
24546   __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
24547   __Pyx_GOTREF(__pyx_t_6);
24548   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_empty); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 930, __pyx_L1_error)
24549   __Pyx_GOTREF(__pyx_t_5);
24550   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
24551   __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_steps_no + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
24552   __Pyx_GOTREF(__pyx_t_6);
24553   __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_state_dim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
24554   __Pyx_GOTREF(__pyx_t_2);
24555   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_state_dim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
24556   __Pyx_GOTREF(__pyx_t_1);
24557   __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 930, __pyx_L1_error)
24558   __Pyx_GOTREF(__pyx_t_8);
24559   __Pyx_GIVEREF(__pyx_t_6);
24560   PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
24561   __Pyx_GIVEREF(__pyx_t_2);
24562   PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2);
24563   __Pyx_GIVEREF(__pyx_t_1);
24564   PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
24565   __pyx_t_6 = 0;
24566   __pyx_t_2 = 0;
24567   __pyx_t_1 = 0;
24568   __pyx_t_1 = NULL;
24569   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
24570     __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
24571     if (likely(__pyx_t_1)) {
24572       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
24573       __Pyx_INCREF(__pyx_t_1);
24574       __Pyx_INCREF(function);
24575       __Pyx_DECREF_SET(__pyx_t_5, function);
24576     }
24577   }
24578   __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8);
24579   __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
24580   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24581   if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
24582   __Pyx_GOTREF(__pyx_t_4);
24583   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24584   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 930, __pyx_L1_error)
24585   __pyx_t_9 = ((PyArrayObject *)__pyx_t_4);
24586   {
24587     __Pyx_BufFmt_StackElem __pyx_stack[1];
24588     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
24589       __pyx_v_P = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_P.rcbuffer->pybuffer.buf = NULL;
24590       __PYX_ERR(0, 930, __pyx_L1_error)
24591     } else {__pyx_pybuffernd_P.diminfo[0].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P.diminfo[0].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P.diminfo[1].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P.diminfo[1].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_P.diminfo[2].strides = __pyx_pybuffernd_P.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_P.diminfo[2].shape = __pyx_pybuffernd_P.rcbuffer->pybuffer.shape[2];
24592     }
24593   }
24594   __pyx_t_9 = 0;
24595   __pyx_v_P = ((PyArrayObject *)__pyx_t_4);
24596   __pyx_t_4 = 0;
24597 
24598   /* "GPy/models/state_space_cython.pyx":931
24599  *     # Variance estimations. Initial values will be included
24600  *     cdef np.ndarray[DTYPE_t, ndim=3] P = np.empty(((steps_no+1),state_dim,state_dim))
24601  *     P_init = 0.5*( P_init + P_init.T) # symmetrize initial covariance. In some ustable cases this is uiseful             # <<<<<<<<<<<<<<
24602  *     P[0,:,:] = P_init # Initialize initial covariance matrix
24603  *
24604  */
24605   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_P_init), __pyx_n_s_T); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
24606   __Pyx_GOTREF(__pyx_t_4);
24607   __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_v_P_init), __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error)
24608   __Pyx_GOTREF(__pyx_t_5);
24609   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24610   __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
24611   __Pyx_GOTREF(__pyx_t_4);
24612   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24613   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 931, __pyx_L1_error)
24614   __pyx_t_10 = ((PyArrayObject *)__pyx_t_4);
24615   {
24616     __Pyx_BufFmt_StackElem __pyx_stack[1];
24617     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer);
24618     __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
24619     if (unlikely(__pyx_t_3 < 0)) {
24620       PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
24621       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer, (PyObject*)__pyx_v_P_init, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
24622         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
24623         __Pyx_RaiseBufferFallbackError();
24624       } else {
24625         PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
24626       }
24627       __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
24628     }
24629     __pyx_pybuffernd_P_init.diminfo[0].strides = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_P_init.diminfo[0].shape = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_P_init.diminfo[1].strides = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_P_init.diminfo[1].shape = __pyx_pybuffernd_P_init.rcbuffer->pybuffer.shape[1];
24630     if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 931, __pyx_L1_error)
24631   }
24632   __pyx_t_10 = 0;
24633   __Pyx_DECREF_SET(__pyx_v_P_init, ((PyArrayObject *)__pyx_t_4));
24634   __pyx_t_4 = 0;
24635 
24636   /* "GPy/models/state_space_cython.pyx":932
24637  *     cdef np.ndarray[DTYPE_t, ndim=3] P = np.empty(((steps_no+1),state_dim,state_dim))
24638  *     P_init = 0.5*( P_init + P_init.T) # symmetrize initial covariance. In some ustable cases this is uiseful
24639  *     P[0,:,:] = P_init # Initialize initial covariance matrix             # <<<<<<<<<<<<<<
24640  *
24641  *     cdef np.ndarray[DTYPE_t, ndim=2] U
24642  */
24643   if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_P), __pyx_tuple__17, ((PyObject *)__pyx_v_P_init)) < 0)) __PYX_ERR(0, 932, __pyx_L1_error)
24644 
24645   /* "GPy/models/state_space_cython.pyx":938
24646  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh
24647  *
24648  *     U,S,Vh = sp.linalg.svd( P_init,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
24649  *               overwrite_a=False,check_finite=True)
24650  *     S[ (S==0) ] = 1e-17 # allows to run algorithm for singular initial variance
24651  */
24652   __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 938, __pyx_L1_error)
24653   __Pyx_GOTREF(__pyx_t_4);
24654   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_linalg); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
24655   __Pyx_GOTREF(__pyx_t_5);
24656   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24657   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_svd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 938, __pyx_L1_error)
24658   __Pyx_GOTREF(__pyx_t_4);
24659   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24660   __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
24661   __Pyx_GOTREF(__pyx_t_5);
24662   __Pyx_INCREF(((PyObject *)__pyx_v_P_init));
24663   __Pyx_GIVEREF(((PyObject *)__pyx_v_P_init));
24664   PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_P_init));
24665   __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 938, __pyx_L1_error)
24666   __Pyx_GOTREF(__pyx_t_8);
24667   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_full_matrices, Py_False) < 0) __PYX_ERR(0, 938, __pyx_L1_error)
24668   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_compute_uv, Py_True) < 0) __PYX_ERR(0, 938, __pyx_L1_error)
24669 
24670   /* "GPy/models/state_space_cython.pyx":939
24671  *
24672  *     U,S,Vh = sp.linalg.svd( P_init,full_matrices=False, compute_uv=True,
24673  *               overwrite_a=False,check_finite=True)             # <<<<<<<<<<<<<<
24674  *     S[ (S==0) ] = 1e-17 # allows to run algorithm for singular initial variance
24675  *     cdef tuple P_upd = (P_init, S,U)
24676  */
24677   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_overwrite_a, Py_False) < 0) __PYX_ERR(0, 938, __pyx_L1_error)
24678   if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_check_finite, Py_True) < 0) __PYX_ERR(0, 938, __pyx_L1_error)
24679 
24680   /* "GPy/models/state_space_cython.pyx":938
24681  *     cdef np.ndarray[DTYPE_t, ndim=2] Vh
24682  *
24683  *     U,S,Vh = sp.linalg.svd( P_init,full_matrices=False, compute_uv=True,             # <<<<<<<<<<<<<<
24684  *               overwrite_a=False,check_finite=True)
24685  *     S[ (S==0) ] = 1e-17 # allows to run algorithm for singular initial variance
24686  */
24687   __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
24688   __Pyx_GOTREF(__pyx_t_1);
24689   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24690   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24691   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24692   if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
24693     PyObject* sequence = __pyx_t_1;
24694     Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
24695     if (unlikely(size != 3)) {
24696       if (size > 3) __Pyx_RaiseTooManyValuesError(3);
24697       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
24698       __PYX_ERR(0, 938, __pyx_L1_error)
24699     }
24700     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24701     if (likely(PyTuple_CheckExact(sequence))) {
24702       __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
24703       __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
24704       __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2);
24705     } else {
24706       __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
24707       __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
24708       __pyx_t_4 = PyList_GET_ITEM(sequence, 2);
24709     }
24710     __Pyx_INCREF(__pyx_t_8);
24711     __Pyx_INCREF(__pyx_t_5);
24712     __Pyx_INCREF(__pyx_t_4);
24713     #else
24714     __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 938, __pyx_L1_error)
24715     __Pyx_GOTREF(__pyx_t_8);
24716     __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 938, __pyx_L1_error)
24717     __Pyx_GOTREF(__pyx_t_5);
24718     __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 938, __pyx_L1_error)
24719     __Pyx_GOTREF(__pyx_t_4);
24720     #endif
24721     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24722   } else {
24723     Py_ssize_t index = -1;
24724     __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
24725     __Pyx_GOTREF(__pyx_t_2);
24726     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24727     __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
24728     index = 0; __pyx_t_8 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_8)) goto __pyx_L3_unpacking_failed;
24729     __Pyx_GOTREF(__pyx_t_8);
24730     index = 1; __pyx_t_5 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
24731     __Pyx_GOTREF(__pyx_t_5);
24732     index = 2; __pyx_t_4 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
24733     __Pyx_GOTREF(__pyx_t_4);
24734     if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_2), 3) < 0) __PYX_ERR(0, 938, __pyx_L1_error)
24735     __pyx_t_14 = NULL;
24736     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24737     goto __pyx_L4_unpacking_done;
24738     __pyx_L3_unpacking_failed:;
24739     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
24740     __pyx_t_14 = NULL;
24741     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
24742     __PYX_ERR(0, 938, __pyx_L1_error)
24743     __pyx_L4_unpacking_done:;
24744   }
24745   if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 938, __pyx_L1_error)
24746   if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 938, __pyx_L1_error)
24747   if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 938, __pyx_L1_error)
24748   __pyx_t_15 = ((PyArrayObject *)__pyx_t_8);
24749   {
24750     __Pyx_BufFmt_StackElem __pyx_stack[1];
24751     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
24752     __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_t_15, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
24753     if (unlikely(__pyx_t_3 < 0)) {
24754       PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
24755       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_U.rcbuffer->pybuffer, (PyObject*)__pyx_v_U, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
24756         Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
24757         __Pyx_RaiseBufferFallbackError();
24758       } else {
24759         PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
24760       }
24761       __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
24762     }
24763     __pyx_pybuffernd_U.diminfo[0].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_U.diminfo[0].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_U.diminfo[1].strides = __pyx_pybuffernd_U.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_U.diminfo[1].shape = __pyx_pybuffernd_U.rcbuffer->pybuffer.shape[1];
24764     if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 938, __pyx_L1_error)
24765   }
24766   __pyx_t_15 = 0;
24767   __pyx_v_U = ((PyArrayObject *)__pyx_t_8);
24768   __pyx_t_8 = 0;
24769   __pyx_t_16 = ((PyArrayObject *)__pyx_t_5);
24770   {
24771     __Pyx_BufFmt_StackElem __pyx_stack[1];
24772     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
24773     __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_t_16, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack);
24774     if (unlikely(__pyx_t_3 < 0)) {
24775       PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
24776       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_S.rcbuffer->pybuffer, (PyObject*)__pyx_v_S, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
24777         Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
24778         __Pyx_RaiseBufferFallbackError();
24779       } else {
24780         PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
24781       }
24782       __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
24783     }
24784     __pyx_pybuffernd_S.diminfo[0].strides = __pyx_pybuffernd_S.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_S.diminfo[0].shape = __pyx_pybuffernd_S.rcbuffer->pybuffer.shape[0];
24785     if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 938, __pyx_L1_error)
24786   }
24787   __pyx_t_16 = 0;
24788   __pyx_v_S = ((PyArrayObject *)__pyx_t_5);
24789   __pyx_t_5 = 0;
24790   __pyx_t_17 = ((PyArrayObject *)__pyx_t_4);
24791   {
24792     __Pyx_BufFmt_StackElem __pyx_stack[1];
24793     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
24794     __pyx_t_3 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_t_17, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
24795     if (unlikely(__pyx_t_3 < 0)) {
24796       PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
24797       if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer, (PyObject*)__pyx_v_Vh, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
24798         Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
24799         __Pyx_RaiseBufferFallbackError();
24800       } else {
24801         PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
24802       }
24803       __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
24804     }
24805     __pyx_pybuffernd_Vh.diminfo[0].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_Vh.diminfo[0].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_Vh.diminfo[1].strides = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_Vh.diminfo[1].shape = __pyx_pybuffernd_Vh.rcbuffer->pybuffer.shape[1];
24806     if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 938, __pyx_L1_error)
24807   }
24808   __pyx_t_17 = 0;
24809   __pyx_v_Vh = ((PyArrayObject *)__pyx_t_4);
24810   __pyx_t_4 = 0;
24811 
24812   /* "GPy/models/state_space_cython.pyx":940
24813  *     U,S,Vh = sp.linalg.svd( P_init,full_matrices=False, compute_uv=True,
24814  *               overwrite_a=False,check_finite=True)
24815  *     S[ (S==0) ] = 1e-17 # allows to run algorithm for singular initial variance             # <<<<<<<<<<<<<<
24816  *     cdef tuple P_upd = (P_init, S,U)
24817  *     #log_likelihood = 0
24818  */
24819   __pyx_t_1 = PyObject_RichCompare(((PyObject *)__pyx_v_S), __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error)
24820   if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_S), __pyx_t_1, __pyx_float_1eneg_17) < 0)) __PYX_ERR(0, 940, __pyx_L1_error)
24821   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24822 
24823   /* "GPy/models/state_space_cython.pyx":941
24824  *               overwrite_a=False,check_finite=True)
24825  *     S[ (S==0) ] = 1e-17 # allows to run algorithm for singular initial variance
24826  *     cdef tuple P_upd = (P_init, S,U)             # <<<<<<<<<<<<<<
24827  *     #log_likelihood = 0
24828  *     #grad_log_likelihood = np.zeros((grad_params_no,1))
24829  */
24830   __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
24831   __Pyx_GOTREF(__pyx_t_1);
24832   __Pyx_INCREF(((PyObject *)__pyx_v_P_init));
24833   __Pyx_GIVEREF(((PyObject *)__pyx_v_P_init));
24834   PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_P_init));
24835   __Pyx_INCREF(((PyObject *)__pyx_v_S));
24836   __Pyx_GIVEREF(((PyObject *)__pyx_v_S));
24837   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_S));
24838   __Pyx_INCREF(((PyObject *)__pyx_v_U));
24839   __Pyx_GIVEREF(((PyObject *)__pyx_v_U));
24840   PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_U));
24841   __pyx_v_P_upd = ((PyObject*)__pyx_t_1);
24842   __pyx_t_1 = 0;
24843 
24844   /* "GPy/models/state_space_cython.pyx":944
24845  *     #log_likelihood = 0
24846  *     #grad_log_likelihood = np.zeros((grad_params_no,1))
24847  *     cdef np.ndarray[DTYPE_t, ndim=2] log_likelihood = np.zeros((1, time_series_no), dtype = DTYPE) #if calc_log_likelihood else None             # <<<<<<<<<<<<<<
24848  *     cdef np.ndarray[DTYPE_t, ndim=2] grad_log_likelihood = np.zeros((grad_params_no, time_series_no), dtype = DTYPE) #if calc_grad_log_likelihood else None
24849  *
24850  */
24851   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
24852   __Pyx_GOTREF(__pyx_t_1);
24853   __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 944, __pyx_L1_error)
24854   __Pyx_GOTREF(__pyx_t_4);
24855   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24856   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
24857   __Pyx_GOTREF(__pyx_t_1);
24858   __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
24859   __Pyx_GOTREF(__pyx_t_5);
24860   __Pyx_INCREF(__pyx_int_1);
24861   __Pyx_GIVEREF(__pyx_int_1);
24862   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
24863   __Pyx_GIVEREF(__pyx_t_1);
24864   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
24865   __pyx_t_1 = 0;
24866   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
24867   __Pyx_GOTREF(__pyx_t_1);
24868   __Pyx_GIVEREF(__pyx_t_5);
24869   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
24870   __pyx_t_5 = 0;
24871   __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 944, __pyx_L1_error)
24872   __Pyx_GOTREF(__pyx_t_5);
24873   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 944, __pyx_L1_error)
24874   __Pyx_GOTREF(__pyx_t_8);
24875   if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 944, __pyx_L1_error)
24876   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24877   __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 944, __pyx_L1_error)
24878   __Pyx_GOTREF(__pyx_t_8);
24879   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24880   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24881   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24882   if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 944, __pyx_L1_error)
24883   __pyx_t_18 = ((PyArrayObject *)__pyx_t_8);
24884   {
24885     __Pyx_BufFmt_StackElem __pyx_stack[1];
24886     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
24887       __pyx_v_log_likelihood = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.buf = NULL;
24888       __PYX_ERR(0, 944, __pyx_L1_error)
24889     } else {__pyx_pybuffernd_log_likelihood.diminfo[0].strides = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood.diminfo[0].shape = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood.diminfo[1].strides = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood.diminfo[1].shape = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.shape[1];
24890     }
24891   }
24892   __pyx_t_18 = 0;
24893   __pyx_v_log_likelihood = ((PyArrayObject *)__pyx_t_8);
24894   __pyx_t_8 = 0;
24895 
24896   /* "GPy/models/state_space_cython.pyx":945
24897  *     #grad_log_likelihood = np.zeros((grad_params_no,1))
24898  *     cdef np.ndarray[DTYPE_t, ndim=2] log_likelihood = np.zeros((1, time_series_no), dtype = DTYPE) #if calc_log_likelihood else None
24899  *     cdef np.ndarray[DTYPE_t, ndim=2] grad_log_likelihood = np.zeros((grad_params_no, time_series_no), dtype = DTYPE) #if calc_grad_log_likelihood else None             # <<<<<<<<<<<<<<
24900  *
24901  *     #setting initial values for derivatives update
24902  */
24903   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 945, __pyx_L1_error)
24904   __Pyx_GOTREF(__pyx_t_8);
24905   __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
24906   __Pyx_GOTREF(__pyx_t_5);
24907   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24908   __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_grad_params_no); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 945, __pyx_L1_error)
24909   __Pyx_GOTREF(__pyx_t_8);
24910   __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error)
24911   __Pyx_GOTREF(__pyx_t_1);
24912   __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L1_error)
24913   __Pyx_GOTREF(__pyx_t_4);
24914   __Pyx_GIVEREF(__pyx_t_8);
24915   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
24916   __Pyx_GIVEREF(__pyx_t_1);
24917   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
24918   __pyx_t_8 = 0;
24919   __pyx_t_1 = 0;
24920   __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error)
24921   __Pyx_GOTREF(__pyx_t_1);
24922   __Pyx_GIVEREF(__pyx_t_4);
24923   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
24924   __pyx_t_4 = 0;
24925   __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L1_error)
24926   __Pyx_GOTREF(__pyx_t_4);
24927   __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_DTYPE); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 945, __pyx_L1_error)
24928   __Pyx_GOTREF(__pyx_t_8);
24929   if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_8) < 0) __PYX_ERR(0, 945, __pyx_L1_error)
24930   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
24931   __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 945, __pyx_L1_error)
24932   __Pyx_GOTREF(__pyx_t_8);
24933   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
24934   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24935   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
24936   if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 945, __pyx_L1_error)
24937   __pyx_t_19 = ((PyArrayObject *)__pyx_t_8);
24938   {
24939     __Pyx_BufFmt_StackElem __pyx_stack[1];
24940     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
24941       __pyx_v_grad_log_likelihood = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.buf = NULL;
24942       __PYX_ERR(0, 945, __pyx_L1_error)
24943     } else {__pyx_pybuffernd_grad_log_likelihood.diminfo[0].strides = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_log_likelihood.diminfo[0].shape = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_log_likelihood.diminfo[1].strides = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_log_likelihood.diminfo[1].shape = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.shape[1];
24944     }
24945   }
24946   __pyx_t_19 = 0;
24947   __pyx_v_grad_log_likelihood = ((PyArrayObject *)__pyx_t_8);
24948   __pyx_t_8 = 0;
24949 
24950   /* "GPy/models/state_space_cython.pyx":948
24951  *
24952  *     #setting initial values for derivatives update
24953  *     cdef np.ndarray[DTYPE_t, ndim=3] dm_upd = dm_init             # <<<<<<<<<<<<<<
24954  *     cdef np.ndarray[DTYPE_t, ndim=3] dP_upd = dP_init
24955  *     # Main loop of the Kalman filter
24956  */
24957   {
24958     __Pyx_BufFmt_StackElem __pyx_stack[1];
24959     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_dm_init), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
24960       __pyx_v_dm_upd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.buf = NULL;
24961       __PYX_ERR(0, 948, __pyx_L1_error)
24962     } else {__pyx_pybuffernd_dm_upd.diminfo[0].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_upd.diminfo[0].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_upd.diminfo[1].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_upd.diminfo[1].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_upd.diminfo[2].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_upd.diminfo[2].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[2];
24963     }
24964   }
24965   __Pyx_INCREF(((PyObject *)__pyx_v_dm_init));
24966   __pyx_v_dm_upd = ((PyArrayObject *)__pyx_v_dm_init);
24967 
24968   /* "GPy/models/state_space_cython.pyx":949
24969  *     #setting initial values for derivatives update
24970  *     cdef np.ndarray[DTYPE_t, ndim=3] dm_upd = dm_init
24971  *     cdef np.ndarray[DTYPE_t, ndim=3] dP_upd = dP_init             # <<<<<<<<<<<<<<
24972  *     # Main loop of the Kalman filter
24973  *     cdef np.ndarray[DTYPE_t, ndim=2] prev_mean, k_measurment
24974  */
24975   {
24976     __Pyx_BufFmt_StackElem __pyx_stack[1];
24977     if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_dP_init), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
24978       __pyx_v_dP_upd = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.buf = NULL;
24979       __PYX_ERR(0, 949, __pyx_L1_error)
24980     } else {__pyx_pybuffernd_dP_upd.diminfo[0].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_upd.diminfo[0].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_upd.diminfo[1].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_upd.diminfo[1].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_upd.diminfo[2].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_upd.diminfo[2].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[2];
24981     }
24982   }
24983   __Pyx_INCREF(((PyObject *)__pyx_v_dP_init));
24984   __pyx_v_dP_upd = ((PyArrayObject *)__pyx_v_dP_init);
24985 
24986   /* "GPy/models/state_space_cython.pyx":959
24987  *
24988  *     #print "Hi I am cython"
24989  *     for k in range(0,steps_no):             # <<<<<<<<<<<<<<
24990  *         # In this loop index for new estimations is (k+1), old - (k)
24991  *         # This happened because initial values are stored at 0-th index.
24992  */
24993   __pyx_t_3 = __pyx_v_steps_no;
24994   __pyx_t_20 = __pyx_t_3;
24995   for (__pyx_t_21 = 0; __pyx_t_21 < __pyx_t_20; __pyx_t_21+=1) {
24996     __pyx_v_k = __pyx_t_21;
24997 
24998     /* "GPy/models/state_space_cython.pyx":964
24999  *         #import pdb; pdb.set_trace()
25000  *
25001  *         prev_mean = M[k,:,:] # mean from the previous step             # <<<<<<<<<<<<<<
25002  *
25003  *         m_pred, P_pred, dm_pred, dP_pred = \
25004  */
25005     __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 964, __pyx_L1_error)
25006     __Pyx_GOTREF(__pyx_t_8);
25007     __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error)
25008     __Pyx_GOTREF(__pyx_t_4);
25009     __Pyx_GIVEREF(__pyx_t_8);
25010     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
25011     __Pyx_INCREF(__pyx_slice__10);
25012     __Pyx_GIVEREF(__pyx_slice__10);
25013     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice__10);
25014     __Pyx_INCREF(__pyx_slice__10);
25015     __Pyx_GIVEREF(__pyx_slice__10);
25016     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_slice__10);
25017     __pyx_t_8 = 0;
25018     __pyx_t_8 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_M), __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 964, __pyx_L1_error)
25019     __Pyx_GOTREF(__pyx_t_8);
25020     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25021     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 964, __pyx_L1_error)
25022     __pyx_t_22 = ((PyArrayObject *)__pyx_t_8);
25023     {
25024       __Pyx_BufFmt_StackElem __pyx_stack[1];
25025       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prev_mean.rcbuffer->pybuffer);
25026       __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prev_mean.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25027       if (unlikely(__pyx_t_23 < 0)) {
25028         PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25029         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_prev_mean.rcbuffer->pybuffer, (PyObject*)__pyx_v_prev_mean, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25030           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25031           __Pyx_RaiseBufferFallbackError();
25032         } else {
25033           PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25034         }
25035         __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25036       }
25037       __pyx_pybuffernd_prev_mean.diminfo[0].strides = __pyx_pybuffernd_prev_mean.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_prev_mean.diminfo[0].shape = __pyx_pybuffernd_prev_mean.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_prev_mean.diminfo[1].strides = __pyx_pybuffernd_prev_mean.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_prev_mean.diminfo[1].shape = __pyx_pybuffernd_prev_mean.rcbuffer->pybuffer.shape[1];
25038       if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 964, __pyx_L1_error)
25039     }
25040     __pyx_t_22 = 0;
25041     __Pyx_XDECREF_SET(__pyx_v_prev_mean, ((PyArrayObject *)__pyx_t_8));
25042     __pyx_t_8 = 0;
25043 
25044     /* "GPy/models/state_space_cython.pyx":967
25045  *
25046  *         m_pred, P_pred, dm_pred, dP_pred = \
25047  *         _kalman_prediction_step_SVD_Cython(k, prev_mean ,P_upd, p_dynamic_callables,             # <<<<<<<<<<<<<<
25048  *             calc_grad_log_likelihood, dm_upd, dP_upd)
25049  *
25050  */
25051     __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_kalman_prediction_step_SVD_Cyth); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error)
25052     __Pyx_GOTREF(__pyx_t_4);
25053     __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
25054     __Pyx_GOTREF(__pyx_t_1);
25055 
25056     /* "GPy/models/state_space_cython.pyx":968
25057  *         m_pred, P_pred, dm_pred, dP_pred = \
25058  *         _kalman_prediction_step_SVD_Cython(k, prev_mean ,P_upd, p_dynamic_callables,
25059  *             calc_grad_log_likelihood, dm_upd, dP_upd)             # <<<<<<<<<<<<<<
25060  *
25061  *         k_measurment = Y[k,:,:]
25062  */
25063     __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_calc_grad_log_likelihood); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 968, __pyx_L1_error)
25064     __Pyx_GOTREF(__pyx_t_5);
25065     __pyx_t_2 = NULL;
25066     __pyx_t_23 = 0;
25067     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
25068       __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
25069       if (likely(__pyx_t_2)) {
25070         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25071         __Pyx_INCREF(__pyx_t_2);
25072         __Pyx_INCREF(function);
25073         __Pyx_DECREF_SET(__pyx_t_4, function);
25074         __pyx_t_23 = 1;
25075       }
25076     }
25077     #if CYTHON_FAST_PYCALL
25078     if (PyFunction_Check(__pyx_t_4)) {
25079       PyObject *__pyx_temp[8] = {__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_v_prev_mean), __pyx_v_P_upd, ((PyObject *)__pyx_v_p_dynamic_callables), __pyx_t_5, ((PyObject *)__pyx_v_dm_upd), ((PyObject *)__pyx_v_dP_upd)};
25080       __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_23, 7+__pyx_t_23); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
25081       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25082       __Pyx_GOTREF(__pyx_t_8);
25083       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25084       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25085     } else
25086     #endif
25087     #if CYTHON_FAST_PYCCALL
25088     if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
25089       PyObject *__pyx_temp[8] = {__pyx_t_2, __pyx_t_1, ((PyObject *)__pyx_v_prev_mean), __pyx_v_P_upd, ((PyObject *)__pyx_v_p_dynamic_callables), __pyx_t_5, ((PyObject *)__pyx_v_dm_upd), ((PyObject *)__pyx_v_dP_upd)};
25090       __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_23, 7+__pyx_t_23); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
25091       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25092       __Pyx_GOTREF(__pyx_t_8);
25093       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25094       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25095     } else
25096     #endif
25097     {
25098       __pyx_t_6 = PyTuple_New(7+__pyx_t_23); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
25099       __Pyx_GOTREF(__pyx_t_6);
25100       if (__pyx_t_2) {
25101         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
25102       }
25103       __Pyx_GIVEREF(__pyx_t_1);
25104       PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_23, __pyx_t_1);
25105       __Pyx_INCREF(((PyObject *)__pyx_v_prev_mean));
25106       __Pyx_GIVEREF(((PyObject *)__pyx_v_prev_mean));
25107       PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_23, ((PyObject *)__pyx_v_prev_mean));
25108       __Pyx_INCREF(__pyx_v_P_upd);
25109       __Pyx_GIVEREF(__pyx_v_P_upd);
25110       PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_23, __pyx_v_P_upd);
25111       __Pyx_INCREF(((PyObject *)__pyx_v_p_dynamic_callables));
25112       __Pyx_GIVEREF(((PyObject *)__pyx_v_p_dynamic_callables));
25113       PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_23, ((PyObject *)__pyx_v_p_dynamic_callables));
25114       __Pyx_GIVEREF(__pyx_t_5);
25115       PyTuple_SET_ITEM(__pyx_t_6, 4+__pyx_t_23, __pyx_t_5);
25116       __Pyx_INCREF(((PyObject *)__pyx_v_dm_upd));
25117       __Pyx_GIVEREF(((PyObject *)__pyx_v_dm_upd));
25118       PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_23, ((PyObject *)__pyx_v_dm_upd));
25119       __Pyx_INCREF(((PyObject *)__pyx_v_dP_upd));
25120       __Pyx_GIVEREF(((PyObject *)__pyx_v_dP_upd));
25121       PyTuple_SET_ITEM(__pyx_t_6, 6+__pyx_t_23, ((PyObject *)__pyx_v_dP_upd));
25122       __pyx_t_1 = 0;
25123       __pyx_t_5 = 0;
25124       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 967, __pyx_L1_error)
25125       __Pyx_GOTREF(__pyx_t_8);
25126       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25127     }
25128     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25129     if ((likely(PyTuple_CheckExact(__pyx_t_8))) || (PyList_CheckExact(__pyx_t_8))) {
25130       PyObject* sequence = __pyx_t_8;
25131       Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
25132       if (unlikely(size != 4)) {
25133         if (size > 4) __Pyx_RaiseTooManyValuesError(4);
25134         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
25135         __PYX_ERR(0, 966, __pyx_L1_error)
25136       }
25137       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25138       if (likely(PyTuple_CheckExact(sequence))) {
25139         __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
25140         __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
25141         __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
25142         __pyx_t_1 = PyTuple_GET_ITEM(sequence, 3);
25143       } else {
25144         __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
25145         __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
25146         __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
25147         __pyx_t_1 = PyList_GET_ITEM(sequence, 3);
25148       }
25149       __Pyx_INCREF(__pyx_t_4);
25150       __Pyx_INCREF(__pyx_t_6);
25151       __Pyx_INCREF(__pyx_t_5);
25152       __Pyx_INCREF(__pyx_t_1);
25153       #else
25154       {
25155         Py_ssize_t i;
25156         PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_1};
25157         for (i=0; i < 4; i++) {
25158           PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 966, __pyx_L1_error)
25159           __Pyx_GOTREF(item);
25160           *(temps[i]) = item;
25161         }
25162       }
25163       #endif
25164       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25165     } else {
25166       Py_ssize_t index = -1;
25167       PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_6,&__pyx_t_5,&__pyx_t_1};
25168       __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
25169       __Pyx_GOTREF(__pyx_t_2);
25170       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25171       __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext;
25172       for (index=0; index < 4; index++) {
25173         PyObject* item = __pyx_t_14(__pyx_t_2); if (unlikely(!item)) goto __pyx_L7_unpacking_failed;
25174         __Pyx_GOTREF(item);
25175         *(temps[index]) = item;
25176       }
25177       if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_2), 4) < 0) __PYX_ERR(0, 966, __pyx_L1_error)
25178       __pyx_t_14 = NULL;
25179       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25180       goto __pyx_L8_unpacking_done;
25181       __pyx_L7_unpacking_failed:;
25182       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25183       __pyx_t_14 = NULL;
25184       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
25185       __PYX_ERR(0, 966, __pyx_L1_error)
25186       __pyx_L8_unpacking_done:;
25187     }
25188 
25189     /* "GPy/models/state_space_cython.pyx":966
25190  *         prev_mean = M[k,:,:] # mean from the previous step
25191  *
25192  *         m_pred, P_pred, dm_pred, dP_pred = \             # <<<<<<<<<<<<<<
25193  *         _kalman_prediction_step_SVD_Cython(k, prev_mean ,P_upd, p_dynamic_callables,
25194  *             calc_grad_log_likelihood, dm_upd, dP_upd)
25195  */
25196     if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 966, __pyx_L1_error)
25197     if (!(likely(PyTuple_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(0, 966, __pyx_L1_error)
25198     if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 966, __pyx_L1_error)
25199     if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 966, __pyx_L1_error)
25200     __pyx_t_24 = ((PyArrayObject *)__pyx_t_4);
25201     {
25202       __Pyx_BufFmt_StackElem __pyx_stack[1];
25203       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
25204       __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25205       if (unlikely(__pyx_t_23 < 0)) {
25206         PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25207         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25208           Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25209           __Pyx_RaiseBufferFallbackError();
25210         } else {
25211           PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25212         }
25213         __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25214       }
25215       __pyx_pybuffernd_m_pred.diminfo[0].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_pred.diminfo[0].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_pred.diminfo[1].strides = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_pred.diminfo[1].shape = __pyx_pybuffernd_m_pred.rcbuffer->pybuffer.shape[1];
25216       if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 966, __pyx_L1_error)
25217     }
25218     __pyx_t_24 = 0;
25219     __Pyx_XDECREF_SET(__pyx_v_m_pred, ((PyArrayObject *)__pyx_t_4));
25220     __pyx_t_4 = 0;
25221     __Pyx_XDECREF_SET(__pyx_v_P_pred, ((PyObject*)__pyx_t_6));
25222     __pyx_t_6 = 0;
25223     __pyx_t_25 = ((PyArrayObject *)__pyx_t_5);
25224     {
25225       __Pyx_BufFmt_StackElem __pyx_stack[1];
25226       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
25227       __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25228       if (unlikely(__pyx_t_23 < 0)) {
25229         PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25230         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25231           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25232           __Pyx_RaiseBufferFallbackError();
25233         } else {
25234           PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25235         }
25236         __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25237       }
25238       __pyx_pybuffernd_dm_pred.diminfo[0].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_pred.diminfo[0].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_pred.diminfo[1].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_pred.diminfo[1].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_pred.diminfo[2].strides = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_pred.diminfo[2].shape = __pyx_pybuffernd_dm_pred.rcbuffer->pybuffer.shape[2];
25239       if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 966, __pyx_L1_error)
25240     }
25241     __pyx_t_25 = 0;
25242     __Pyx_XDECREF_SET(__pyx_v_dm_pred, ((PyArrayObject *)__pyx_t_5));
25243     __pyx_t_5 = 0;
25244     __pyx_t_25 = ((PyArrayObject *)__pyx_t_1);
25245     {
25246       __Pyx_BufFmt_StackElem __pyx_stack[1];
25247       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
25248       __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_t_25, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25249       if (unlikely(__pyx_t_23 < 0)) {
25250         PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25251         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25252           Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25253           __Pyx_RaiseBufferFallbackError();
25254         } else {
25255           PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25256         }
25257         __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25258       }
25259       __pyx_pybuffernd_dP_pred.diminfo[0].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_pred.diminfo[0].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_pred.diminfo[1].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_pred.diminfo[1].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_pred.diminfo[2].strides = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_pred.diminfo[2].shape = __pyx_pybuffernd_dP_pred.rcbuffer->pybuffer.shape[2];
25260       if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 966, __pyx_L1_error)
25261     }
25262     __pyx_t_25 = 0;
25263     __Pyx_XDECREF_SET(__pyx_v_dP_pred, ((PyArrayObject *)__pyx_t_1));
25264     __pyx_t_1 = 0;
25265 
25266     /* "GPy/models/state_space_cython.pyx":970
25267  *             calc_grad_log_likelihood, dm_upd, dP_upd)
25268  *
25269  *         k_measurment = Y[k,:,:]             # <<<<<<<<<<<<<<
25270  *         if (np.any(np.isnan(k_measurment)) == False):
25271  * #        if np.any(np.isnan(k_measurment)):
25272  */
25273     __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 970, __pyx_L1_error)
25274     __Pyx_GOTREF(__pyx_t_8);
25275     __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
25276     __Pyx_GOTREF(__pyx_t_1);
25277     __Pyx_GIVEREF(__pyx_t_8);
25278     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
25279     __Pyx_INCREF(__pyx_slice__10);
25280     __Pyx_GIVEREF(__pyx_slice__10);
25281     PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice__10);
25282     __Pyx_INCREF(__pyx_slice__10);
25283     __Pyx_GIVEREF(__pyx_slice__10);
25284     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_slice__10);
25285     __pyx_t_8 = 0;
25286     __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_v_Y, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 970, __pyx_L1_error)
25287     __Pyx_GOTREF(__pyx_t_8);
25288     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25289     if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 970, __pyx_L1_error)
25290     __pyx_t_22 = ((PyArrayObject *)__pyx_t_8);
25291     {
25292       __Pyx_BufFmt_StackElem __pyx_stack[1];
25293       __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_k_measurment.rcbuffer->pybuffer);
25294       __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_k_measurment.rcbuffer->pybuffer, (PyObject*)__pyx_t_22, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25295       if (unlikely(__pyx_t_23 < 0)) {
25296         PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25297         if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_k_measurment.rcbuffer->pybuffer, (PyObject*)__pyx_v_k_measurment, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25298           Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25299           __Pyx_RaiseBufferFallbackError();
25300         } else {
25301           PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25302         }
25303         __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25304       }
25305       __pyx_pybuffernd_k_measurment.diminfo[0].strides = __pyx_pybuffernd_k_measurment.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_k_measurment.diminfo[0].shape = __pyx_pybuffernd_k_measurment.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_k_measurment.diminfo[1].strides = __pyx_pybuffernd_k_measurment.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_k_measurment.diminfo[1].shape = __pyx_pybuffernd_k_measurment.rcbuffer->pybuffer.shape[1];
25306       if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 970, __pyx_L1_error)
25307     }
25308     __pyx_t_22 = 0;
25309     __Pyx_XDECREF_SET(__pyx_v_k_measurment, ((PyArrayObject *)__pyx_t_8));
25310     __pyx_t_8 = 0;
25311 
25312     /* "GPy/models/state_space_cython.pyx":971
25313  *
25314  *         k_measurment = Y[k,:,:]
25315  *         if (np.any(np.isnan(k_measurment)) == False):             # <<<<<<<<<<<<<<
25316  * #        if np.any(np.isnan(k_measurment)):
25317  * #            raise ValueError("Nan measurements are currently not supported")
25318  */
25319     __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
25320     __Pyx_GOTREF(__pyx_t_1);
25321     __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_any); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error)
25322     __Pyx_GOTREF(__pyx_t_5);
25323     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25324     __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 971, __pyx_L1_error)
25325     __Pyx_GOTREF(__pyx_t_6);
25326     __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isnan); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 971, __pyx_L1_error)
25327     __Pyx_GOTREF(__pyx_t_4);
25328     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25329     __pyx_t_6 = NULL;
25330     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
25331       __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
25332       if (likely(__pyx_t_6)) {
25333         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
25334         __Pyx_INCREF(__pyx_t_6);
25335         __Pyx_INCREF(function);
25336         __Pyx_DECREF_SET(__pyx_t_4, function);
25337       }
25338     }
25339     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, ((PyObject *)__pyx_v_k_measurment)) : __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_k_measurment));
25340     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25341     if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
25342     __Pyx_GOTREF(__pyx_t_1);
25343     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25344     __pyx_t_4 = NULL;
25345     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
25346       __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
25347       if (likely(__pyx_t_4)) {
25348         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
25349         __Pyx_INCREF(__pyx_t_4);
25350         __Pyx_INCREF(function);
25351         __Pyx_DECREF_SET(__pyx_t_5, function);
25352       }
25353     }
25354     __pyx_t_8 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1);
25355     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
25356     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25357     if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 971, __pyx_L1_error)
25358     __Pyx_GOTREF(__pyx_t_8);
25359     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25360     __pyx_t_5 = PyObject_RichCompare(__pyx_t_8, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 971, __pyx_L1_error)
25361     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25362     __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_26 < 0)) __PYX_ERR(0, 971, __pyx_L1_error)
25363     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25364     if (__pyx_t_26) {
25365 
25366       /* "GPy/models/state_space_cython.pyx":976
25367  *
25368  *             m_upd, P_upd, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update = \
25369  *             _kalman_update_step_SVD_Cython(k,  m_pred , P_pred, p_measurement_callables,             # <<<<<<<<<<<<<<
25370  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,
25371  *                     calc_grad_log_likelihood=calc_grad_log_likelihood,
25372  */
25373       __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_kalman_update_step_SVD_Cython); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 976, __pyx_L1_error)
25374       __Pyx_GOTREF(__pyx_t_5);
25375       __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error)
25376       __Pyx_GOTREF(__pyx_t_8);
25377 
25378       /* "GPy/models/state_space_cython.pyx":977
25379  *             m_upd, P_upd, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update = \
25380  *             _kalman_update_step_SVD_Cython(k,  m_pred , P_pred, p_measurement_callables,
25381  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,             # <<<<<<<<<<<<<<
25382  *                     calc_grad_log_likelihood=calc_grad_log_likelihood,
25383  *                     p_dm = dm_pred, p_dP = dP_pred)
25384  */
25385       __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
25386       __Pyx_GOTREF(__pyx_t_1);
25387       __Pyx_GIVEREF(__pyx_t_8);
25388       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8);
25389       __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
25390       __Pyx_GIVEREF(((PyObject *)__pyx_v_m_pred));
25391       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_m_pred));
25392       __Pyx_INCREF(__pyx_v_P_pred);
25393       __Pyx_GIVEREF(__pyx_v_P_pred);
25394       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_P_pred);
25395       __Pyx_INCREF(((PyObject *)__pyx_v_p_measurement_callables));
25396       __Pyx_GIVEREF(((PyObject *)__pyx_v_p_measurement_callables));
25397       PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_p_measurement_callables));
25398       __Pyx_INCREF(((PyObject *)__pyx_v_k_measurment));
25399       __Pyx_GIVEREF(((PyObject *)__pyx_v_k_measurment));
25400       PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_k_measurment));
25401       __pyx_t_8 = 0;
25402       __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 977, __pyx_L1_error)
25403       __Pyx_GOTREF(__pyx_t_8);
25404       __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_calc_log_likelihood); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
25405       __Pyx_GOTREF(__pyx_t_4);
25406       if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_calc_log_likelihood, __pyx_t_4) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
25407       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25408 
25409       /* "GPy/models/state_space_cython.pyx":978
25410  *             _kalman_update_step_SVD_Cython(k,  m_pred , P_pred, p_measurement_callables,
25411  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,
25412  *                     calc_grad_log_likelihood=calc_grad_log_likelihood,             # <<<<<<<<<<<<<<
25413  *                     p_dm = dm_pred, p_dP = dP_pred)
25414  *         else:
25415  */
25416       __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_calc_grad_log_likelihood); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 978, __pyx_L1_error)
25417       __Pyx_GOTREF(__pyx_t_4);
25418       if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_calc_grad_log_likelihood, __pyx_t_4) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
25419       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25420 
25421       /* "GPy/models/state_space_cython.pyx":979
25422  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,
25423  *                     calc_grad_log_likelihood=calc_grad_log_likelihood,
25424  *                     p_dm = dm_pred, p_dP = dP_pred)             # <<<<<<<<<<<<<<
25425  *         else:
25426  *             if not np.all(np.isnan(k_measurment)):
25427  */
25428       if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_p_dm, ((PyObject *)__pyx_v_dm_pred)) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
25429       if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_p_dP, ((PyObject *)__pyx_v_dP_pred)) < 0) __PYX_ERR(0, 977, __pyx_L1_error)
25430 
25431       /* "GPy/models/state_space_cython.pyx":976
25432  *
25433  *             m_upd, P_upd, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update = \
25434  *             _kalman_update_step_SVD_Cython(k,  m_pred , P_pred, p_measurement_callables,             # <<<<<<<<<<<<<<
25435  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,
25436  *                     calc_grad_log_likelihood=calc_grad_log_likelihood,
25437  */
25438       __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error)
25439       __Pyx_GOTREF(__pyx_t_4);
25440       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25441       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
25442       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
25443       if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
25444         PyObject* sequence = __pyx_t_4;
25445         Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
25446         if (unlikely(size != 6)) {
25447           if (size > 6) __Pyx_RaiseTooManyValuesError(6);
25448           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
25449           __PYX_ERR(0, 975, __pyx_L1_error)
25450         }
25451         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25452         if (likely(PyTuple_CheckExact(sequence))) {
25453           __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0);
25454           __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
25455           __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
25456           __pyx_t_6 = PyTuple_GET_ITEM(sequence, 3);
25457           __pyx_t_2 = PyTuple_GET_ITEM(sequence, 4);
25458           __pyx_t_27 = PyTuple_GET_ITEM(sequence, 5);
25459         } else {
25460           __pyx_t_8 = PyList_GET_ITEM(sequence, 0);
25461           __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
25462           __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
25463           __pyx_t_6 = PyList_GET_ITEM(sequence, 3);
25464           __pyx_t_2 = PyList_GET_ITEM(sequence, 4);
25465           __pyx_t_27 = PyList_GET_ITEM(sequence, 5);
25466         }
25467         __Pyx_INCREF(__pyx_t_8);
25468         __Pyx_INCREF(__pyx_t_1);
25469         __Pyx_INCREF(__pyx_t_5);
25470         __Pyx_INCREF(__pyx_t_6);
25471         __Pyx_INCREF(__pyx_t_2);
25472         __Pyx_INCREF(__pyx_t_27);
25473         #else
25474         {
25475           Py_ssize_t i;
25476           PyObject** temps[6] = {&__pyx_t_8,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_2,&__pyx_t_27};
25477           for (i=0; i < 6; i++) {
25478             PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 975, __pyx_L1_error)
25479             __Pyx_GOTREF(item);
25480             *(temps[i]) = item;
25481           }
25482         }
25483         #endif
25484         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25485       } else {
25486         Py_ssize_t index = -1;
25487         PyObject** temps[6] = {&__pyx_t_8,&__pyx_t_1,&__pyx_t_5,&__pyx_t_6,&__pyx_t_2,&__pyx_t_27};
25488         __pyx_t_28 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 975, __pyx_L1_error)
25489         __Pyx_GOTREF(__pyx_t_28);
25490         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25491         __pyx_t_14 = Py_TYPE(__pyx_t_28)->tp_iternext;
25492         for (index=0; index < 6; index++) {
25493           PyObject* item = __pyx_t_14(__pyx_t_28); if (unlikely(!item)) goto __pyx_L10_unpacking_failed;
25494           __Pyx_GOTREF(item);
25495           *(temps[index]) = item;
25496         }
25497         if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_28), 6) < 0) __PYX_ERR(0, 975, __pyx_L1_error)
25498         __pyx_t_14 = NULL;
25499         __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
25500         goto __pyx_L11_unpacking_done;
25501         __pyx_L10_unpacking_failed:;
25502         __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
25503         __pyx_t_14 = NULL;
25504         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
25505         __PYX_ERR(0, 975, __pyx_L1_error)
25506         __pyx_L11_unpacking_done:;
25507       }
25508 
25509       /* "GPy/models/state_space_cython.pyx":975
25510  * #            raise ValueError("Nan measurements are currently not supported")
25511  *
25512  *             m_upd, P_upd, log_likelihood_update, dm_upd, dP_upd, d_log_likelihood_update = \             # <<<<<<<<<<<<<<
25513  *             _kalman_update_step_SVD_Cython(k,  m_pred , P_pred, p_measurement_callables,
25514  *                     k_measurment, calc_log_likelihood=calc_log_likelihood,
25515  */
25516       if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 975, __pyx_L1_error)
25517       if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 975, __pyx_L1_error)
25518       if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 975, __pyx_L1_error)
25519       if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 975, __pyx_L1_error)
25520       if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 975, __pyx_L1_error)
25521       if (!(likely(((__pyx_t_27) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_27, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 975, __pyx_L1_error)
25522       __pyx_t_24 = ((PyArrayObject *)__pyx_t_8);
25523       {
25524         __Pyx_BufFmt_StackElem __pyx_stack[1];
25525         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer);
25526         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_24, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25527         if (unlikely(__pyx_t_23 < 0)) {
25528           PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25529           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25530             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25531             __Pyx_RaiseBufferFallbackError();
25532           } else {
25533             PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25534           }
25535           __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25536         }
25537         __pyx_pybuffernd_m_upd.diminfo[0].strides = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_upd.diminfo[0].shape = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_upd.diminfo[1].strides = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_upd.diminfo[1].shape = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.shape[1];
25538         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
25539       }
25540       __pyx_t_24 = 0;
25541       __Pyx_XDECREF_SET(__pyx_v_m_upd, ((PyArrayObject *)__pyx_t_8));
25542       __pyx_t_8 = 0;
25543       __Pyx_DECREF_SET(__pyx_v_P_upd, ((PyObject*)__pyx_t_1));
25544       __pyx_t_1 = 0;
25545       __pyx_t_29 = ((PyArrayObject *)__pyx_t_5);
25546       {
25547         __Pyx_BufFmt_StackElem __pyx_stack[1];
25548         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
25549         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25550         if (unlikely(__pyx_t_23 < 0)) {
25551           PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25552           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25553             Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25554             __Pyx_RaiseBufferFallbackError();
25555           } else {
25556             PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25557           }
25558           __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25559         }
25560         __pyx_pybuffernd_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[1];
25561         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
25562       }
25563       __pyx_t_29 = 0;
25564       __Pyx_XDECREF_SET(__pyx_v_log_likelihood_update, ((PyArrayObject *)__pyx_t_5));
25565       __pyx_t_5 = 0;
25566       __pyx_t_30 = ((PyArrayObject *)__pyx_t_6);
25567       {
25568         __Pyx_BufFmt_StackElem __pyx_stack[1];
25569         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
25570         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_30, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25571         if (unlikely(__pyx_t_23 < 0)) {
25572           PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25573           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25574             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25575             __Pyx_RaiseBufferFallbackError();
25576           } else {
25577             PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25578           }
25579           __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25580         }
25581         __pyx_pybuffernd_dm_upd.diminfo[0].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_upd.diminfo[0].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_upd.diminfo[1].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_upd.diminfo[1].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_upd.diminfo[2].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_upd.diminfo[2].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[2];
25582         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
25583       }
25584       __pyx_t_30 = 0;
25585       __Pyx_DECREF_SET(__pyx_v_dm_upd, ((PyArrayObject *)__pyx_t_6));
25586       __pyx_t_6 = 0;
25587       __pyx_t_31 = ((PyArrayObject *)__pyx_t_2);
25588       {
25589         __Pyx_BufFmt_StackElem __pyx_stack[1];
25590         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
25591         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_t_31, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25592         if (unlikely(__pyx_t_23 < 0)) {
25593           PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25594           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25595             Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25596             __Pyx_RaiseBufferFallbackError();
25597           } else {
25598             PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25599           }
25600           __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25601         }
25602         __pyx_pybuffernd_dP_upd.diminfo[0].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_upd.diminfo[0].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_upd.diminfo[1].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_upd.diminfo[1].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_upd.diminfo[2].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_upd.diminfo[2].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[2];
25603         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
25604       }
25605       __pyx_t_31 = 0;
25606       __Pyx_DECREF_SET(__pyx_v_dP_upd, ((PyArrayObject *)__pyx_t_2));
25607       __pyx_t_2 = 0;
25608       __pyx_t_29 = ((PyArrayObject *)__pyx_t_27);
25609       {
25610         __Pyx_BufFmt_StackElem __pyx_stack[1];
25611         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
25612         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25613         if (unlikely(__pyx_t_23 < 0)) {
25614           PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25615           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25616             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25617             __Pyx_RaiseBufferFallbackError();
25618           } else {
25619             PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25620           }
25621           __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25622         }
25623         __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[1];
25624         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
25625       }
25626       __pyx_t_29 = 0;
25627       __Pyx_XDECREF_SET(__pyx_v_d_log_likelihood_update, ((PyArrayObject *)__pyx_t_27));
25628       __pyx_t_27 = 0;
25629 
25630       /* "GPy/models/state_space_cython.pyx":971
25631  *
25632  *         k_measurment = Y[k,:,:]
25633  *         if (np.any(np.isnan(k_measurment)) == False):             # <<<<<<<<<<<<<<
25634  * #        if np.any(np.isnan(k_measurment)):
25635  * #            raise ValueError("Nan measurements are currently not supported")
25636  */
25637       goto __pyx_L9;
25638     }
25639 
25640     /* "GPy/models/state_space_cython.pyx":981
25641  *                     p_dm = dm_pred, p_dP = dP_pred)
25642  *         else:
25643  *             if not np.all(np.isnan(k_measurment)):             # <<<<<<<<<<<<<<
25644  *                     raise ValueError("""Nan measurements are currently not supported if
25645  *                                      they are intermixed with not NaN measurements""")
25646  */
25647     /*else*/ {
25648       __Pyx_GetModuleGlobalName(__pyx_t_27, __pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 981, __pyx_L1_error)
25649       __Pyx_GOTREF(__pyx_t_27);
25650       __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_all); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
25651       __Pyx_GOTREF(__pyx_t_2);
25652       __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
25653       __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 981, __pyx_L1_error)
25654       __Pyx_GOTREF(__pyx_t_6);
25655       __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_isnan); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 981, __pyx_L1_error)
25656       __Pyx_GOTREF(__pyx_t_5);
25657       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25658       __pyx_t_6 = NULL;
25659       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
25660         __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
25661         if (likely(__pyx_t_6)) {
25662           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
25663           __Pyx_INCREF(__pyx_t_6);
25664           __Pyx_INCREF(function);
25665           __Pyx_DECREF_SET(__pyx_t_5, function);
25666         }
25667       }
25668       __pyx_t_27 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, ((PyObject *)__pyx_v_k_measurment)) : __Pyx_PyObject_CallOneArg(__pyx_t_5, ((PyObject *)__pyx_v_k_measurment));
25669       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
25670       if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 981, __pyx_L1_error)
25671       __Pyx_GOTREF(__pyx_t_27);
25672       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25673       __pyx_t_5 = NULL;
25674       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
25675         __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
25676         if (likely(__pyx_t_5)) {
25677           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
25678           __Pyx_INCREF(__pyx_t_5);
25679           __Pyx_INCREF(function);
25680           __Pyx_DECREF_SET(__pyx_t_2, function);
25681         }
25682       }
25683       __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_27) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_27);
25684       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
25685       __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
25686       if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 981, __pyx_L1_error)
25687       __Pyx_GOTREF(__pyx_t_4);
25688       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25689       __pyx_t_26 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_26 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
25690       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25691       __pyx_t_32 = ((!__pyx_t_26) != 0);
25692       if (unlikely(__pyx_t_32)) {
25693 
25694         /* "GPy/models/state_space_cython.pyx":982
25695  *         else:
25696  *             if not np.all(np.isnan(k_measurment)):
25697  *                     raise ValueError("""Nan measurements are currently not supported if             # <<<<<<<<<<<<<<
25698  *                                      they are intermixed with not NaN measurements""")
25699  *             else:
25700  */
25701         __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 982, __pyx_L1_error)
25702         __Pyx_GOTREF(__pyx_t_4);
25703         __Pyx_Raise(__pyx_t_4, 0, 0, 0);
25704         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25705         __PYX_ERR(0, 982, __pyx_L1_error)
25706 
25707         /* "GPy/models/state_space_cython.pyx":981
25708  *                     p_dm = dm_pred, p_dP = dP_pred)
25709  *         else:
25710  *             if not np.all(np.isnan(k_measurment)):             # <<<<<<<<<<<<<<
25711  *                     raise ValueError("""Nan measurements are currently not supported if
25712  *                                      they are intermixed with not NaN measurements""")
25713  */
25714       }
25715 
25716       /* "GPy/models/state_space_cython.pyx":985
25717  *                                      they are intermixed with not NaN measurements""")
25718  *             else:
25719  *                 m_upd = m_pred; P_upd = P_pred; dm_upd = dm_pred; dP_upd = dP_pred             # <<<<<<<<<<<<<<
25720  *                 if calc_log_likelihood:
25721  *                     log_likelihood_update = np.zeros((1,time_series_no))
25722  */
25723       /*else*/ {
25724         {
25725           __Pyx_BufFmt_StackElem __pyx_stack[1];
25726           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer);
25727           __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_pred, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25728           if (unlikely(__pyx_t_23 < 0)) {
25729             PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25730             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_m_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25731               Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25732               __Pyx_RaiseBufferFallbackError();
25733             } else {
25734               PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25735             }
25736             __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25737           }
25738           __pyx_pybuffernd_m_upd.diminfo[0].strides = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_m_upd.diminfo[0].shape = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_m_upd.diminfo[1].strides = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_m_upd.diminfo[1].shape = __pyx_pybuffernd_m_upd.rcbuffer->pybuffer.shape[1];
25739           if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
25740         }
25741         __Pyx_INCREF(((PyObject *)__pyx_v_m_pred));
25742         __Pyx_XDECREF_SET(__pyx_v_m_upd, __pyx_v_m_pred);
25743         __Pyx_INCREF(__pyx_v_P_pred);
25744         __Pyx_DECREF_SET(__pyx_v_P_upd, __pyx_v_P_pred);
25745         {
25746           __Pyx_BufFmt_StackElem __pyx_stack[1];
25747           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
25748           __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_dm_pred), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25749           if (unlikely(__pyx_t_23 < 0)) {
25750             PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25751             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25752               Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25753               __Pyx_RaiseBufferFallbackError();
25754             } else {
25755               PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25756             }
25757             __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25758           }
25759           __pyx_pybuffernd_dm_upd.diminfo[0].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm_upd.diminfo[0].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm_upd.diminfo[1].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm_upd.diminfo[1].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dm_upd.diminfo[2].strides = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dm_upd.diminfo[2].shape = __pyx_pybuffernd_dm_upd.rcbuffer->pybuffer.shape[2];
25760           if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
25761         }
25762         __Pyx_INCREF(((PyObject *)__pyx_v_dm_pred));
25763         __Pyx_DECREF_SET(__pyx_v_dm_upd, ((PyArrayObject *)__pyx_v_dm_pred));
25764         {
25765           __Pyx_BufFmt_StackElem __pyx_stack[1];
25766           __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
25767           __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_v_dP_pred), &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack);
25768           if (unlikely(__pyx_t_23 < 0)) {
25769             PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25770             if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer, (PyObject*)__pyx_v_dP_upd, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {
25771               Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25772               __Pyx_RaiseBufferFallbackError();
25773             } else {
25774               PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25775             }
25776             __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25777           }
25778           __pyx_pybuffernd_dP_upd.diminfo[0].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dP_upd.diminfo[0].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dP_upd.diminfo[1].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dP_upd.diminfo[1].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dP_upd.diminfo[2].strides = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dP_upd.diminfo[2].shape = __pyx_pybuffernd_dP_upd.rcbuffer->pybuffer.shape[2];
25779           if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 985, __pyx_L1_error)
25780         }
25781         __Pyx_INCREF(((PyObject *)__pyx_v_dP_pred));
25782         __Pyx_DECREF_SET(__pyx_v_dP_upd, ((PyArrayObject *)__pyx_v_dP_pred));
25783 
25784         /* "GPy/models/state_space_cython.pyx":986
25785  *             else:
25786  *                 m_upd = m_pred; P_upd = P_pred; dm_upd = dm_pred; dP_upd = dP_pred
25787  *                 if calc_log_likelihood:             # <<<<<<<<<<<<<<
25788  *                     log_likelihood_update = np.zeros((1,time_series_no))
25789  *                 if calc_grad_log_likelihood:
25790  */
25791         __pyx_t_32 = (__pyx_v_calc_log_likelihood != 0);
25792         if (__pyx_t_32) {
25793 
25794           /* "GPy/models/state_space_cython.pyx":987
25795  *                 m_upd = m_pred; P_upd = P_pred; dm_upd = dm_pred; dP_upd = dP_pred
25796  *                 if calc_log_likelihood:
25797  *                     log_likelihood_update = np.zeros((1,time_series_no))             # <<<<<<<<<<<<<<
25798  *                 if calc_grad_log_likelihood:
25799  *                     d_log_likelihood_update = np.zeros((grad_params_no,time_series_no))
25800  */
25801           __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
25802           __Pyx_GOTREF(__pyx_t_2);
25803           __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 987, __pyx_L1_error)
25804           __Pyx_GOTREF(__pyx_t_27);
25805           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
25806           __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
25807           __Pyx_GOTREF(__pyx_t_2);
25808           __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 987, __pyx_L1_error)
25809           __Pyx_GOTREF(__pyx_t_5);
25810           __Pyx_INCREF(__pyx_int_1);
25811           __Pyx_GIVEREF(__pyx_int_1);
25812           PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_1);
25813           __Pyx_GIVEREF(__pyx_t_2);
25814           PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
25815           __pyx_t_2 = 0;
25816           __pyx_t_2 = NULL;
25817           if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_27))) {
25818             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_27);
25819             if (likely(__pyx_t_2)) {
25820               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_27);
25821               __Pyx_INCREF(__pyx_t_2);
25822               __Pyx_INCREF(function);
25823               __Pyx_DECREF_SET(__pyx_t_27, function);
25824             }
25825           }
25826           __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_27, __pyx_t_2, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_27, __pyx_t_5);
25827           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25828           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25829           if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 987, __pyx_L1_error)
25830           __Pyx_GOTREF(__pyx_t_4);
25831           __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
25832           if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 987, __pyx_L1_error)
25833           __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
25834           {
25835             __Pyx_BufFmt_StackElem __pyx_stack[1];
25836             __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
25837             __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25838             if (unlikely(__pyx_t_23 < 0)) {
25839               PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25840               if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25841                 Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25842                 __Pyx_RaiseBufferFallbackError();
25843               } else {
25844                 PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25845               }
25846               __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25847             }
25848             __pyx_pybuffernd_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer.shape[1];
25849             if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 987, __pyx_L1_error)
25850           }
25851           __pyx_t_29 = 0;
25852           __Pyx_XDECREF_SET(__pyx_v_log_likelihood_update, ((PyArrayObject *)__pyx_t_4));
25853           __pyx_t_4 = 0;
25854 
25855           /* "GPy/models/state_space_cython.pyx":986
25856  *             else:
25857  *                 m_upd = m_pred; P_upd = P_pred; dm_upd = dm_pred; dP_upd = dP_pred
25858  *                 if calc_log_likelihood:             # <<<<<<<<<<<<<<
25859  *                     log_likelihood_update = np.zeros((1,time_series_no))
25860  *                 if calc_grad_log_likelihood:
25861  */
25862         }
25863 
25864         /* "GPy/models/state_space_cython.pyx":988
25865  *                 if calc_log_likelihood:
25866  *                     log_likelihood_update = np.zeros((1,time_series_no))
25867  *                 if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
25868  *                     d_log_likelihood_update = np.zeros((grad_params_no,time_series_no))
25869  *
25870  */
25871         __pyx_t_32 = (__pyx_v_calc_grad_log_likelihood != 0);
25872         if (__pyx_t_32) {
25873 
25874           /* "GPy/models/state_space_cython.pyx":989
25875  *                     log_likelihood_update = np.zeros((1,time_series_no))
25876  *                 if calc_grad_log_likelihood:
25877  *                     d_log_likelihood_update = np.zeros((grad_params_no,time_series_no))             # <<<<<<<<<<<<<<
25878  *
25879  *
25880  */
25881           __Pyx_GetModuleGlobalName(__pyx_t_27, __pyx_n_s_np); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 989, __pyx_L1_error)
25882           __Pyx_GOTREF(__pyx_t_27);
25883           __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_27, __pyx_n_s_zeros); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 989, __pyx_L1_error)
25884           __Pyx_GOTREF(__pyx_t_5);
25885           __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
25886           __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_grad_params_no); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 989, __pyx_L1_error)
25887           __Pyx_GOTREF(__pyx_t_27);
25888           __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_time_series_no); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error)
25889           __Pyx_GOTREF(__pyx_t_2);
25890           __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 989, __pyx_L1_error)
25891           __Pyx_GOTREF(__pyx_t_6);
25892           __Pyx_GIVEREF(__pyx_t_27);
25893           PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_27);
25894           __Pyx_GIVEREF(__pyx_t_2);
25895           PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
25896           __pyx_t_27 = 0;
25897           __pyx_t_2 = 0;
25898           __pyx_t_2 = NULL;
25899           if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
25900             __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
25901             if (likely(__pyx_t_2)) {
25902               PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
25903               __Pyx_INCREF(__pyx_t_2);
25904               __Pyx_INCREF(function);
25905               __Pyx_DECREF_SET(__pyx_t_5, function);
25906             }
25907           }
25908           __pyx_t_4 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
25909           __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
25910           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
25911           if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 989, __pyx_L1_error)
25912           __Pyx_GOTREF(__pyx_t_4);
25913           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
25914           if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 989, __pyx_L1_error)
25915           __pyx_t_29 = ((PyArrayObject *)__pyx_t_4);
25916           {
25917             __Pyx_BufFmt_StackElem __pyx_stack[1];
25918             __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
25919             __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_t_29, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25920             if (unlikely(__pyx_t_23 < 0)) {
25921               PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
25922               if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer, (PyObject*)__pyx_v_d_log_likelihood_update, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25923                 Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
25924                 __Pyx_RaiseBufferFallbackError();
25925               } else {
25926                 PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
25927               }
25928               __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
25929             }
25930             __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[0].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].strides = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_d_log_likelihood_update.diminfo[1].shape = __pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer.shape[1];
25931             if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 989, __pyx_L1_error)
25932           }
25933           __pyx_t_29 = 0;
25934           __Pyx_XDECREF_SET(__pyx_v_d_log_likelihood_update, ((PyArrayObject *)__pyx_t_4));
25935           __pyx_t_4 = 0;
25936 
25937           /* "GPy/models/state_space_cython.pyx":988
25938  *                 if calc_log_likelihood:
25939  *                     log_likelihood_update = np.zeros((1,time_series_no))
25940  *                 if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
25941  *                     d_log_likelihood_update = np.zeros((grad_params_no,time_series_no))
25942  *
25943  */
25944         }
25945       }
25946     }
25947     __pyx_L9:;
25948 
25949     /* "GPy/models/state_space_cython.pyx":992
25950  *
25951  *
25952  *         if calc_log_likelihood:             # <<<<<<<<<<<<<<
25953  *             log_likelihood += log_likelihood_update
25954  *
25955  */
25956     __pyx_t_32 = (__pyx_v_calc_log_likelihood != 0);
25957     if (__pyx_t_32) {
25958 
25959       /* "GPy/models/state_space_cython.pyx":993
25960  *
25961  *         if calc_log_likelihood:
25962  *             log_likelihood += log_likelihood_update             # <<<<<<<<<<<<<<
25963  *
25964  *         if calc_grad_log_likelihood:
25965  */
25966       __pyx_t_4 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_log_likelihood), ((PyObject *)__pyx_v_log_likelihood_update)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error)
25967       __Pyx_GOTREF(__pyx_t_4);
25968       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 993, __pyx_L1_error)
25969       __pyx_t_18 = ((PyArrayObject *)__pyx_t_4);
25970       {
25971         __Pyx_BufFmt_StackElem __pyx_stack[1];
25972         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer);
25973         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_t_18, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
25974         if (unlikely(__pyx_t_23 < 0)) {
25975           PyErr_Fetch(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
25976           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_v_log_likelihood, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
25977             Py_XDECREF(__pyx_t_13); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_11);
25978             __Pyx_RaiseBufferFallbackError();
25979           } else {
25980             PyErr_Restore(__pyx_t_13, __pyx_t_12, __pyx_t_11);
25981           }
25982           __pyx_t_13 = __pyx_t_12 = __pyx_t_11 = 0;
25983         }
25984         __pyx_pybuffernd_log_likelihood.diminfo[0].strides = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_log_likelihood.diminfo[0].shape = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_log_likelihood.diminfo[1].strides = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_log_likelihood.diminfo[1].shape = __pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer.shape[1];
25985         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 993, __pyx_L1_error)
25986       }
25987       __pyx_t_18 = 0;
25988       __Pyx_DECREF_SET(__pyx_v_log_likelihood, ((PyArrayObject *)__pyx_t_4));
25989       __pyx_t_4 = 0;
25990 
25991       /* "GPy/models/state_space_cython.pyx":992
25992  *
25993  *
25994  *         if calc_log_likelihood:             # <<<<<<<<<<<<<<
25995  *             log_likelihood += log_likelihood_update
25996  *
25997  */
25998     }
25999 
26000     /* "GPy/models/state_space_cython.pyx":995
26001  *             log_likelihood += log_likelihood_update
26002  *
26003  *         if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
26004  *             grad_log_likelihood += d_log_likelihood_update
26005  *
26006  */
26007     __pyx_t_32 = (__pyx_v_calc_grad_log_likelihood != 0);
26008     if (__pyx_t_32) {
26009 
26010       /* "GPy/models/state_space_cython.pyx":996
26011  *
26012  *         if calc_grad_log_likelihood:
26013  *             grad_log_likelihood += d_log_likelihood_update             # <<<<<<<<<<<<<<
26014  *
26015  *         M[k+1,:,:] = m_upd # separate mean value for each time series
26016  */
26017       __pyx_t_4 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_grad_log_likelihood), ((PyObject *)__pyx_v_d_log_likelihood_update)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 996, __pyx_L1_error)
26018       __Pyx_GOTREF(__pyx_t_4);
26019       if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 996, __pyx_L1_error)
26020       __pyx_t_19 = ((PyArrayObject *)__pyx_t_4);
26021       {
26022         __Pyx_BufFmt_StackElem __pyx_stack[1];
26023         __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer);
26024         __pyx_t_23 = __Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_t_19, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack);
26025         if (unlikely(__pyx_t_23 < 0)) {
26026           PyErr_Fetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
26027           if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer, (PyObject*)__pyx_v_grad_log_likelihood, &__Pyx_TypeInfo_nn___pyx_t_3GPy_6models_18state_space_cython_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {
26028             Py_XDECREF(__pyx_t_11); Py_XDECREF(__pyx_t_12); Py_XDECREF(__pyx_t_13);
26029             __Pyx_RaiseBufferFallbackError();
26030           } else {
26031             PyErr_Restore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
26032           }
26033           __pyx_t_11 = __pyx_t_12 = __pyx_t_13 = 0;
26034         }
26035         __pyx_pybuffernd_grad_log_likelihood.diminfo[0].strides = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_grad_log_likelihood.diminfo[0].shape = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_grad_log_likelihood.diminfo[1].strides = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_grad_log_likelihood.diminfo[1].shape = __pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer.shape[1];
26036         if (unlikely(__pyx_t_23 < 0)) __PYX_ERR(0, 996, __pyx_L1_error)
26037       }
26038       __pyx_t_19 = 0;
26039       __Pyx_DECREF_SET(__pyx_v_grad_log_likelihood, ((PyArrayObject *)__pyx_t_4));
26040       __pyx_t_4 = 0;
26041 
26042       /* "GPy/models/state_space_cython.pyx":995
26043  *             log_likelihood += log_likelihood_update
26044  *
26045  *         if calc_grad_log_likelihood:             # <<<<<<<<<<<<<<
26046  *             grad_log_likelihood += d_log_likelihood_update
26047  *
26048  */
26049     }
26050 
26051     /* "GPy/models/state_space_cython.pyx":998
26052  *             grad_log_likelihood += d_log_likelihood_update
26053  *
26054  *         M[k+1,:,:] = m_upd # separate mean value for each time series             # <<<<<<<<<<<<<<
26055  *         P[k+1,:,:] = P_upd[0]
26056  *
26057  */
26058     __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 998, __pyx_L1_error)
26059     __Pyx_GOTREF(__pyx_t_4);
26060     __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 998, __pyx_L1_error)
26061     __Pyx_GOTREF(__pyx_t_5);
26062     __Pyx_GIVEREF(__pyx_t_4);
26063     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
26064     __Pyx_INCREF(__pyx_slice__10);
26065     __Pyx_GIVEREF(__pyx_slice__10);
26066     PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_slice__10);
26067     __Pyx_INCREF(__pyx_slice__10);
26068     __Pyx_GIVEREF(__pyx_slice__10);
26069     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_slice__10);
26070     __pyx_t_4 = 0;
26071     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_M), __pyx_t_5, ((PyObject *)__pyx_v_m_upd)) < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
26072     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26073 
26074     /* "GPy/models/state_space_cython.pyx":999
26075  *
26076  *         M[k+1,:,:] = m_upd # separate mean value for each time series
26077  *         P[k+1,:,:] = P_upd[0]             # <<<<<<<<<<<<<<
26078  *
26079  *     return (M, P, log_likelihood, grad_log_likelihood, p_dynamic_callables.reset(False))
26080  */
26081     if (unlikely(__pyx_v_P_upd == Py_None)) {
26082       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26083       __PYX_ERR(0, 999, __pyx_L1_error)
26084     }
26085     __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_P_upd, 0);
26086     __Pyx_INCREF(__pyx_t_5);
26087     __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_k + 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error)
26088     __Pyx_GOTREF(__pyx_t_4);
26089     __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 999, __pyx_L1_error)
26090     __Pyx_GOTREF(__pyx_t_6);
26091     __Pyx_GIVEREF(__pyx_t_4);
26092     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
26093     __Pyx_INCREF(__pyx_slice__10);
26094     __Pyx_GIVEREF(__pyx_slice__10);
26095     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice__10);
26096     __Pyx_INCREF(__pyx_slice__10);
26097     __Pyx_GIVEREF(__pyx_slice__10);
26098     PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_slice__10);
26099     __pyx_t_4 = 0;
26100     if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_P), __pyx_t_6, __pyx_t_5) < 0)) __PYX_ERR(0, 999, __pyx_L1_error)
26101     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26102     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26103   }
26104 
26105   /* "GPy/models/state_space_cython.pyx":1001
26106  *         P[k+1,:,:] = P_upd[0]
26107  *
26108  *     return (M, P, log_likelihood, grad_log_likelihood, p_dynamic_callables.reset(False))             # <<<<<<<<<<<<<<
26109  */
26110   __Pyx_XDECREF(__pyx_r);
26111   __pyx_t_33.__pyx_n = 1;
26112   __pyx_t_33.compute_derivatives = 0;
26113   __pyx_t_5 = ((struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v_p_dynamic_callables->__pyx_vtab)->reset(__pyx_v_p_dynamic_callables, 0, &__pyx_t_33); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error)
26114   __Pyx_GOTREF(__pyx_t_5);
26115   __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1001, __pyx_L1_error)
26116   __Pyx_GOTREF(__pyx_t_6);
26117   __Pyx_INCREF(((PyObject *)__pyx_v_M));
26118   __Pyx_GIVEREF(((PyObject *)__pyx_v_M));
26119   PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_M));
26120   __Pyx_INCREF(((PyObject *)__pyx_v_P));
26121   __Pyx_GIVEREF(((PyObject *)__pyx_v_P));
26122   PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_P));
26123   __Pyx_INCREF(((PyObject *)__pyx_v_log_likelihood));
26124   __Pyx_GIVEREF(((PyObject *)__pyx_v_log_likelihood));
26125   PyTuple_SET_ITEM(__pyx_t_6, 2, ((PyObject *)__pyx_v_log_likelihood));
26126   __Pyx_INCREF(((PyObject *)__pyx_v_grad_log_likelihood));
26127   __Pyx_GIVEREF(((PyObject *)__pyx_v_grad_log_likelihood));
26128   PyTuple_SET_ITEM(__pyx_t_6, 3, ((PyObject *)__pyx_v_grad_log_likelihood));
26129   __Pyx_GIVEREF(__pyx_t_5);
26130   PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5);
26131   __pyx_t_5 = 0;
26132   __pyx_r = __pyx_t_6;
26133   __pyx_t_6 = 0;
26134   goto __pyx_L0;
26135 
26136   /* "GPy/models/state_space_cython.pyx":912
26137  *
26138  * @cython.boundscheck(False)
26139  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,             # <<<<<<<<<<<<<<
26140  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
26141  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
26142  */
26143 
26144   /* function exit code */
26145   __pyx_L1_error:;
26146   __Pyx_XDECREF(__pyx_t_1);
26147   __Pyx_XDECREF(__pyx_t_2);
26148   __Pyx_XDECREF(__pyx_t_4);
26149   __Pyx_XDECREF(__pyx_t_5);
26150   __Pyx_XDECREF(__pyx_t_6);
26151   __Pyx_XDECREF(__pyx_t_8);
26152   __Pyx_XDECREF(__pyx_t_27);
26153   __Pyx_XDECREF(__pyx_t_28);
26154   { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
26155     __Pyx_PyThreadState_declare
26156     __Pyx_PyThreadState_assign
26157     __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
26158     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_M.rcbuffer->pybuffer);
26159     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
26160     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer);
26161     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
26162     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
26163     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
26164     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_init.rcbuffer->pybuffer);
26165     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
26166     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
26167     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
26168     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_init.rcbuffer->pybuffer);
26169     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
26170     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
26171     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer);
26172     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_k_measurment.rcbuffer->pybuffer);
26173     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer);
26174     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
26175     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_init.rcbuffer->pybuffer);
26176     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
26177     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer);
26178     __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prev_mean.rcbuffer->pybuffer);
26179   __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
26180   __Pyx_AddTraceback("GPy.models.state_space_cython._cont_discr_kalman_filter_raw_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
26181   __pyx_r = NULL;
26182   goto __pyx_L2;
26183   __pyx_L0:;
26184   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_M.rcbuffer->pybuffer);
26185   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P.rcbuffer->pybuffer);
26186   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_P_init.rcbuffer->pybuffer);
26187   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_S.rcbuffer->pybuffer);
26188   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_U.rcbuffer->pybuffer);
26189   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_Vh.rcbuffer->pybuffer);
26190   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_init.rcbuffer->pybuffer);
26191   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_pred.rcbuffer->pybuffer);
26192   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dP_upd.rcbuffer->pybuffer);
26193   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_d_log_likelihood_update.rcbuffer->pybuffer);
26194   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_init.rcbuffer->pybuffer);
26195   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_pred.rcbuffer->pybuffer);
26196   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm_upd.rcbuffer->pybuffer);
26197   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_grad_log_likelihood.rcbuffer->pybuffer);
26198   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_k_measurment.rcbuffer->pybuffer);
26199   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood.rcbuffer->pybuffer);
26200   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_log_likelihood_update.rcbuffer->pybuffer);
26201   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_init.rcbuffer->pybuffer);
26202   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_pred.rcbuffer->pybuffer);
26203   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_m_upd.rcbuffer->pybuffer);
26204   __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_prev_mean.rcbuffer->pybuffer);
26205   __pyx_L2:;
26206   __Pyx_XDECREF((PyObject *)__pyx_v_M);
26207   __Pyx_XDECREF((PyObject *)__pyx_v_P);
26208   __Pyx_XDECREF((PyObject *)__pyx_v_U);
26209   __Pyx_XDECREF((PyObject *)__pyx_v_S);
26210   __Pyx_XDECREF((PyObject *)__pyx_v_Vh);
26211   __Pyx_XDECREF(__pyx_v_P_upd);
26212   __Pyx_XDECREF((PyObject *)__pyx_v_log_likelihood);
26213   __Pyx_XDECREF((PyObject *)__pyx_v_grad_log_likelihood);
26214   __Pyx_XDECREF((PyObject *)__pyx_v_dm_upd);
26215   __Pyx_XDECREF((PyObject *)__pyx_v_dP_upd);
26216   __Pyx_XDECREF((PyObject *)__pyx_v_prev_mean);
26217   __Pyx_XDECREF((PyObject *)__pyx_v_k_measurment);
26218   __Pyx_XDECREF((PyObject *)__pyx_v_m_pred);
26219   __Pyx_XDECREF((PyObject *)__pyx_v_m_upd);
26220   __Pyx_XDECREF(__pyx_v_P_pred);
26221   __Pyx_XDECREF((PyObject *)__pyx_v_dm_pred);
26222   __Pyx_XDECREF((PyObject *)__pyx_v_dP_pred);
26223   __Pyx_XDECREF((PyObject *)__pyx_v_log_likelihood_update);
26224   __Pyx_XDECREF((PyObject *)__pyx_v_d_log_likelihood_update);
26225   __Pyx_XDECREF((PyObject *)__pyx_v_P_init);
26226   __Pyx_XGIVEREF(__pyx_r);
26227   __Pyx_RefNannyFinishContext();
26228   return __pyx_r;
26229 }
26230 
26231 /* "(tree fragment)":1
26232  * def __pyx_unpickle_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26233  *     cdef object __pyx_PickleError
26234  *     cdef object __pyx_result
26235  */
26236 
26237 /* Python wrapper */
26238 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26239 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython = {"__pyx_unpickle_Dynamic_Callables_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26240 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26241   PyObject *__pyx_v___pyx_type = 0;
26242   long __pyx_v___pyx_checksum;
26243   PyObject *__pyx_v___pyx_state = 0;
26244   int __pyx_lineno = 0;
26245   const char *__pyx_filename = NULL;
26246   int __pyx_clineno = 0;
26247   PyObject *__pyx_r = 0;
26248   __Pyx_RefNannyDeclarations
26249   __Pyx_RefNannySetupContext("__pyx_unpickle_Dynamic_Callables_Cython (wrapper)", 0);
26250   {
26251     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
26252     PyObject* values[3] = {0,0,0};
26253     if (unlikely(__pyx_kwds)) {
26254       Py_ssize_t kw_args;
26255       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26256       switch (pos_args) {
26257         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26258         CYTHON_FALLTHROUGH;
26259         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26260         CYTHON_FALLTHROUGH;
26261         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26262         CYTHON_FALLTHROUGH;
26263         case  0: break;
26264         default: goto __pyx_L5_argtuple_error;
26265       }
26266       kw_args = PyDict_Size(__pyx_kwds);
26267       switch (pos_args) {
26268         case  0:
26269         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
26270         else goto __pyx_L5_argtuple_error;
26271         CYTHON_FALLTHROUGH;
26272         case  1:
26273         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
26274         else {
26275           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Dynamic_Callables_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
26276         }
26277         CYTHON_FALLTHROUGH;
26278         case  2:
26279         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
26280         else {
26281           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Dynamic_Callables_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
26282         }
26283       }
26284       if (unlikely(kw_args > 0)) {
26285         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Dynamic_Callables_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
26286       }
26287     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
26288       goto __pyx_L5_argtuple_error;
26289     } else {
26290       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26291       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26292       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26293     }
26294     __pyx_v___pyx_type = values[0];
26295     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
26296     __pyx_v___pyx_state = values[2];
26297   }
26298   goto __pyx_L4_argument_unpacking_done;
26299   __pyx_L5_argtuple_error:;
26300   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Dynamic_Callables_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
26301   __pyx_L3_error:;
26302   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Dynamic_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
26303   __Pyx_RefNannyFinishContext();
26304   return NULL;
26305   __pyx_L4_argument_unpacking_done:;
26306   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_6__pyx_unpickle_Dynamic_Callables_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
26307 
26308   /* function exit code */
26309   __Pyx_RefNannyFinishContext();
26310   return __pyx_r;
26311 }
26312 
__pyx_pf_3GPy_6models_18state_space_cython_6__pyx_unpickle_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)26313 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_6__pyx_unpickle_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
26314   PyObject *__pyx_v___pyx_PickleError = 0;
26315   PyObject *__pyx_v___pyx_result = 0;
26316   PyObject *__pyx_r = NULL;
26317   __Pyx_RefNannyDeclarations
26318   int __pyx_t_1;
26319   PyObject *__pyx_t_2 = NULL;
26320   PyObject *__pyx_t_3 = NULL;
26321   PyObject *__pyx_t_4 = NULL;
26322   PyObject *__pyx_t_5 = NULL;
26323   int __pyx_t_6;
26324   int __pyx_lineno = 0;
26325   const char *__pyx_filename = NULL;
26326   int __pyx_clineno = 0;
26327   __Pyx_RefNannySetupContext("__pyx_unpickle_Dynamic_Callables_Cython", 0);
26328 
26329   /* "(tree fragment)":4
26330  *     cdef object __pyx_PickleError
26331  *     cdef object __pyx_result
26332  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
26333  *         from pickle import PickleError as __pyx_PickleError
26334  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26335  */
26336   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
26337   if (__pyx_t_1) {
26338 
26339     /* "(tree fragment)":5
26340  *     cdef object __pyx_result
26341  *     if __pyx_checksum != 0xd41d8cd:
26342  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
26343  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26344  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)
26345  */
26346     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
26347     __Pyx_GOTREF(__pyx_t_2);
26348     __Pyx_INCREF(__pyx_n_s_PickleError);
26349     __Pyx_GIVEREF(__pyx_n_s_PickleError);
26350     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
26351     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
26352     __Pyx_GOTREF(__pyx_t_3);
26353     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26354     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
26355     __Pyx_GOTREF(__pyx_t_2);
26356     __Pyx_INCREF(__pyx_t_2);
26357     __pyx_v___pyx_PickleError = __pyx_t_2;
26358     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26359     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26360 
26361     /* "(tree fragment)":6
26362  *     if __pyx_checksum != 0xd41d8cd:
26363  *         from pickle import PickleError as __pyx_PickleError
26364  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
26365  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)
26366  *     if __pyx_state is not None:
26367  */
26368     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
26369     __Pyx_GOTREF(__pyx_t_2);
26370     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
26371     __Pyx_GOTREF(__pyx_t_4);
26372     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26373     __Pyx_INCREF(__pyx_v___pyx_PickleError);
26374     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
26375     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
26376       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
26377       if (likely(__pyx_t_5)) {
26378         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26379         __Pyx_INCREF(__pyx_t_5);
26380         __Pyx_INCREF(function);
26381         __Pyx_DECREF_SET(__pyx_t_2, function);
26382       }
26383     }
26384     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
26385     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26386     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26387     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
26388     __Pyx_GOTREF(__pyx_t_3);
26389     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26390     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26391     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26392     __PYX_ERR(1, 6, __pyx_L1_error)
26393 
26394     /* "(tree fragment)":4
26395  *     cdef object __pyx_PickleError
26396  *     cdef object __pyx_result
26397  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
26398  *         from pickle import PickleError as __pyx_PickleError
26399  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26400  */
26401   }
26402 
26403   /* "(tree fragment)":7
26404  *         from pickle import PickleError as __pyx_PickleError
26405  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26406  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
26407  *     if __pyx_state is not None:
26408  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26409  */
26410   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
26411   __Pyx_GOTREF(__pyx_t_2);
26412   __pyx_t_4 = NULL;
26413   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
26414     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
26415     if (likely(__pyx_t_4)) {
26416       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26417       __Pyx_INCREF(__pyx_t_4);
26418       __Pyx_INCREF(function);
26419       __Pyx_DECREF_SET(__pyx_t_2, function);
26420     }
26421   }
26422   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
26423   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26424   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
26425   __Pyx_GOTREF(__pyx_t_3);
26426   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26427   __pyx_v___pyx_result = __pyx_t_3;
26428   __pyx_t_3 = 0;
26429 
26430   /* "(tree fragment)":8
26431  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26432  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)
26433  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26434  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26435  *     return __pyx_result
26436  */
26437   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
26438   __pyx_t_6 = (__pyx_t_1 != 0);
26439   if (__pyx_t_6) {
26440 
26441     /* "(tree fragment)":9
26442  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)
26443  *     if __pyx_state is not None:
26444  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
26445  *     return __pyx_result
26446  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
26447  */
26448     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
26449     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Dynamic_Callables_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
26450     __Pyx_GOTREF(__pyx_t_3);
26451     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26452 
26453     /* "(tree fragment)":8
26454  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26455  *     __pyx_result = Dynamic_Callables_Cython.__new__(__pyx_type)
26456  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26457  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26458  *     return __pyx_result
26459  */
26460   }
26461 
26462   /* "(tree fragment)":10
26463  *     if __pyx_state is not None:
26464  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26465  *     return __pyx_result             # <<<<<<<<<<<<<<
26466  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
26467  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26468  */
26469   __Pyx_XDECREF(__pyx_r);
26470   __Pyx_INCREF(__pyx_v___pyx_result);
26471   __pyx_r = __pyx_v___pyx_result;
26472   goto __pyx_L0;
26473 
26474   /* "(tree fragment)":1
26475  * def __pyx_unpickle_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26476  *     cdef object __pyx_PickleError
26477  *     cdef object __pyx_result
26478  */
26479 
26480   /* function exit code */
26481   __pyx_L1_error:;
26482   __Pyx_XDECREF(__pyx_t_2);
26483   __Pyx_XDECREF(__pyx_t_3);
26484   __Pyx_XDECREF(__pyx_t_4);
26485   __Pyx_XDECREF(__pyx_t_5);
26486   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Dynamic_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
26487   __pyx_r = NULL;
26488   __pyx_L0:;
26489   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
26490   __Pyx_XDECREF(__pyx_v___pyx_result);
26491   __Pyx_XGIVEREF(__pyx_r);
26492   __Pyx_RefNannyFinishContext();
26493   return __pyx_r;
26494 }
26495 
26496 /* "(tree fragment)":11
26497  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26498  *     return __pyx_result
26499  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26500  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26501  *         __pyx_result.__dict__.update(__pyx_state[0])
26502  */
26503 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)26504 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
26505   PyObject *__pyx_r = NULL;
26506   __Pyx_RefNannyDeclarations
26507   int __pyx_t_1;
26508   Py_ssize_t __pyx_t_2;
26509   int __pyx_t_3;
26510   int __pyx_t_4;
26511   PyObject *__pyx_t_5 = NULL;
26512   PyObject *__pyx_t_6 = NULL;
26513   PyObject *__pyx_t_7 = NULL;
26514   PyObject *__pyx_t_8 = NULL;
26515   int __pyx_lineno = 0;
26516   const char *__pyx_filename = NULL;
26517   int __pyx_clineno = 0;
26518   __Pyx_RefNannySetupContext("__pyx_unpickle_Dynamic_Callables_Cython__set_state", 0);
26519 
26520   /* "(tree fragment)":12
26521  *     return __pyx_result
26522  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
26523  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26524  *         __pyx_result.__dict__.update(__pyx_state[0])
26525  */
26526   if (unlikely(__pyx_v___pyx_state == Py_None)) {
26527     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
26528     __PYX_ERR(1, 12, __pyx_L1_error)
26529   }
26530   __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error)
26531   __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
26532   if (__pyx_t_3) {
26533   } else {
26534     __pyx_t_1 = __pyx_t_3;
26535     goto __pyx_L4_bool_binop_done;
26536   }
26537   __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)
26538   __pyx_t_4 = (__pyx_t_3 != 0);
26539   __pyx_t_1 = __pyx_t_4;
26540   __pyx_L4_bool_binop_done:;
26541   if (__pyx_t_1) {
26542 
26543     /* "(tree fragment)":13
26544  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
26545  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26546  *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
26547  */
26548     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
26549     __Pyx_GOTREF(__pyx_t_6);
26550     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
26551     __Pyx_GOTREF(__pyx_t_7);
26552     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26553     if (unlikely(__pyx_v___pyx_state == Py_None)) {
26554       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26555       __PYX_ERR(1, 13, __pyx_L1_error)
26556     }
26557     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
26558     __Pyx_GOTREF(__pyx_t_6);
26559     __pyx_t_8 = NULL;
26560     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
26561       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
26562       if (likely(__pyx_t_8)) {
26563         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26564         __Pyx_INCREF(__pyx_t_8);
26565         __Pyx_INCREF(function);
26566         __Pyx_DECREF_SET(__pyx_t_7, function);
26567       }
26568     }
26569     __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
26570     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26571     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26572     if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
26573     __Pyx_GOTREF(__pyx_t_5);
26574     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26575     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26576 
26577     /* "(tree fragment)":12
26578  *     return __pyx_result
26579  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
26580  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26581  *         __pyx_result.__dict__.update(__pyx_state[0])
26582  */
26583   }
26584 
26585   /* "(tree fragment)":11
26586  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
26587  *     return __pyx_result
26588  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26589  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26590  *         __pyx_result.__dict__.update(__pyx_state[0])
26591  */
26592 
26593   /* function exit code */
26594   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26595   goto __pyx_L0;
26596   __pyx_L1_error:;
26597   __Pyx_XDECREF(__pyx_t_5);
26598   __Pyx_XDECREF(__pyx_t_6);
26599   __Pyx_XDECREF(__pyx_t_7);
26600   __Pyx_XDECREF(__pyx_t_8);
26601   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Dynamic_Callables_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
26602   __pyx_r = 0;
26603   __pyx_L0:;
26604   __Pyx_XGIVEREF(__pyx_r);
26605   __Pyx_RefNannyFinishContext();
26606   return __pyx_r;
26607 }
26608 
26609 /* "(tree fragment)":1
26610  * def __pyx_unpickle_Measurement_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26611  *     cdef object __pyx_PickleError
26612  *     cdef object __pyx_result
26613  */
26614 
26615 /* Python wrapper */
26616 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26617 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython = {"__pyx_unpickle_Measurement_Callables_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26618 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26619   PyObject *__pyx_v___pyx_type = 0;
26620   long __pyx_v___pyx_checksum;
26621   PyObject *__pyx_v___pyx_state = 0;
26622   int __pyx_lineno = 0;
26623   const char *__pyx_filename = NULL;
26624   int __pyx_clineno = 0;
26625   PyObject *__pyx_r = 0;
26626   __Pyx_RefNannyDeclarations
26627   __Pyx_RefNannySetupContext("__pyx_unpickle_Measurement_Callables_Cython (wrapper)", 0);
26628   {
26629     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
26630     PyObject* values[3] = {0,0,0};
26631     if (unlikely(__pyx_kwds)) {
26632       Py_ssize_t kw_args;
26633       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
26634       switch (pos_args) {
26635         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26636         CYTHON_FALLTHROUGH;
26637         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26638         CYTHON_FALLTHROUGH;
26639         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26640         CYTHON_FALLTHROUGH;
26641         case  0: break;
26642         default: goto __pyx_L5_argtuple_error;
26643       }
26644       kw_args = PyDict_Size(__pyx_kwds);
26645       switch (pos_args) {
26646         case  0:
26647         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
26648         else goto __pyx_L5_argtuple_error;
26649         CYTHON_FALLTHROUGH;
26650         case  1:
26651         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
26652         else {
26653           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Measurement_Callables_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
26654         }
26655         CYTHON_FALLTHROUGH;
26656         case  2:
26657         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
26658         else {
26659           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Measurement_Callables_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
26660         }
26661       }
26662       if (unlikely(kw_args > 0)) {
26663         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Measurement_Callables_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
26664       }
26665     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
26666       goto __pyx_L5_argtuple_error;
26667     } else {
26668       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
26669       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
26670       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
26671     }
26672     __pyx_v___pyx_type = values[0];
26673     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
26674     __pyx_v___pyx_state = values[2];
26675   }
26676   goto __pyx_L4_argument_unpacking_done;
26677   __pyx_L5_argtuple_error:;
26678   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Measurement_Callables_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
26679   __pyx_L3_error:;
26680   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Measurement_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
26681   __Pyx_RefNannyFinishContext();
26682   return NULL;
26683   __pyx_L4_argument_unpacking_done:;
26684   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_8__pyx_unpickle_Measurement_Callables_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
26685 
26686   /* function exit code */
26687   __Pyx_RefNannyFinishContext();
26688   return __pyx_r;
26689 }
26690 
__pyx_pf_3GPy_6models_18state_space_cython_8__pyx_unpickle_Measurement_Callables_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)26691 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_8__pyx_unpickle_Measurement_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
26692   PyObject *__pyx_v___pyx_PickleError = 0;
26693   PyObject *__pyx_v___pyx_result = 0;
26694   PyObject *__pyx_r = NULL;
26695   __Pyx_RefNannyDeclarations
26696   int __pyx_t_1;
26697   PyObject *__pyx_t_2 = NULL;
26698   PyObject *__pyx_t_3 = NULL;
26699   PyObject *__pyx_t_4 = NULL;
26700   PyObject *__pyx_t_5 = NULL;
26701   int __pyx_t_6;
26702   int __pyx_lineno = 0;
26703   const char *__pyx_filename = NULL;
26704   int __pyx_clineno = 0;
26705   __Pyx_RefNannySetupContext("__pyx_unpickle_Measurement_Callables_Cython", 0);
26706 
26707   /* "(tree fragment)":4
26708  *     cdef object __pyx_PickleError
26709  *     cdef object __pyx_result
26710  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
26711  *         from pickle import PickleError as __pyx_PickleError
26712  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26713  */
26714   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xd41d8cd) != 0);
26715   if (__pyx_t_1) {
26716 
26717     /* "(tree fragment)":5
26718  *     cdef object __pyx_result
26719  *     if __pyx_checksum != 0xd41d8cd:
26720  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
26721  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26722  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)
26723  */
26724     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
26725     __Pyx_GOTREF(__pyx_t_2);
26726     __Pyx_INCREF(__pyx_n_s_PickleError);
26727     __Pyx_GIVEREF(__pyx_n_s_PickleError);
26728     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
26729     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
26730     __Pyx_GOTREF(__pyx_t_3);
26731     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26732     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
26733     __Pyx_GOTREF(__pyx_t_2);
26734     __Pyx_INCREF(__pyx_t_2);
26735     __pyx_v___pyx_PickleError = __pyx_t_2;
26736     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26737     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26738 
26739     /* "(tree fragment)":6
26740  *     if __pyx_checksum != 0xd41d8cd:
26741  *         from pickle import PickleError as __pyx_PickleError
26742  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)             # <<<<<<<<<<<<<<
26743  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)
26744  *     if __pyx_state is not None:
26745  */
26746     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
26747     __Pyx_GOTREF(__pyx_t_2);
26748     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
26749     __Pyx_GOTREF(__pyx_t_4);
26750     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26751     __Pyx_INCREF(__pyx_v___pyx_PickleError);
26752     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
26753     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
26754       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
26755       if (likely(__pyx_t_5)) {
26756         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26757         __Pyx_INCREF(__pyx_t_5);
26758         __Pyx_INCREF(function);
26759         __Pyx_DECREF_SET(__pyx_t_2, function);
26760       }
26761     }
26762     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
26763     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
26764     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
26765     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
26766     __Pyx_GOTREF(__pyx_t_3);
26767     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26768     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
26769     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26770     __PYX_ERR(1, 6, __pyx_L1_error)
26771 
26772     /* "(tree fragment)":4
26773  *     cdef object __pyx_PickleError
26774  *     cdef object __pyx_result
26775  *     if __pyx_checksum != 0xd41d8cd:             # <<<<<<<<<<<<<<
26776  *         from pickle import PickleError as __pyx_PickleError
26777  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26778  */
26779   }
26780 
26781   /* "(tree fragment)":7
26782  *         from pickle import PickleError as __pyx_PickleError
26783  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26784  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
26785  *     if __pyx_state is not None:
26786  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26787  */
26788   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
26789   __Pyx_GOTREF(__pyx_t_2);
26790   __pyx_t_4 = NULL;
26791   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
26792     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
26793     if (likely(__pyx_t_4)) {
26794       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
26795       __Pyx_INCREF(__pyx_t_4);
26796       __Pyx_INCREF(function);
26797       __Pyx_DECREF_SET(__pyx_t_2, function);
26798     }
26799   }
26800   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
26801   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
26802   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
26803   __Pyx_GOTREF(__pyx_t_3);
26804   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
26805   __pyx_v___pyx_result = __pyx_t_3;
26806   __pyx_t_3 = 0;
26807 
26808   /* "(tree fragment)":8
26809  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26810  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)
26811  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26812  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26813  *     return __pyx_result
26814  */
26815   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
26816   __pyx_t_6 = (__pyx_t_1 != 0);
26817   if (__pyx_t_6) {
26818 
26819     /* "(tree fragment)":9
26820  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)
26821  *     if __pyx_state is not None:
26822  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
26823  *     return __pyx_result
26824  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
26825  */
26826     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
26827     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Measurement_Callables_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
26828     __Pyx_GOTREF(__pyx_t_3);
26829     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
26830 
26831     /* "(tree fragment)":8
26832  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xd41d8cd = ())" % __pyx_checksum)
26833  *     __pyx_result = Measurement_Callables_Cython.__new__(__pyx_type)
26834  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
26835  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26836  *     return __pyx_result
26837  */
26838   }
26839 
26840   /* "(tree fragment)":10
26841  *     if __pyx_state is not None:
26842  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26843  *     return __pyx_result             # <<<<<<<<<<<<<<
26844  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
26845  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26846  */
26847   __Pyx_XDECREF(__pyx_r);
26848   __Pyx_INCREF(__pyx_v___pyx_result);
26849   __pyx_r = __pyx_v___pyx_result;
26850   goto __pyx_L0;
26851 
26852   /* "(tree fragment)":1
26853  * def __pyx_unpickle_Measurement_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26854  *     cdef object __pyx_PickleError
26855  *     cdef object __pyx_result
26856  */
26857 
26858   /* function exit code */
26859   __pyx_L1_error:;
26860   __Pyx_XDECREF(__pyx_t_2);
26861   __Pyx_XDECREF(__pyx_t_3);
26862   __Pyx_XDECREF(__pyx_t_4);
26863   __Pyx_XDECREF(__pyx_t_5);
26864   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Measurement_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
26865   __pyx_r = NULL;
26866   __pyx_L0:;
26867   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
26868   __Pyx_XDECREF(__pyx_v___pyx_result);
26869   __Pyx_XGIVEREF(__pyx_r);
26870   __Pyx_RefNannyFinishContext();
26871   return __pyx_r;
26872 }
26873 
26874 /* "(tree fragment)":11
26875  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26876  *     return __pyx_result
26877  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26878  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26879  *         __pyx_result.__dict__.update(__pyx_state[0])
26880  */
26881 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)26882 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
26883   PyObject *__pyx_r = NULL;
26884   __Pyx_RefNannyDeclarations
26885   int __pyx_t_1;
26886   Py_ssize_t __pyx_t_2;
26887   int __pyx_t_3;
26888   int __pyx_t_4;
26889   PyObject *__pyx_t_5 = NULL;
26890   PyObject *__pyx_t_6 = NULL;
26891   PyObject *__pyx_t_7 = NULL;
26892   PyObject *__pyx_t_8 = NULL;
26893   int __pyx_lineno = 0;
26894   const char *__pyx_filename = NULL;
26895   int __pyx_clineno = 0;
26896   __Pyx_RefNannySetupContext("__pyx_unpickle_Measurement_Callables_Cython__set_state", 0);
26897 
26898   /* "(tree fragment)":12
26899  *     return __pyx_result
26900  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
26901  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26902  *         __pyx_result.__dict__.update(__pyx_state[0])
26903  */
26904   if (unlikely(__pyx_v___pyx_state == Py_None)) {
26905     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
26906     __PYX_ERR(1, 12, __pyx_L1_error)
26907   }
26908   __pyx_t_2 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(1, 12, __pyx_L1_error)
26909   __pyx_t_3 = ((__pyx_t_2 > 0) != 0);
26910   if (__pyx_t_3) {
26911   } else {
26912     __pyx_t_1 = __pyx_t_3;
26913     goto __pyx_L4_bool_binop_done;
26914   }
26915   __pyx_t_3 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 12, __pyx_L1_error)
26916   __pyx_t_4 = (__pyx_t_3 != 0);
26917   __pyx_t_1 = __pyx_t_4;
26918   __pyx_L4_bool_binop_done:;
26919   if (__pyx_t_1) {
26920 
26921     /* "(tree fragment)":13
26922  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
26923  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26924  *         __pyx_result.__dict__.update(__pyx_state[0])             # <<<<<<<<<<<<<<
26925  */
26926     __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
26927     __Pyx_GOTREF(__pyx_t_6);
26928     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 13, __pyx_L1_error)
26929     __Pyx_GOTREF(__pyx_t_7);
26930     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26931     if (unlikely(__pyx_v___pyx_state == Py_None)) {
26932       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
26933       __PYX_ERR(1, 13, __pyx_L1_error)
26934     }
26935     __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
26936     __Pyx_GOTREF(__pyx_t_6);
26937     __pyx_t_8 = NULL;
26938     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
26939       __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
26940       if (likely(__pyx_t_8)) {
26941         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
26942         __Pyx_INCREF(__pyx_t_8);
26943         __Pyx_INCREF(function);
26944         __Pyx_DECREF_SET(__pyx_t_7, function);
26945       }
26946     }
26947     __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
26948     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
26949     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
26950     if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
26951     __Pyx_GOTREF(__pyx_t_5);
26952     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
26953     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
26954 
26955     /* "(tree fragment)":12
26956  *     return __pyx_result
26957  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
26958  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
26959  *         __pyx_result.__dict__.update(__pyx_state[0])
26960  */
26961   }
26962 
26963   /* "(tree fragment)":11
26964  *         __pyx_unpickle_Measurement_Callables_Cython__set_state(<Measurement_Callables_Cython> __pyx_result, __pyx_state)
26965  *     return __pyx_result
26966  * cdef __pyx_unpickle_Measurement_Callables_Cython__set_state(Measurement_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
26967  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
26968  *         __pyx_result.__dict__.update(__pyx_state[0])
26969  */
26970 
26971   /* function exit code */
26972   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
26973   goto __pyx_L0;
26974   __pyx_L1_error:;
26975   __Pyx_XDECREF(__pyx_t_5);
26976   __Pyx_XDECREF(__pyx_t_6);
26977   __Pyx_XDECREF(__pyx_t_7);
26978   __Pyx_XDECREF(__pyx_t_8);
26979   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Measurement_Callables_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
26980   __pyx_r = 0;
26981   __pyx_L0:;
26982   __Pyx_XGIVEREF(__pyx_r);
26983   __Pyx_RefNannyFinishContext();
26984   return __pyx_r;
26985 }
26986 
26987 /* "(tree fragment)":1
26988  * def __pyx_unpickle_R_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
26989  *     cdef object __pyx_PickleError
26990  *     cdef object __pyx_result
26991  */
26992 
26993 /* Python wrapper */
26994 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
26995 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython = {"__pyx_unpickle_R_handling_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)26996 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26997   PyObject *__pyx_v___pyx_type = 0;
26998   long __pyx_v___pyx_checksum;
26999   PyObject *__pyx_v___pyx_state = 0;
27000   int __pyx_lineno = 0;
27001   const char *__pyx_filename = NULL;
27002   int __pyx_clineno = 0;
27003   PyObject *__pyx_r = 0;
27004   __Pyx_RefNannyDeclarations
27005   __Pyx_RefNannySetupContext("__pyx_unpickle_R_handling_Cython (wrapper)", 0);
27006   {
27007     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
27008     PyObject* values[3] = {0,0,0};
27009     if (unlikely(__pyx_kwds)) {
27010       Py_ssize_t kw_args;
27011       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
27012       switch (pos_args) {
27013         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27014         CYTHON_FALLTHROUGH;
27015         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27016         CYTHON_FALLTHROUGH;
27017         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27018         CYTHON_FALLTHROUGH;
27019         case  0: break;
27020         default: goto __pyx_L5_argtuple_error;
27021       }
27022       kw_args = PyDict_Size(__pyx_kwds);
27023       switch (pos_args) {
27024         case  0:
27025         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
27026         else goto __pyx_L5_argtuple_error;
27027         CYTHON_FALLTHROUGH;
27028         case  1:
27029         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
27030         else {
27031           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_R_handling_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
27032         }
27033         CYTHON_FALLTHROUGH;
27034         case  2:
27035         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
27036         else {
27037           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_R_handling_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
27038         }
27039       }
27040       if (unlikely(kw_args > 0)) {
27041         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_R_handling_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
27042       }
27043     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
27044       goto __pyx_L5_argtuple_error;
27045     } else {
27046       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27047       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27048       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27049     }
27050     __pyx_v___pyx_type = values[0];
27051     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
27052     __pyx_v___pyx_state = values[2];
27053   }
27054   goto __pyx_L4_argument_unpacking_done;
27055   __pyx_L5_argtuple_error:;
27056   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_R_handling_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
27057   __pyx_L3_error:;
27058   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_R_handling_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
27059   __Pyx_RefNannyFinishContext();
27060   return NULL;
27061   __pyx_L4_argument_unpacking_done:;
27062   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_10__pyx_unpickle_R_handling_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
27063 
27064   /* function exit code */
27065   __Pyx_RefNannyFinishContext();
27066   return __pyx_r;
27067 }
27068 
__pyx_pf_3GPy_6models_18state_space_cython_10__pyx_unpickle_R_handling_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)27069 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_10__pyx_unpickle_R_handling_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
27070   PyObject *__pyx_v___pyx_PickleError = 0;
27071   PyObject *__pyx_v___pyx_result = 0;
27072   PyObject *__pyx_r = NULL;
27073   __Pyx_RefNannyDeclarations
27074   int __pyx_t_1;
27075   PyObject *__pyx_t_2 = NULL;
27076   PyObject *__pyx_t_3 = NULL;
27077   PyObject *__pyx_t_4 = NULL;
27078   PyObject *__pyx_t_5 = NULL;
27079   int __pyx_t_6;
27080   int __pyx_lineno = 0;
27081   const char *__pyx_filename = NULL;
27082   int __pyx_clineno = 0;
27083   __Pyx_RefNannySetupContext("__pyx_unpickle_R_handling_Cython", 0);
27084 
27085   /* "(tree fragment)":4
27086  *     cdef object __pyx_PickleError
27087  *     cdef object __pyx_result
27088  *     if __pyx_checksum != 0x9e97ca7:             # <<<<<<<<<<<<<<
27089  *         from pickle import PickleError as __pyx_PickleError
27090  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27091  */
27092   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x9e97ca7) != 0);
27093   if (__pyx_t_1) {
27094 
27095     /* "(tree fragment)":5
27096  *     cdef object __pyx_result
27097  *     if __pyx_checksum != 0x9e97ca7:
27098  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
27099  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27100  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)
27101  */
27102     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
27103     __Pyx_GOTREF(__pyx_t_2);
27104     __Pyx_INCREF(__pyx_n_s_PickleError);
27105     __Pyx_GIVEREF(__pyx_n_s_PickleError);
27106     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
27107     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
27108     __Pyx_GOTREF(__pyx_t_3);
27109     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27110     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
27111     __Pyx_GOTREF(__pyx_t_2);
27112     __Pyx_INCREF(__pyx_t_2);
27113     __pyx_v___pyx_PickleError = __pyx_t_2;
27114     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27115     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27116 
27117     /* "(tree fragment)":6
27118  *     if __pyx_checksum != 0x9e97ca7:
27119  *         from pickle import PickleError as __pyx_PickleError
27120  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
27121  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)
27122  *     if __pyx_state is not None:
27123  */
27124     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
27125     __Pyx_GOTREF(__pyx_t_2);
27126     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x9e, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
27127     __Pyx_GOTREF(__pyx_t_4);
27128     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27129     __Pyx_INCREF(__pyx_v___pyx_PickleError);
27130     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
27131     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27132       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
27133       if (likely(__pyx_t_5)) {
27134         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27135         __Pyx_INCREF(__pyx_t_5);
27136         __Pyx_INCREF(function);
27137         __Pyx_DECREF_SET(__pyx_t_2, function);
27138       }
27139     }
27140     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
27141     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27142     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27143     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
27144     __Pyx_GOTREF(__pyx_t_3);
27145     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27146     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27147     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27148     __PYX_ERR(1, 6, __pyx_L1_error)
27149 
27150     /* "(tree fragment)":4
27151  *     cdef object __pyx_PickleError
27152  *     cdef object __pyx_result
27153  *     if __pyx_checksum != 0x9e97ca7:             # <<<<<<<<<<<<<<
27154  *         from pickle import PickleError as __pyx_PickleError
27155  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27156  */
27157   }
27158 
27159   /* "(tree fragment)":7
27160  *         from pickle import PickleError as __pyx_PickleError
27161  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27162  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
27163  *     if __pyx_state is not None:
27164  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27165  */
27166   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_R_handling_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
27167   __Pyx_GOTREF(__pyx_t_2);
27168   __pyx_t_4 = NULL;
27169   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
27170     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
27171     if (likely(__pyx_t_4)) {
27172       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27173       __Pyx_INCREF(__pyx_t_4);
27174       __Pyx_INCREF(function);
27175       __Pyx_DECREF_SET(__pyx_t_2, function);
27176     }
27177   }
27178   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
27179   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27180   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
27181   __Pyx_GOTREF(__pyx_t_3);
27182   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27183   __pyx_v___pyx_result = __pyx_t_3;
27184   __pyx_t_3 = 0;
27185 
27186   /* "(tree fragment)":8
27187  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27188  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)
27189  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
27190  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27191  *     return __pyx_result
27192  */
27193   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
27194   __pyx_t_6 = (__pyx_t_1 != 0);
27195   if (__pyx_t_6) {
27196 
27197     /* "(tree fragment)":9
27198  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)
27199  *     if __pyx_state is not None:
27200  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
27201  *     return __pyx_result
27202  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):
27203  */
27204     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
27205     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_R_handling_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
27206     __Pyx_GOTREF(__pyx_t_3);
27207     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27208 
27209     /* "(tree fragment)":8
27210  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x9e97ca7 = (R, R_square_root, R_time_var_index, dR, index, svd_each_time))" % __pyx_checksum)
27211  *     __pyx_result = R_handling_Cython.__new__(__pyx_type)
27212  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
27213  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27214  *     return __pyx_result
27215  */
27216   }
27217 
27218   /* "(tree fragment)":10
27219  *     if __pyx_state is not None:
27220  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27221  *     return __pyx_result             # <<<<<<<<<<<<<<
27222  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):
27223  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27224  */
27225   __Pyx_XDECREF(__pyx_r);
27226   __Pyx_INCREF(__pyx_v___pyx_result);
27227   __pyx_r = __pyx_v___pyx_result;
27228   goto __pyx_L0;
27229 
27230   /* "(tree fragment)":1
27231  * def __pyx_unpickle_R_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27232  *     cdef object __pyx_PickleError
27233  *     cdef object __pyx_result
27234  */
27235 
27236   /* function exit code */
27237   __pyx_L1_error:;
27238   __Pyx_XDECREF(__pyx_t_2);
27239   __Pyx_XDECREF(__pyx_t_3);
27240   __Pyx_XDECREF(__pyx_t_4);
27241   __Pyx_XDECREF(__pyx_t_5);
27242   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_R_handling_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
27243   __pyx_r = NULL;
27244   __pyx_L0:;
27245   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
27246   __Pyx_XDECREF(__pyx_v___pyx_result);
27247   __Pyx_XGIVEREF(__pyx_r);
27248   __Pyx_RefNannyFinishContext();
27249   return __pyx_r;
27250 }
27251 
27252 /* "(tree fragment)":11
27253  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27254  *     return __pyx_result
27255  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
27256  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27257  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
27258  */
27259 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_R_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)27260 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_R_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
27261   PyObject *__pyx_r = NULL;
27262   __Pyx_RefNannyDeclarations
27263   PyObject *__pyx_t_1 = NULL;
27264   int __pyx_t_2;
27265   int __pyx_t_3;
27266   Py_ssize_t __pyx_t_4;
27267   int __pyx_t_5;
27268   int __pyx_t_6;
27269   PyObject *__pyx_t_7 = NULL;
27270   PyObject *__pyx_t_8 = NULL;
27271   PyObject *__pyx_t_9 = NULL;
27272   int __pyx_lineno = 0;
27273   const char *__pyx_filename = NULL;
27274   int __pyx_clineno = 0;
27275   __Pyx_RefNannySetupContext("__pyx_unpickle_R_handling_Cython__set_state", 0);
27276 
27277   /* "(tree fragment)":12
27278  *     return __pyx_result
27279  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):
27280  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]             # <<<<<<<<<<<<<<
27281  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
27282  *         __pyx_result.__dict__.update(__pyx_state[6])
27283  */
27284   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27285     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27286     __PYX_ERR(1, 12, __pyx_L1_error)
27287   }
27288   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27289   __Pyx_GOTREF(__pyx_t_1);
27290   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27291   __Pyx_GIVEREF(__pyx_t_1);
27292   __Pyx_GOTREF(__pyx_v___pyx_result->R);
27293   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->R));
27294   __pyx_v___pyx_result->R = ((PyArrayObject *)__pyx_t_1);
27295   __pyx_t_1 = 0;
27296   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27297     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27298     __PYX_ERR(1, 12, __pyx_L1_error)
27299   }
27300   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27301   __Pyx_GOTREF(__pyx_t_1);
27302   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
27303   __Pyx_GIVEREF(__pyx_t_1);
27304   __Pyx_GOTREF(__pyx_v___pyx_result->R_square_root);
27305   __Pyx_DECREF(__pyx_v___pyx_result->R_square_root);
27306   __pyx_v___pyx_result->R_square_root = ((PyObject*)__pyx_t_1);
27307   __pyx_t_1 = 0;
27308   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27309     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27310     __PYX_ERR(1, 12, __pyx_L1_error)
27311   }
27312   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27313   __Pyx_GOTREF(__pyx_t_1);
27314   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
27315   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27316   __pyx_v___pyx_result->R_time_var_index = __pyx_t_2;
27317   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27318     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27319     __PYX_ERR(1, 12, __pyx_L1_error)
27320   }
27321   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27322   __Pyx_GOTREF(__pyx_t_1);
27323   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27324   __Pyx_GIVEREF(__pyx_t_1);
27325   __Pyx_GOTREF(__pyx_v___pyx_result->dR);
27326   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dR));
27327   __pyx_v___pyx_result->dR = ((PyArrayObject *)__pyx_t_1);
27328   __pyx_t_1 = 0;
27329   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27330     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27331     __PYX_ERR(1, 12, __pyx_L1_error)
27332   }
27333   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27334   __Pyx_GOTREF(__pyx_t_1);
27335   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27336   __Pyx_GIVEREF(__pyx_t_1);
27337   __Pyx_GOTREF(__pyx_v___pyx_result->index);
27338   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->index));
27339   __pyx_v___pyx_result->index = ((PyArrayObject *)__pyx_t_1);
27340   __pyx_t_1 = 0;
27341   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27342     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27343     __PYX_ERR(1, 12, __pyx_L1_error)
27344   }
27345   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27346   __Pyx_GOTREF(__pyx_t_1);
27347   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
27348   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27349   __pyx_v___pyx_result->svd_each_time = __pyx_t_3;
27350 
27351   /* "(tree fragment)":13
27352  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):
27353  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27354  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
27355  *         __pyx_result.__dict__.update(__pyx_state[6])
27356  */
27357   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27358     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
27359     __PYX_ERR(1, 13, __pyx_L1_error)
27360   }
27361   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
27362   __pyx_t_5 = ((__pyx_t_4 > 6) != 0);
27363   if (__pyx_t_5) {
27364   } else {
27365     __pyx_t_3 = __pyx_t_5;
27366     goto __pyx_L4_bool_binop_done;
27367   }
27368   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
27369   __pyx_t_6 = (__pyx_t_5 != 0);
27370   __pyx_t_3 = __pyx_t_6;
27371   __pyx_L4_bool_binop_done:;
27372   if (__pyx_t_3) {
27373 
27374     /* "(tree fragment)":14
27375  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27376  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
27377  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
27378  */
27379     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
27380     __Pyx_GOTREF(__pyx_t_7);
27381     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
27382     __Pyx_GOTREF(__pyx_t_8);
27383     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27384     if (unlikely(__pyx_v___pyx_state == Py_None)) {
27385       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27386       __PYX_ERR(1, 14, __pyx_L1_error)
27387     }
27388     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
27389     __Pyx_GOTREF(__pyx_t_7);
27390     __pyx_t_9 = NULL;
27391     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
27392       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
27393       if (likely(__pyx_t_9)) {
27394         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
27395         __Pyx_INCREF(__pyx_t_9);
27396         __Pyx_INCREF(function);
27397         __Pyx_DECREF_SET(__pyx_t_8, function);
27398       }
27399     }
27400     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
27401     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27402     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27403     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
27404     __Pyx_GOTREF(__pyx_t_1);
27405     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
27406     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27407 
27408     /* "(tree fragment)":13
27409  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):
27410  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27411  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
27412  *         __pyx_result.__dict__.update(__pyx_state[6])
27413  */
27414   }
27415 
27416   /* "(tree fragment)":11
27417  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
27418  *     return __pyx_result
27419  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
27420  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
27421  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
27422  */
27423 
27424   /* function exit code */
27425   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27426   goto __pyx_L0;
27427   __pyx_L1_error:;
27428   __Pyx_XDECREF(__pyx_t_1);
27429   __Pyx_XDECREF(__pyx_t_7);
27430   __Pyx_XDECREF(__pyx_t_8);
27431   __Pyx_XDECREF(__pyx_t_9);
27432   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_R_handling_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
27433   __pyx_r = 0;
27434   __pyx_L0:;
27435   __Pyx_XGIVEREF(__pyx_r);
27436   __Pyx_RefNannyFinishContext();
27437   return __pyx_r;
27438 }
27439 
27440 /* "(tree fragment)":1
27441  * def __pyx_unpickle_Std_Measurement_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27442  *     cdef object __pyx_PickleError
27443  *     cdef object __pyx_result
27444  */
27445 
27446 /* Python wrapper */
27447 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
27448 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython = {"__pyx_unpickle_Std_Measurement_Callables_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)27449 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
27450   PyObject *__pyx_v___pyx_type = 0;
27451   long __pyx_v___pyx_checksum;
27452   PyObject *__pyx_v___pyx_state = 0;
27453   int __pyx_lineno = 0;
27454   const char *__pyx_filename = NULL;
27455   int __pyx_clineno = 0;
27456   PyObject *__pyx_r = 0;
27457   __Pyx_RefNannyDeclarations
27458   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Measurement_Callables_Cython (wrapper)", 0);
27459   {
27460     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
27461     PyObject* values[3] = {0,0,0};
27462     if (unlikely(__pyx_kwds)) {
27463       Py_ssize_t kw_args;
27464       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
27465       switch (pos_args) {
27466         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27467         CYTHON_FALLTHROUGH;
27468         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27469         CYTHON_FALLTHROUGH;
27470         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27471         CYTHON_FALLTHROUGH;
27472         case  0: break;
27473         default: goto __pyx_L5_argtuple_error;
27474       }
27475       kw_args = PyDict_Size(__pyx_kwds);
27476       switch (pos_args) {
27477         case  0:
27478         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
27479         else goto __pyx_L5_argtuple_error;
27480         CYTHON_FALLTHROUGH;
27481         case  1:
27482         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
27483         else {
27484           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Measurement_Callables_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
27485         }
27486         CYTHON_FALLTHROUGH;
27487         case  2:
27488         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
27489         else {
27490           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Measurement_Callables_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
27491         }
27492       }
27493       if (unlikely(kw_args > 0)) {
27494         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Std_Measurement_Callables_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
27495       }
27496     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
27497       goto __pyx_L5_argtuple_error;
27498     } else {
27499       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27500       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27501       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27502     }
27503     __pyx_v___pyx_type = values[0];
27504     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
27505     __pyx_v___pyx_state = values[2];
27506   }
27507   goto __pyx_L4_argument_unpacking_done;
27508   __pyx_L5_argtuple_error:;
27509   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Measurement_Callables_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
27510   __pyx_L3_error:;
27511   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Measurement_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
27512   __Pyx_RefNannyFinishContext();
27513   return NULL;
27514   __pyx_L4_argument_unpacking_done:;
27515   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_12__pyx_unpickle_Std_Measurement_Callables_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
27516 
27517   /* function exit code */
27518   __Pyx_RefNannyFinishContext();
27519   return __pyx_r;
27520 }
27521 
__pyx_pf_3GPy_6models_18state_space_cython_12__pyx_unpickle_Std_Measurement_Callables_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)27522 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_12__pyx_unpickle_Std_Measurement_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
27523   PyObject *__pyx_v___pyx_PickleError = 0;
27524   PyObject *__pyx_v___pyx_result = 0;
27525   PyObject *__pyx_r = NULL;
27526   __Pyx_RefNannyDeclarations
27527   int __pyx_t_1;
27528   PyObject *__pyx_t_2 = NULL;
27529   PyObject *__pyx_t_3 = NULL;
27530   PyObject *__pyx_t_4 = NULL;
27531   PyObject *__pyx_t_5 = NULL;
27532   int __pyx_t_6;
27533   int __pyx_lineno = 0;
27534   const char *__pyx_filename = NULL;
27535   int __pyx_clineno = 0;
27536   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Measurement_Callables_Cython", 0);
27537 
27538   /* "(tree fragment)":4
27539  *     cdef object __pyx_PickleError
27540  *     cdef object __pyx_result
27541  *     if __pyx_checksum != 0x706c35f:             # <<<<<<<<<<<<<<
27542  *         from pickle import PickleError as __pyx_PickleError
27543  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27544  */
27545   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x706c35f) != 0);
27546   if (__pyx_t_1) {
27547 
27548     /* "(tree fragment)":5
27549  *     cdef object __pyx_result
27550  *     if __pyx_checksum != 0x706c35f:
27551  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
27552  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27553  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)
27554  */
27555     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
27556     __Pyx_GOTREF(__pyx_t_2);
27557     __Pyx_INCREF(__pyx_n_s_PickleError);
27558     __Pyx_GIVEREF(__pyx_n_s_PickleError);
27559     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
27560     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
27561     __Pyx_GOTREF(__pyx_t_3);
27562     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27563     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
27564     __Pyx_GOTREF(__pyx_t_2);
27565     __Pyx_INCREF(__pyx_t_2);
27566     __pyx_v___pyx_PickleError = __pyx_t_2;
27567     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27568     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27569 
27570     /* "(tree fragment)":6
27571  *     if __pyx_checksum != 0x706c35f:
27572  *         from pickle import PickleError as __pyx_PickleError
27573  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
27574  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)
27575  *     if __pyx_state is not None:
27576  */
27577     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
27578     __Pyx_GOTREF(__pyx_t_2);
27579     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x70, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
27580     __Pyx_GOTREF(__pyx_t_4);
27581     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27582     __Pyx_INCREF(__pyx_v___pyx_PickleError);
27583     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
27584     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
27585       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
27586       if (likely(__pyx_t_5)) {
27587         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27588         __Pyx_INCREF(__pyx_t_5);
27589         __Pyx_INCREF(function);
27590         __Pyx_DECREF_SET(__pyx_t_2, function);
27591       }
27592     }
27593     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
27594     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
27595     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
27596     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
27597     __Pyx_GOTREF(__pyx_t_3);
27598     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27599     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
27600     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27601     __PYX_ERR(1, 6, __pyx_L1_error)
27602 
27603     /* "(tree fragment)":4
27604  *     cdef object __pyx_PickleError
27605  *     cdef object __pyx_result
27606  *     if __pyx_checksum != 0x706c35f:             # <<<<<<<<<<<<<<
27607  *         from pickle import PickleError as __pyx_PickleError
27608  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27609  */
27610   }
27611 
27612   /* "(tree fragment)":7
27613  *         from pickle import PickleError as __pyx_PickleError
27614  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27615  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
27616  *     if __pyx_state is not None:
27617  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27618  */
27619   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
27620   __Pyx_GOTREF(__pyx_t_2);
27621   __pyx_t_4 = NULL;
27622   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
27623     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
27624     if (likely(__pyx_t_4)) {
27625       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
27626       __Pyx_INCREF(__pyx_t_4);
27627       __Pyx_INCREF(function);
27628       __Pyx_DECREF_SET(__pyx_t_2, function);
27629     }
27630   }
27631   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
27632   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
27633   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
27634   __Pyx_GOTREF(__pyx_t_3);
27635   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
27636   __pyx_v___pyx_result = __pyx_t_3;
27637   __pyx_t_3 = 0;
27638 
27639   /* "(tree fragment)":8
27640  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27641  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)
27642  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
27643  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27644  *     return __pyx_result
27645  */
27646   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
27647   __pyx_t_6 = (__pyx_t_1 != 0);
27648   if (__pyx_t_6) {
27649 
27650     /* "(tree fragment)":9
27651  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)
27652  *     if __pyx_state is not None:
27653  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
27654  *     return __pyx_result
27655  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
27656  */
27657     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
27658     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Measurement_Callables_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
27659     __Pyx_GOTREF(__pyx_t_3);
27660     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
27661 
27662     /* "(tree fragment)":8
27663  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x706c35f = (H, H_time_var_index, R, R_square_root, R_time_var_index, dH, dR, index, svd_each_time))" % __pyx_checksum)
27664  *     __pyx_result = Std_Measurement_Callables_Cython.__new__(__pyx_type)
27665  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
27666  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27667  *     return __pyx_result
27668  */
27669   }
27670 
27671   /* "(tree fragment)":10
27672  *     if __pyx_state is not None:
27673  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27674  *     return __pyx_result             # <<<<<<<<<<<<<<
27675  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
27676  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27677  */
27678   __Pyx_XDECREF(__pyx_r);
27679   __Pyx_INCREF(__pyx_v___pyx_result);
27680   __pyx_r = __pyx_v___pyx_result;
27681   goto __pyx_L0;
27682 
27683   /* "(tree fragment)":1
27684  * def __pyx_unpickle_Std_Measurement_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27685  *     cdef object __pyx_PickleError
27686  *     cdef object __pyx_result
27687  */
27688 
27689   /* function exit code */
27690   __pyx_L1_error:;
27691   __Pyx_XDECREF(__pyx_t_2);
27692   __Pyx_XDECREF(__pyx_t_3);
27693   __Pyx_XDECREF(__pyx_t_4);
27694   __Pyx_XDECREF(__pyx_t_5);
27695   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Measurement_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
27696   __pyx_r = NULL;
27697   __pyx_L0:;
27698   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
27699   __Pyx_XDECREF(__pyx_v___pyx_result);
27700   __Pyx_XGIVEREF(__pyx_r);
27701   __Pyx_RefNannyFinishContext();
27702   return __pyx_r;
27703 }
27704 
27705 /* "(tree fragment)":11
27706  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27707  *     return __pyx_result
27708  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
27709  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27710  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
27711  */
27712 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)27713 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Measurement_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
27714   PyObject *__pyx_r = NULL;
27715   __Pyx_RefNannyDeclarations
27716   PyObject *__pyx_t_1 = NULL;
27717   int __pyx_t_2;
27718   int __pyx_t_3;
27719   Py_ssize_t __pyx_t_4;
27720   int __pyx_t_5;
27721   int __pyx_t_6;
27722   PyObject *__pyx_t_7 = NULL;
27723   PyObject *__pyx_t_8 = NULL;
27724   PyObject *__pyx_t_9 = NULL;
27725   int __pyx_lineno = 0;
27726   const char *__pyx_filename = NULL;
27727   int __pyx_clineno = 0;
27728   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Measurement_Callables_Cython__set_state", 0);
27729 
27730   /* "(tree fragment)":12
27731  *     return __pyx_result
27732  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
27733  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]             # <<<<<<<<<<<<<<
27734  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
27735  *         __pyx_result.__dict__.update(__pyx_state[9])
27736  */
27737   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27738     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27739     __PYX_ERR(1, 12, __pyx_L1_error)
27740   }
27741   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27742   __Pyx_GOTREF(__pyx_t_1);
27743   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27744   __Pyx_GIVEREF(__pyx_t_1);
27745   __Pyx_GOTREF(__pyx_v___pyx_result->H);
27746   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->H));
27747   __pyx_v___pyx_result->H = ((PyArrayObject *)__pyx_t_1);
27748   __pyx_t_1 = 0;
27749   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27750     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27751     __PYX_ERR(1, 12, __pyx_L1_error)
27752   }
27753   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27754   __Pyx_GOTREF(__pyx_t_1);
27755   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
27756   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27757   __pyx_v___pyx_result->H_time_var_index = __pyx_t_2;
27758   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27759     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27760     __PYX_ERR(1, 12, __pyx_L1_error)
27761   }
27762   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27763   __Pyx_GOTREF(__pyx_t_1);
27764   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27765   __Pyx_GIVEREF(__pyx_t_1);
27766   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.R);
27767   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.R));
27768   __pyx_v___pyx_result->__pyx_base.R = ((PyArrayObject *)__pyx_t_1);
27769   __pyx_t_1 = 0;
27770   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27771     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27772     __PYX_ERR(1, 12, __pyx_L1_error)
27773   }
27774   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27775   __Pyx_GOTREF(__pyx_t_1);
27776   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
27777   __Pyx_GIVEREF(__pyx_t_1);
27778   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.R_square_root);
27779   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.R_square_root);
27780   __pyx_v___pyx_result->__pyx_base.R_square_root = ((PyObject*)__pyx_t_1);
27781   __pyx_t_1 = 0;
27782   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27783     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27784     __PYX_ERR(1, 12, __pyx_L1_error)
27785   }
27786   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27787   __Pyx_GOTREF(__pyx_t_1);
27788   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
27789   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27790   __pyx_v___pyx_result->__pyx_base.R_time_var_index = __pyx_t_2;
27791   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27792     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27793     __PYX_ERR(1, 12, __pyx_L1_error)
27794   }
27795   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27796   __Pyx_GOTREF(__pyx_t_1);
27797   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27798   __Pyx_GIVEREF(__pyx_t_1);
27799   __Pyx_GOTREF(__pyx_v___pyx_result->dH);
27800   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dH));
27801   __pyx_v___pyx_result->dH = ((PyArrayObject *)__pyx_t_1);
27802   __pyx_t_1 = 0;
27803   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27804     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27805     __PYX_ERR(1, 12, __pyx_L1_error)
27806   }
27807   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27808   __Pyx_GOTREF(__pyx_t_1);
27809   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27810   __Pyx_GIVEREF(__pyx_t_1);
27811   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.dR);
27812   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.dR));
27813   __pyx_v___pyx_result->__pyx_base.dR = ((PyArrayObject *)__pyx_t_1);
27814   __pyx_t_1 = 0;
27815   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27816     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27817     __PYX_ERR(1, 12, __pyx_L1_error)
27818   }
27819   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27820   __Pyx_GOTREF(__pyx_t_1);
27821   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
27822   __Pyx_GIVEREF(__pyx_t_1);
27823   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.index);
27824   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.index));
27825   __pyx_v___pyx_result->__pyx_base.index = ((PyArrayObject *)__pyx_t_1);
27826   __pyx_t_1 = 0;
27827   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27828     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27829     __PYX_ERR(1, 12, __pyx_L1_error)
27830   }
27831   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
27832   __Pyx_GOTREF(__pyx_t_1);
27833   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
27834   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27835   __pyx_v___pyx_result->__pyx_base.svd_each_time = __pyx_t_3;
27836 
27837   /* "(tree fragment)":13
27838  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
27839  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27840  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
27841  *         __pyx_result.__dict__.update(__pyx_state[9])
27842  */
27843   if (unlikely(__pyx_v___pyx_state == Py_None)) {
27844     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
27845     __PYX_ERR(1, 13, __pyx_L1_error)
27846   }
27847   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
27848   __pyx_t_5 = ((__pyx_t_4 > 9) != 0);
27849   if (__pyx_t_5) {
27850   } else {
27851     __pyx_t_3 = __pyx_t_5;
27852     goto __pyx_L4_bool_binop_done;
27853   }
27854   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
27855   __pyx_t_6 = (__pyx_t_5 != 0);
27856   __pyx_t_3 = __pyx_t_6;
27857   __pyx_L4_bool_binop_done:;
27858   if (__pyx_t_3) {
27859 
27860     /* "(tree fragment)":14
27861  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27862  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
27863  *         __pyx_result.__dict__.update(__pyx_state[9])             # <<<<<<<<<<<<<<
27864  */
27865     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
27866     __Pyx_GOTREF(__pyx_t_7);
27867     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
27868     __Pyx_GOTREF(__pyx_t_8);
27869     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27870     if (unlikely(__pyx_v___pyx_state == Py_None)) {
27871       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
27872       __PYX_ERR(1, 14, __pyx_L1_error)
27873     }
27874     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
27875     __Pyx_GOTREF(__pyx_t_7);
27876     __pyx_t_9 = NULL;
27877     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
27878       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
27879       if (likely(__pyx_t_9)) {
27880         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
27881         __Pyx_INCREF(__pyx_t_9);
27882         __Pyx_INCREF(function);
27883         __Pyx_DECREF_SET(__pyx_t_8, function);
27884       }
27885     }
27886     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
27887     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
27888     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
27889     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
27890     __Pyx_GOTREF(__pyx_t_1);
27891     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
27892     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
27893 
27894     /* "(tree fragment)":13
27895  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):
27896  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27897  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
27898  *         __pyx_result.__dict__.update(__pyx_state[9])
27899  */
27900   }
27901 
27902   /* "(tree fragment)":11
27903  *         __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(<Std_Measurement_Callables_Cython> __pyx_result, __pyx_state)
27904  *     return __pyx_result
27905  * cdef __pyx_unpickle_Std_Measurement_Callables_Cython__set_state(Std_Measurement_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
27906  *     __pyx_result.H = __pyx_state[0]; __pyx_result.H_time_var_index = __pyx_state[1]; __pyx_result.R = __pyx_state[2]; __pyx_result.R_square_root = __pyx_state[3]; __pyx_result.R_time_var_index = __pyx_state[4]; __pyx_result.dH = __pyx_state[5]; __pyx_result.dR = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
27907  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
27908  */
27909 
27910   /* function exit code */
27911   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
27912   goto __pyx_L0;
27913   __pyx_L1_error:;
27914   __Pyx_XDECREF(__pyx_t_1);
27915   __Pyx_XDECREF(__pyx_t_7);
27916   __Pyx_XDECREF(__pyx_t_8);
27917   __Pyx_XDECREF(__pyx_t_9);
27918   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Measurement_Callables_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
27919   __pyx_r = 0;
27920   __pyx_L0:;
27921   __Pyx_XGIVEREF(__pyx_r);
27922   __Pyx_RefNannyFinishContext();
27923   return __pyx_r;
27924 }
27925 
27926 /* "(tree fragment)":1
27927  * def __pyx_unpickle_Q_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
27928  *     cdef object __pyx_PickleError
27929  *     cdef object __pyx_result
27930  */
27931 
27932 /* Python wrapper */
27933 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
27934 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython = {"__pyx_unpickle_Q_handling_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)27935 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
27936   PyObject *__pyx_v___pyx_type = 0;
27937   long __pyx_v___pyx_checksum;
27938   PyObject *__pyx_v___pyx_state = 0;
27939   int __pyx_lineno = 0;
27940   const char *__pyx_filename = NULL;
27941   int __pyx_clineno = 0;
27942   PyObject *__pyx_r = 0;
27943   __Pyx_RefNannyDeclarations
27944   __Pyx_RefNannySetupContext("__pyx_unpickle_Q_handling_Cython (wrapper)", 0);
27945   {
27946     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
27947     PyObject* values[3] = {0,0,0};
27948     if (unlikely(__pyx_kwds)) {
27949       Py_ssize_t kw_args;
27950       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
27951       switch (pos_args) {
27952         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27953         CYTHON_FALLTHROUGH;
27954         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27955         CYTHON_FALLTHROUGH;
27956         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27957         CYTHON_FALLTHROUGH;
27958         case  0: break;
27959         default: goto __pyx_L5_argtuple_error;
27960       }
27961       kw_args = PyDict_Size(__pyx_kwds);
27962       switch (pos_args) {
27963         case  0:
27964         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
27965         else goto __pyx_L5_argtuple_error;
27966         CYTHON_FALLTHROUGH;
27967         case  1:
27968         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
27969         else {
27970           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Q_handling_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
27971         }
27972         CYTHON_FALLTHROUGH;
27973         case  2:
27974         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
27975         else {
27976           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Q_handling_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
27977         }
27978       }
27979       if (unlikely(kw_args > 0)) {
27980         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Q_handling_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
27981       }
27982     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
27983       goto __pyx_L5_argtuple_error;
27984     } else {
27985       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
27986       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
27987       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
27988     }
27989     __pyx_v___pyx_type = values[0];
27990     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
27991     __pyx_v___pyx_state = values[2];
27992   }
27993   goto __pyx_L4_argument_unpacking_done;
27994   __pyx_L5_argtuple_error:;
27995   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Q_handling_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
27996   __pyx_L3_error:;
27997   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Q_handling_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
27998   __Pyx_RefNannyFinishContext();
27999   return NULL;
28000   __pyx_L4_argument_unpacking_done:;
28001   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_14__pyx_unpickle_Q_handling_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
28002 
28003   /* function exit code */
28004   __Pyx_RefNannyFinishContext();
28005   return __pyx_r;
28006 }
28007 
__pyx_pf_3GPy_6models_18state_space_cython_14__pyx_unpickle_Q_handling_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)28008 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_14__pyx_unpickle_Q_handling_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
28009   PyObject *__pyx_v___pyx_PickleError = 0;
28010   PyObject *__pyx_v___pyx_result = 0;
28011   PyObject *__pyx_r = NULL;
28012   __Pyx_RefNannyDeclarations
28013   int __pyx_t_1;
28014   PyObject *__pyx_t_2 = NULL;
28015   PyObject *__pyx_t_3 = NULL;
28016   PyObject *__pyx_t_4 = NULL;
28017   PyObject *__pyx_t_5 = NULL;
28018   int __pyx_t_6;
28019   int __pyx_lineno = 0;
28020   const char *__pyx_filename = NULL;
28021   int __pyx_clineno = 0;
28022   __Pyx_RefNannySetupContext("__pyx_unpickle_Q_handling_Cython", 0);
28023 
28024   /* "(tree fragment)":4
28025  *     cdef object __pyx_PickleError
28026  *     cdef object __pyx_result
28027  *     if __pyx_checksum != 0x77b5360:             # <<<<<<<<<<<<<<
28028  *         from pickle import PickleError as __pyx_PickleError
28029  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28030  */
28031   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x77b5360) != 0);
28032   if (__pyx_t_1) {
28033 
28034     /* "(tree fragment)":5
28035  *     cdef object __pyx_result
28036  *     if __pyx_checksum != 0x77b5360:
28037  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
28038  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28039  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)
28040  */
28041     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28042     __Pyx_GOTREF(__pyx_t_2);
28043     __Pyx_INCREF(__pyx_n_s_PickleError);
28044     __Pyx_GIVEREF(__pyx_n_s_PickleError);
28045     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
28046     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
28047     __Pyx_GOTREF(__pyx_t_3);
28048     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28049     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28050     __Pyx_GOTREF(__pyx_t_2);
28051     __Pyx_INCREF(__pyx_t_2);
28052     __pyx_v___pyx_PickleError = __pyx_t_2;
28053     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28054     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28055 
28056     /* "(tree fragment)":6
28057  *     if __pyx_checksum != 0x77b5360:
28058  *         from pickle import PickleError as __pyx_PickleError
28059  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
28060  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)
28061  *     if __pyx_state is not None:
28062  */
28063     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
28064     __Pyx_GOTREF(__pyx_t_2);
28065     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
28066     __Pyx_GOTREF(__pyx_t_4);
28067     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28068     __Pyx_INCREF(__pyx_v___pyx_PickleError);
28069     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
28070     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
28071       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
28072       if (likely(__pyx_t_5)) {
28073         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28074         __Pyx_INCREF(__pyx_t_5);
28075         __Pyx_INCREF(function);
28076         __Pyx_DECREF_SET(__pyx_t_2, function);
28077       }
28078     }
28079     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
28080     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28081     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28082     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
28083     __Pyx_GOTREF(__pyx_t_3);
28084     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28085     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28086     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28087     __PYX_ERR(1, 6, __pyx_L1_error)
28088 
28089     /* "(tree fragment)":4
28090  *     cdef object __pyx_PickleError
28091  *     cdef object __pyx_result
28092  *     if __pyx_checksum != 0x77b5360:             # <<<<<<<<<<<<<<
28093  *         from pickle import PickleError as __pyx_PickleError
28094  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28095  */
28096   }
28097 
28098   /* "(tree fragment)":7
28099  *         from pickle import PickleError as __pyx_PickleError
28100  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28101  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
28102  *     if __pyx_state is not None:
28103  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28104  */
28105   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Q_handling_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
28106   __Pyx_GOTREF(__pyx_t_2);
28107   __pyx_t_4 = NULL;
28108   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
28109     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
28110     if (likely(__pyx_t_4)) {
28111       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28112       __Pyx_INCREF(__pyx_t_4);
28113       __Pyx_INCREF(function);
28114       __Pyx_DECREF_SET(__pyx_t_2, function);
28115     }
28116   }
28117   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
28118   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28119   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
28120   __Pyx_GOTREF(__pyx_t_3);
28121   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28122   __pyx_v___pyx_result = __pyx_t_3;
28123   __pyx_t_3 = 0;
28124 
28125   /* "(tree fragment)":8
28126  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28127  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)
28128  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
28129  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28130  *     return __pyx_result
28131  */
28132   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
28133   __pyx_t_6 = (__pyx_t_1 != 0);
28134   if (__pyx_t_6) {
28135 
28136     /* "(tree fragment)":9
28137  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)
28138  *     if __pyx_state is not None:
28139  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
28140  *     return __pyx_result
28141  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):
28142  */
28143     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
28144     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Q_handling_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
28145     __Pyx_GOTREF(__pyx_t_3);
28146     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28147 
28148     /* "(tree fragment)":8
28149  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x77b5360 = (Q, Q_square_root, Q_time_var_index, dQ, index, svd_each_time))" % __pyx_checksum)
28150  *     __pyx_result = Q_handling_Cython.__new__(__pyx_type)
28151  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
28152  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28153  *     return __pyx_result
28154  */
28155   }
28156 
28157   /* "(tree fragment)":10
28158  *     if __pyx_state is not None:
28159  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28160  *     return __pyx_result             # <<<<<<<<<<<<<<
28161  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):
28162  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28163  */
28164   __Pyx_XDECREF(__pyx_r);
28165   __Pyx_INCREF(__pyx_v___pyx_result);
28166   __pyx_r = __pyx_v___pyx_result;
28167   goto __pyx_L0;
28168 
28169   /* "(tree fragment)":1
28170  * def __pyx_unpickle_Q_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
28171  *     cdef object __pyx_PickleError
28172  *     cdef object __pyx_result
28173  */
28174 
28175   /* function exit code */
28176   __pyx_L1_error:;
28177   __Pyx_XDECREF(__pyx_t_2);
28178   __Pyx_XDECREF(__pyx_t_3);
28179   __Pyx_XDECREF(__pyx_t_4);
28180   __Pyx_XDECREF(__pyx_t_5);
28181   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Q_handling_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
28182   __pyx_r = NULL;
28183   __pyx_L0:;
28184   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
28185   __Pyx_XDECREF(__pyx_v___pyx_result);
28186   __Pyx_XGIVEREF(__pyx_r);
28187   __Pyx_RefNannyFinishContext();
28188   return __pyx_r;
28189 }
28190 
28191 /* "(tree fragment)":11
28192  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28193  *     return __pyx_result
28194  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
28195  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28196  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
28197  */
28198 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Q_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)28199 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Q_handling_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
28200   PyObject *__pyx_r = NULL;
28201   __Pyx_RefNannyDeclarations
28202   PyObject *__pyx_t_1 = NULL;
28203   int __pyx_t_2;
28204   int __pyx_t_3;
28205   Py_ssize_t __pyx_t_4;
28206   int __pyx_t_5;
28207   int __pyx_t_6;
28208   PyObject *__pyx_t_7 = NULL;
28209   PyObject *__pyx_t_8 = NULL;
28210   PyObject *__pyx_t_9 = NULL;
28211   int __pyx_lineno = 0;
28212   const char *__pyx_filename = NULL;
28213   int __pyx_clineno = 0;
28214   __Pyx_RefNannySetupContext("__pyx_unpickle_Q_handling_Cython__set_state", 0);
28215 
28216   /* "(tree fragment)":12
28217  *     return __pyx_result
28218  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):
28219  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]             # <<<<<<<<<<<<<<
28220  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
28221  *         __pyx_result.__dict__.update(__pyx_state[6])
28222  */
28223   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28224     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28225     __PYX_ERR(1, 12, __pyx_L1_error)
28226   }
28227   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28228   __Pyx_GOTREF(__pyx_t_1);
28229   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28230   __Pyx_GIVEREF(__pyx_t_1);
28231   __Pyx_GOTREF(__pyx_v___pyx_result->Q);
28232   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->Q));
28233   __pyx_v___pyx_result->Q = ((PyArrayObject *)__pyx_t_1);
28234   __pyx_t_1 = 0;
28235   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28236     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28237     __PYX_ERR(1, 12, __pyx_L1_error)
28238   }
28239   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28240   __Pyx_GOTREF(__pyx_t_1);
28241   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
28242   __Pyx_GIVEREF(__pyx_t_1);
28243   __Pyx_GOTREF(__pyx_v___pyx_result->Q_square_root);
28244   __Pyx_DECREF(__pyx_v___pyx_result->Q_square_root);
28245   __pyx_v___pyx_result->Q_square_root = ((PyObject*)__pyx_t_1);
28246   __pyx_t_1 = 0;
28247   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28248     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28249     __PYX_ERR(1, 12, __pyx_L1_error)
28250   }
28251   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28252   __Pyx_GOTREF(__pyx_t_1);
28253   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
28254   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28255   __pyx_v___pyx_result->Q_time_var_index = __pyx_t_2;
28256   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28257     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28258     __PYX_ERR(1, 12, __pyx_L1_error)
28259   }
28260   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28261   __Pyx_GOTREF(__pyx_t_1);
28262   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28263   __Pyx_GIVEREF(__pyx_t_1);
28264   __Pyx_GOTREF(__pyx_v___pyx_result->dQ);
28265   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dQ));
28266   __pyx_v___pyx_result->dQ = ((PyArrayObject *)__pyx_t_1);
28267   __pyx_t_1 = 0;
28268   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28269     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28270     __PYX_ERR(1, 12, __pyx_L1_error)
28271   }
28272   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28273   __Pyx_GOTREF(__pyx_t_1);
28274   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28275   __Pyx_GIVEREF(__pyx_t_1);
28276   __Pyx_GOTREF(__pyx_v___pyx_result->index);
28277   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->index));
28278   __pyx_v___pyx_result->index = ((PyArrayObject *)__pyx_t_1);
28279   __pyx_t_1 = 0;
28280   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28281     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28282     __PYX_ERR(1, 12, __pyx_L1_error)
28283   }
28284   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28285   __Pyx_GOTREF(__pyx_t_1);
28286   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
28287   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28288   __pyx_v___pyx_result->svd_each_time = __pyx_t_3;
28289 
28290   /* "(tree fragment)":13
28291  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):
28292  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28293  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
28294  *         __pyx_result.__dict__.update(__pyx_state[6])
28295  */
28296   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28297     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
28298     __PYX_ERR(1, 13, __pyx_L1_error)
28299   }
28300   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
28301   __pyx_t_5 = ((__pyx_t_4 > 6) != 0);
28302   if (__pyx_t_5) {
28303   } else {
28304     __pyx_t_3 = __pyx_t_5;
28305     goto __pyx_L4_bool_binop_done;
28306   }
28307   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
28308   __pyx_t_6 = (__pyx_t_5 != 0);
28309   __pyx_t_3 = __pyx_t_6;
28310   __pyx_L4_bool_binop_done:;
28311   if (__pyx_t_3) {
28312 
28313     /* "(tree fragment)":14
28314  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28315  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
28316  *         __pyx_result.__dict__.update(__pyx_state[6])             # <<<<<<<<<<<<<<
28317  */
28318     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
28319     __Pyx_GOTREF(__pyx_t_7);
28320     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
28321     __Pyx_GOTREF(__pyx_t_8);
28322     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28323     if (unlikely(__pyx_v___pyx_state == Py_None)) {
28324       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28325       __PYX_ERR(1, 14, __pyx_L1_error)
28326     }
28327     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
28328     __Pyx_GOTREF(__pyx_t_7);
28329     __pyx_t_9 = NULL;
28330     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
28331       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
28332       if (likely(__pyx_t_9)) {
28333         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
28334         __Pyx_INCREF(__pyx_t_9);
28335         __Pyx_INCREF(function);
28336         __Pyx_DECREF_SET(__pyx_t_8, function);
28337       }
28338     }
28339     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
28340     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
28341     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28342     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
28343     __Pyx_GOTREF(__pyx_t_1);
28344     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
28345     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28346 
28347     /* "(tree fragment)":13
28348  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):
28349  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28350  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
28351  *         __pyx_result.__dict__.update(__pyx_state[6])
28352  */
28353   }
28354 
28355   /* "(tree fragment)":11
28356  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
28357  *     return __pyx_result
28358  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
28359  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
28360  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
28361  */
28362 
28363   /* function exit code */
28364   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28365   goto __pyx_L0;
28366   __pyx_L1_error:;
28367   __Pyx_XDECREF(__pyx_t_1);
28368   __Pyx_XDECREF(__pyx_t_7);
28369   __Pyx_XDECREF(__pyx_t_8);
28370   __Pyx_XDECREF(__pyx_t_9);
28371   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Q_handling_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
28372   __pyx_r = 0;
28373   __pyx_L0:;
28374   __Pyx_XGIVEREF(__pyx_r);
28375   __Pyx_RefNannyFinishContext();
28376   return __pyx_r;
28377 }
28378 
28379 /* "(tree fragment)":1
28380  * def __pyx_unpickle_Std_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
28381  *     cdef object __pyx_PickleError
28382  *     cdef object __pyx_result
28383  */
28384 
28385 /* Python wrapper */
28386 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28387 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython = {"__pyx_unpickle_Std_Dynamic_Callables_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)28388 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28389   PyObject *__pyx_v___pyx_type = 0;
28390   long __pyx_v___pyx_checksum;
28391   PyObject *__pyx_v___pyx_state = 0;
28392   int __pyx_lineno = 0;
28393   const char *__pyx_filename = NULL;
28394   int __pyx_clineno = 0;
28395   PyObject *__pyx_r = 0;
28396   __Pyx_RefNannyDeclarations
28397   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Dynamic_Callables_Cython (wrapper)", 0);
28398   {
28399     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
28400     PyObject* values[3] = {0,0,0};
28401     if (unlikely(__pyx_kwds)) {
28402       Py_ssize_t kw_args;
28403       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28404       switch (pos_args) {
28405         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28406         CYTHON_FALLTHROUGH;
28407         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28408         CYTHON_FALLTHROUGH;
28409         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28410         CYTHON_FALLTHROUGH;
28411         case  0: break;
28412         default: goto __pyx_L5_argtuple_error;
28413       }
28414       kw_args = PyDict_Size(__pyx_kwds);
28415       switch (pos_args) {
28416         case  0:
28417         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
28418         else goto __pyx_L5_argtuple_error;
28419         CYTHON_FALLTHROUGH;
28420         case  1:
28421         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
28422         else {
28423           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Dynamic_Callables_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
28424         }
28425         CYTHON_FALLTHROUGH;
28426         case  2:
28427         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
28428         else {
28429           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Dynamic_Callables_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
28430         }
28431       }
28432       if (unlikely(kw_args > 0)) {
28433         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Std_Dynamic_Callables_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
28434       }
28435     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
28436       goto __pyx_L5_argtuple_error;
28437     } else {
28438       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28439       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28440       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28441     }
28442     __pyx_v___pyx_type = values[0];
28443     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
28444     __pyx_v___pyx_state = values[2];
28445   }
28446   goto __pyx_L4_argument_unpacking_done;
28447   __pyx_L5_argtuple_error:;
28448   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Std_Dynamic_Callables_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
28449   __pyx_L3_error:;
28450   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Dynamic_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
28451   __Pyx_RefNannyFinishContext();
28452   return NULL;
28453   __pyx_L4_argument_unpacking_done:;
28454   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_16__pyx_unpickle_Std_Dynamic_Callables_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
28455 
28456   /* function exit code */
28457   __Pyx_RefNannyFinishContext();
28458   return __pyx_r;
28459 }
28460 
__pyx_pf_3GPy_6models_18state_space_cython_16__pyx_unpickle_Std_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)28461 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_16__pyx_unpickle_Std_Dynamic_Callables_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
28462   PyObject *__pyx_v___pyx_PickleError = 0;
28463   PyObject *__pyx_v___pyx_result = 0;
28464   PyObject *__pyx_r = NULL;
28465   __Pyx_RefNannyDeclarations
28466   int __pyx_t_1;
28467   PyObject *__pyx_t_2 = NULL;
28468   PyObject *__pyx_t_3 = NULL;
28469   PyObject *__pyx_t_4 = NULL;
28470   PyObject *__pyx_t_5 = NULL;
28471   int __pyx_t_6;
28472   int __pyx_lineno = 0;
28473   const char *__pyx_filename = NULL;
28474   int __pyx_clineno = 0;
28475   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Dynamic_Callables_Cython", 0);
28476 
28477   /* "(tree fragment)":4
28478  *     cdef object __pyx_PickleError
28479  *     cdef object __pyx_result
28480  *     if __pyx_checksum != 0xdff0f56:             # <<<<<<<<<<<<<<
28481  *         from pickle import PickleError as __pyx_PickleError
28482  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28483  */
28484   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xdff0f56) != 0);
28485   if (__pyx_t_1) {
28486 
28487     /* "(tree fragment)":5
28488  *     cdef object __pyx_result
28489  *     if __pyx_checksum != 0xdff0f56:
28490  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
28491  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28492  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)
28493  */
28494     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28495     __Pyx_GOTREF(__pyx_t_2);
28496     __Pyx_INCREF(__pyx_n_s_PickleError);
28497     __Pyx_GIVEREF(__pyx_n_s_PickleError);
28498     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
28499     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
28500     __Pyx_GOTREF(__pyx_t_3);
28501     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28502     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28503     __Pyx_GOTREF(__pyx_t_2);
28504     __Pyx_INCREF(__pyx_t_2);
28505     __pyx_v___pyx_PickleError = __pyx_t_2;
28506     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28507     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28508 
28509     /* "(tree fragment)":6
28510  *     if __pyx_checksum != 0xdff0f56:
28511  *         from pickle import PickleError as __pyx_PickleError
28512  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
28513  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)
28514  *     if __pyx_state is not None:
28515  */
28516     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
28517     __Pyx_GOTREF(__pyx_t_2);
28518     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xdf, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
28519     __Pyx_GOTREF(__pyx_t_4);
28520     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28521     __Pyx_INCREF(__pyx_v___pyx_PickleError);
28522     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
28523     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
28524       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
28525       if (likely(__pyx_t_5)) {
28526         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28527         __Pyx_INCREF(__pyx_t_5);
28528         __Pyx_INCREF(function);
28529         __Pyx_DECREF_SET(__pyx_t_2, function);
28530       }
28531     }
28532     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
28533     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
28534     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
28535     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
28536     __Pyx_GOTREF(__pyx_t_3);
28537     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28538     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28539     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28540     __PYX_ERR(1, 6, __pyx_L1_error)
28541 
28542     /* "(tree fragment)":4
28543  *     cdef object __pyx_PickleError
28544  *     cdef object __pyx_result
28545  *     if __pyx_checksum != 0xdff0f56:             # <<<<<<<<<<<<<<
28546  *         from pickle import PickleError as __pyx_PickleError
28547  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28548  */
28549   }
28550 
28551   /* "(tree fragment)":7
28552  *         from pickle import PickleError as __pyx_PickleError
28553  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28554  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
28555  *     if __pyx_state is not None:
28556  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28557  */
28558   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
28559   __Pyx_GOTREF(__pyx_t_2);
28560   __pyx_t_4 = NULL;
28561   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
28562     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
28563     if (likely(__pyx_t_4)) {
28564       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
28565       __Pyx_INCREF(__pyx_t_4);
28566       __Pyx_INCREF(function);
28567       __Pyx_DECREF_SET(__pyx_t_2, function);
28568     }
28569   }
28570   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
28571   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
28572   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
28573   __Pyx_GOTREF(__pyx_t_3);
28574   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28575   __pyx_v___pyx_result = __pyx_t_3;
28576   __pyx_t_3 = 0;
28577 
28578   /* "(tree fragment)":8
28579  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28580  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)
28581  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
28582  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28583  *     return __pyx_result
28584  */
28585   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
28586   __pyx_t_6 = (__pyx_t_1 != 0);
28587   if (__pyx_t_6) {
28588 
28589     /* "(tree fragment)":9
28590  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)
28591  *     if __pyx_state is not None:
28592  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
28593  *     return __pyx_result
28594  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
28595  */
28596     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
28597     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
28598     __Pyx_GOTREF(__pyx_t_3);
28599     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28600 
28601     /* "(tree fragment)":8
28602  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xdff0f56 = (A, A_time_var_index, Q, Q_square_root, Q_time_var_index, dA, dQ, index, svd_each_time))" % __pyx_checksum)
28603  *     __pyx_result = Std_Dynamic_Callables_Cython.__new__(__pyx_type)
28604  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
28605  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28606  *     return __pyx_result
28607  */
28608   }
28609 
28610   /* "(tree fragment)":10
28611  *     if __pyx_state is not None:
28612  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28613  *     return __pyx_result             # <<<<<<<<<<<<<<
28614  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
28615  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28616  */
28617   __Pyx_XDECREF(__pyx_r);
28618   __Pyx_INCREF(__pyx_v___pyx_result);
28619   __pyx_r = __pyx_v___pyx_result;
28620   goto __pyx_L0;
28621 
28622   /* "(tree fragment)":1
28623  * def __pyx_unpickle_Std_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
28624  *     cdef object __pyx_PickleError
28625  *     cdef object __pyx_result
28626  */
28627 
28628   /* function exit code */
28629   __pyx_L1_error:;
28630   __Pyx_XDECREF(__pyx_t_2);
28631   __Pyx_XDECREF(__pyx_t_3);
28632   __Pyx_XDECREF(__pyx_t_4);
28633   __Pyx_XDECREF(__pyx_t_5);
28634   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Dynamic_Callables_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
28635   __pyx_r = NULL;
28636   __pyx_L0:;
28637   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
28638   __Pyx_XDECREF(__pyx_v___pyx_result);
28639   __Pyx_XGIVEREF(__pyx_r);
28640   __Pyx_RefNannyFinishContext();
28641   return __pyx_r;
28642 }
28643 
28644 /* "(tree fragment)":11
28645  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28646  *     return __pyx_result
28647  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
28648  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28649  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
28650  */
28651 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)28652 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
28653   PyObject *__pyx_r = NULL;
28654   __Pyx_RefNannyDeclarations
28655   PyObject *__pyx_t_1 = NULL;
28656   int __pyx_t_2;
28657   int __pyx_t_3;
28658   Py_ssize_t __pyx_t_4;
28659   int __pyx_t_5;
28660   int __pyx_t_6;
28661   PyObject *__pyx_t_7 = NULL;
28662   PyObject *__pyx_t_8 = NULL;
28663   PyObject *__pyx_t_9 = NULL;
28664   int __pyx_lineno = 0;
28665   const char *__pyx_filename = NULL;
28666   int __pyx_clineno = 0;
28667   __Pyx_RefNannySetupContext("__pyx_unpickle_Std_Dynamic_Callables_Cython__set_state", 0);
28668 
28669   /* "(tree fragment)":12
28670  *     return __pyx_result
28671  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
28672  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]             # <<<<<<<<<<<<<<
28673  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
28674  *         __pyx_result.__dict__.update(__pyx_state[9])
28675  */
28676   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28677     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28678     __PYX_ERR(1, 12, __pyx_L1_error)
28679   }
28680   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28681   __Pyx_GOTREF(__pyx_t_1);
28682   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28683   __Pyx_GIVEREF(__pyx_t_1);
28684   __Pyx_GOTREF(__pyx_v___pyx_result->A);
28685   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->A));
28686   __pyx_v___pyx_result->A = ((PyArrayObject *)__pyx_t_1);
28687   __pyx_t_1 = 0;
28688   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28689     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28690     __PYX_ERR(1, 12, __pyx_L1_error)
28691   }
28692   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28693   __Pyx_GOTREF(__pyx_t_1);
28694   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
28695   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28696   __pyx_v___pyx_result->A_time_var_index = __pyx_t_2;
28697   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28698     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28699     __PYX_ERR(1, 12, __pyx_L1_error)
28700   }
28701   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28702   __Pyx_GOTREF(__pyx_t_1);
28703   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28704   __Pyx_GIVEREF(__pyx_t_1);
28705   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.Q);
28706   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.Q));
28707   __pyx_v___pyx_result->__pyx_base.Q = ((PyArrayObject *)__pyx_t_1);
28708   __pyx_t_1 = 0;
28709   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28710     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28711     __PYX_ERR(1, 12, __pyx_L1_error)
28712   }
28713   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28714   __Pyx_GOTREF(__pyx_t_1);
28715   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
28716   __Pyx_GIVEREF(__pyx_t_1);
28717   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.Q_square_root);
28718   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.Q_square_root);
28719   __pyx_v___pyx_result->__pyx_base.Q_square_root = ((PyObject*)__pyx_t_1);
28720   __pyx_t_1 = 0;
28721   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28722     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28723     __PYX_ERR(1, 12, __pyx_L1_error)
28724   }
28725   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28726   __Pyx_GOTREF(__pyx_t_1);
28727   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
28728   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28729   __pyx_v___pyx_result->__pyx_base.Q_time_var_index = __pyx_t_2;
28730   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28731     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28732     __PYX_ERR(1, 12, __pyx_L1_error)
28733   }
28734   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28735   __Pyx_GOTREF(__pyx_t_1);
28736   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28737   __Pyx_GIVEREF(__pyx_t_1);
28738   __Pyx_GOTREF(__pyx_v___pyx_result->dA);
28739   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dA));
28740   __pyx_v___pyx_result->dA = ((PyArrayObject *)__pyx_t_1);
28741   __pyx_t_1 = 0;
28742   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28743     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28744     __PYX_ERR(1, 12, __pyx_L1_error)
28745   }
28746   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28747   __Pyx_GOTREF(__pyx_t_1);
28748   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28749   __Pyx_GIVEREF(__pyx_t_1);
28750   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.dQ);
28751   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.dQ));
28752   __pyx_v___pyx_result->__pyx_base.dQ = ((PyArrayObject *)__pyx_t_1);
28753   __pyx_t_1 = 0;
28754   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28755     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28756     __PYX_ERR(1, 12, __pyx_L1_error)
28757   }
28758   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28759   __Pyx_GOTREF(__pyx_t_1);
28760   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
28761   __Pyx_GIVEREF(__pyx_t_1);
28762   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.index);
28763   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.index));
28764   __pyx_v___pyx_result->__pyx_base.index = ((PyArrayObject *)__pyx_t_1);
28765   __pyx_t_1 = 0;
28766   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28767     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28768     __PYX_ERR(1, 12, __pyx_L1_error)
28769   }
28770   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
28771   __Pyx_GOTREF(__pyx_t_1);
28772   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
28773   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28774   __pyx_v___pyx_result->__pyx_base.svd_each_time = __pyx_t_3;
28775 
28776   /* "(tree fragment)":13
28777  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
28778  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28779  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
28780  *         __pyx_result.__dict__.update(__pyx_state[9])
28781  */
28782   if (unlikely(__pyx_v___pyx_state == Py_None)) {
28783     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
28784     __PYX_ERR(1, 13, __pyx_L1_error)
28785   }
28786   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
28787   __pyx_t_5 = ((__pyx_t_4 > 9) != 0);
28788   if (__pyx_t_5) {
28789   } else {
28790     __pyx_t_3 = __pyx_t_5;
28791     goto __pyx_L4_bool_binop_done;
28792   }
28793   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
28794   __pyx_t_6 = (__pyx_t_5 != 0);
28795   __pyx_t_3 = __pyx_t_6;
28796   __pyx_L4_bool_binop_done:;
28797   if (__pyx_t_3) {
28798 
28799     /* "(tree fragment)":14
28800  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28801  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
28802  *         __pyx_result.__dict__.update(__pyx_state[9])             # <<<<<<<<<<<<<<
28803  */
28804     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
28805     __Pyx_GOTREF(__pyx_t_7);
28806     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
28807     __Pyx_GOTREF(__pyx_t_8);
28808     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28809     if (unlikely(__pyx_v___pyx_state == Py_None)) {
28810       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
28811       __PYX_ERR(1, 14, __pyx_L1_error)
28812     }
28813     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
28814     __Pyx_GOTREF(__pyx_t_7);
28815     __pyx_t_9 = NULL;
28816     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
28817       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
28818       if (likely(__pyx_t_9)) {
28819         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
28820         __Pyx_INCREF(__pyx_t_9);
28821         __Pyx_INCREF(function);
28822         __Pyx_DECREF_SET(__pyx_t_8, function);
28823       }
28824     }
28825     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
28826     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
28827     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
28828     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
28829     __Pyx_GOTREF(__pyx_t_1);
28830     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
28831     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
28832 
28833     /* "(tree fragment)":13
28834  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):
28835  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28836  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
28837  *         __pyx_result.__dict__.update(__pyx_state[9])
28838  */
28839   }
28840 
28841   /* "(tree fragment)":11
28842  *         __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(<Std_Dynamic_Callables_Cython> __pyx_result, __pyx_state)
28843  *     return __pyx_result
28844  * cdef __pyx_unpickle_Std_Dynamic_Callables_Cython__set_state(Std_Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
28845  *     __pyx_result.A = __pyx_state[0]; __pyx_result.A_time_var_index = __pyx_state[1]; __pyx_result.Q = __pyx_state[2]; __pyx_result.Q_square_root = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.dA = __pyx_state[5]; __pyx_result.dQ = __pyx_state[6]; __pyx_result.index = __pyx_state[7]; __pyx_result.svd_each_time = __pyx_state[8]
28846  *     if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
28847  */
28848 
28849   /* function exit code */
28850   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
28851   goto __pyx_L0;
28852   __pyx_L1_error:;
28853   __Pyx_XDECREF(__pyx_t_1);
28854   __Pyx_XDECREF(__pyx_t_7);
28855   __Pyx_XDECREF(__pyx_t_8);
28856   __Pyx_XDECREF(__pyx_t_9);
28857   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_Std_Dynamic_Callables_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
28858   __pyx_r = 0;
28859   __pyx_L0:;
28860   __Pyx_XGIVEREF(__pyx_r);
28861   __Pyx_RefNannyFinishContext();
28862   return __pyx_r;
28863 }
28864 
28865 /* "(tree fragment)":1
28866  * def __pyx_unpickle_AQcompute_batch_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
28867  *     cdef object __pyx_PickleError
28868  *     cdef object __pyx_result
28869  */
28870 
28871 /* Python wrapper */
28872 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
28873 static PyMethodDef __pyx_mdef_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython = {"__pyx_unpickle_AQcompute_batch_Cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)28874 static PyObject *__pyx_pw_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
28875   PyObject *__pyx_v___pyx_type = 0;
28876   long __pyx_v___pyx_checksum;
28877   PyObject *__pyx_v___pyx_state = 0;
28878   int __pyx_lineno = 0;
28879   const char *__pyx_filename = NULL;
28880   int __pyx_clineno = 0;
28881   PyObject *__pyx_r = 0;
28882   __Pyx_RefNannyDeclarations
28883   __Pyx_RefNannySetupContext("__pyx_unpickle_AQcompute_batch_Cython (wrapper)", 0);
28884   {
28885     static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
28886     PyObject* values[3] = {0,0,0};
28887     if (unlikely(__pyx_kwds)) {
28888       Py_ssize_t kw_args;
28889       const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
28890       switch (pos_args) {
28891         case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28892         CYTHON_FALLTHROUGH;
28893         case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28894         CYTHON_FALLTHROUGH;
28895         case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28896         CYTHON_FALLTHROUGH;
28897         case  0: break;
28898         default: goto __pyx_L5_argtuple_error;
28899       }
28900       kw_args = PyDict_Size(__pyx_kwds);
28901       switch (pos_args) {
28902         case  0:
28903         if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
28904         else goto __pyx_L5_argtuple_error;
28905         CYTHON_FALLTHROUGH;
28906         case  1:
28907         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
28908         else {
28909           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AQcompute_batch_Cython", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
28910         }
28911         CYTHON_FALLTHROUGH;
28912         case  2:
28913         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
28914         else {
28915           __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AQcompute_batch_Cython", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
28916         }
28917       }
28918       if (unlikely(kw_args > 0)) {
28919         if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_AQcompute_batch_Cython") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
28920       }
28921     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
28922       goto __pyx_L5_argtuple_error;
28923     } else {
28924       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
28925       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
28926       values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
28927     }
28928     __pyx_v___pyx_type = values[0];
28929     __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
28930     __pyx_v___pyx_state = values[2];
28931   }
28932   goto __pyx_L4_argument_unpacking_done;
28933   __pyx_L5_argtuple_error:;
28934   __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_AQcompute_batch_Cython", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
28935   __pyx_L3_error:;
28936   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_AQcompute_batch_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
28937   __Pyx_RefNannyFinishContext();
28938   return NULL;
28939   __pyx_L4_argument_unpacking_done:;
28940   __pyx_r = __pyx_pf_3GPy_6models_18state_space_cython_18__pyx_unpickle_AQcompute_batch_Cython(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
28941 
28942   /* function exit code */
28943   __Pyx_RefNannyFinishContext();
28944   return __pyx_r;
28945 }
28946 
__pyx_pf_3GPy_6models_18state_space_cython_18__pyx_unpickle_AQcompute_batch_Cython(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v___pyx_type,long __pyx_v___pyx_checksum,PyObject * __pyx_v___pyx_state)28947 static PyObject *__pyx_pf_3GPy_6models_18state_space_cython_18__pyx_unpickle_AQcompute_batch_Cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
28948   PyObject *__pyx_v___pyx_PickleError = 0;
28949   PyObject *__pyx_v___pyx_result = 0;
28950   PyObject *__pyx_r = NULL;
28951   __Pyx_RefNannyDeclarations
28952   int __pyx_t_1;
28953   PyObject *__pyx_t_2 = NULL;
28954   PyObject *__pyx_t_3 = NULL;
28955   PyObject *__pyx_t_4 = NULL;
28956   PyObject *__pyx_t_5 = NULL;
28957   int __pyx_t_6;
28958   int __pyx_lineno = 0;
28959   const char *__pyx_filename = NULL;
28960   int __pyx_clineno = 0;
28961   __Pyx_RefNannySetupContext("__pyx_unpickle_AQcompute_batch_Cython", 0);
28962 
28963   /* "(tree fragment)":4
28964  *     cdef object __pyx_PickleError
28965  *     cdef object __pyx_result
28966  *     if __pyx_checksum != 0x146e1f7:             # <<<<<<<<<<<<<<
28967  *         from pickle import PickleError as __pyx_PickleError
28968  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
28969  */
28970   __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x146e1f7) != 0);
28971   if (__pyx_t_1) {
28972 
28973     /* "(tree fragment)":5
28974  *     cdef object __pyx_result
28975  *     if __pyx_checksum != 0x146e1f7:
28976  *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
28977  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
28978  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)
28979  */
28980     __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28981     __Pyx_GOTREF(__pyx_t_2);
28982     __Pyx_INCREF(__pyx_n_s_PickleError);
28983     __Pyx_GIVEREF(__pyx_n_s_PickleError);
28984     PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
28985     __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
28986     __Pyx_GOTREF(__pyx_t_3);
28987     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28988     __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
28989     __Pyx_GOTREF(__pyx_t_2);
28990     __Pyx_INCREF(__pyx_t_2);
28991     __pyx_v___pyx_PickleError = __pyx_t_2;
28992     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
28993     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
28994 
28995     /* "(tree fragment)":6
28996  *     if __pyx_checksum != 0x146e1f7:
28997  *         from pickle import PickleError as __pyx_PickleError
28998  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)             # <<<<<<<<<<<<<<
28999  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)
29000  *     if __pyx_state is not None:
29001  */
29002     __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
29003     __Pyx_GOTREF(__pyx_t_2);
29004     __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x14, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
29005     __Pyx_GOTREF(__pyx_t_4);
29006     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29007     __Pyx_INCREF(__pyx_v___pyx_PickleError);
29008     __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
29009     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
29010       __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
29011       if (likely(__pyx_t_5)) {
29012         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29013         __Pyx_INCREF(__pyx_t_5);
29014         __Pyx_INCREF(function);
29015         __Pyx_DECREF_SET(__pyx_t_2, function);
29016       }
29017     }
29018     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
29019     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
29020     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29021     if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
29022     __Pyx_GOTREF(__pyx_t_3);
29023     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29024     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
29025     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29026     __PYX_ERR(1, 6, __pyx_L1_error)
29027 
29028     /* "(tree fragment)":4
29029  *     cdef object __pyx_PickleError
29030  *     cdef object __pyx_result
29031  *     if __pyx_checksum != 0x146e1f7:             # <<<<<<<<<<<<<<
29032  *         from pickle import PickleError as __pyx_PickleError
29033  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
29034  */
29035   }
29036 
29037   /* "(tree fragment)":7
29038  *         from pickle import PickleError as __pyx_PickleError
29039  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
29040  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)             # <<<<<<<<<<<<<<
29041  *     if __pyx_state is not None:
29042  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29043  */
29044   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3GPy_6models_18state_space_cython_AQcompute_batch_Cython), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
29045   __Pyx_GOTREF(__pyx_t_2);
29046   __pyx_t_4 = NULL;
29047   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
29048     __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
29049     if (likely(__pyx_t_4)) {
29050       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
29051       __Pyx_INCREF(__pyx_t_4);
29052       __Pyx_INCREF(function);
29053       __Pyx_DECREF_SET(__pyx_t_2, function);
29054     }
29055   }
29056   __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
29057   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
29058   if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
29059   __Pyx_GOTREF(__pyx_t_3);
29060   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
29061   __pyx_v___pyx_result = __pyx_t_3;
29062   __pyx_t_3 = 0;
29063 
29064   /* "(tree fragment)":8
29065  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
29066  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)
29067  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29068  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29069  *     return __pyx_result
29070  */
29071   __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
29072   __pyx_t_6 = (__pyx_t_1 != 0);
29073   if (__pyx_t_6) {
29074 
29075     /* "(tree fragment)":9
29076  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)
29077  *     if __pyx_state is not None:
29078  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
29079  *     return __pyx_result
29080  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):
29081  */
29082     if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
29083     __pyx_t_3 = __pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_AQcompute_batch_Cython__set_state(((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
29084     __Pyx_GOTREF(__pyx_t_3);
29085     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
29086 
29087     /* "(tree fragment)":8
29088  *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x146e1f7 = (As, Q, Q_square_root, Q_svd_dict, Q_time_var_index, Qs, dAs, dQ, dQs, index, last_k, reconstruct_indices, svd_each_time))" % __pyx_checksum)
29089  *     __pyx_result = AQcompute_batch_Cython.__new__(__pyx_type)
29090  *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
29091  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29092  *     return __pyx_result
29093  */
29094   }
29095 
29096   /* "(tree fragment)":10
29097  *     if __pyx_state is not None:
29098  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29099  *     return __pyx_result             # <<<<<<<<<<<<<<
29100  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):
29101  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29102  */
29103   __Pyx_XDECREF(__pyx_r);
29104   __Pyx_INCREF(__pyx_v___pyx_result);
29105   __pyx_r = __pyx_v___pyx_result;
29106   goto __pyx_L0;
29107 
29108   /* "(tree fragment)":1
29109  * def __pyx_unpickle_AQcompute_batch_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
29110  *     cdef object __pyx_PickleError
29111  *     cdef object __pyx_result
29112  */
29113 
29114   /* function exit code */
29115   __pyx_L1_error:;
29116   __Pyx_XDECREF(__pyx_t_2);
29117   __Pyx_XDECREF(__pyx_t_3);
29118   __Pyx_XDECREF(__pyx_t_4);
29119   __Pyx_XDECREF(__pyx_t_5);
29120   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_AQcompute_batch_Cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
29121   __pyx_r = NULL;
29122   __pyx_L0:;
29123   __Pyx_XDECREF(__pyx_v___pyx_PickleError);
29124   __Pyx_XDECREF(__pyx_v___pyx_result);
29125   __Pyx_XGIVEREF(__pyx_r);
29126   __Pyx_RefNannyFinishContext();
29127   return __pyx_r;
29128 }
29129 
29130 /* "(tree fragment)":11
29131  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29132  *     return __pyx_result
29133  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
29134  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29135  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
29136  */
29137 
__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_AQcompute_batch_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython * __pyx_v___pyx_result,PyObject * __pyx_v___pyx_state)29138 static PyObject *__pyx_f_3GPy_6models_18state_space_cython___pyx_unpickle_AQcompute_batch_Cython__set_state(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
29139   PyObject *__pyx_r = NULL;
29140   __Pyx_RefNannyDeclarations
29141   PyObject *__pyx_t_1 = NULL;
29142   int __pyx_t_2;
29143   int __pyx_t_3;
29144   Py_ssize_t __pyx_t_4;
29145   int __pyx_t_5;
29146   int __pyx_t_6;
29147   PyObject *__pyx_t_7 = NULL;
29148   PyObject *__pyx_t_8 = NULL;
29149   PyObject *__pyx_t_9 = NULL;
29150   int __pyx_lineno = 0;
29151   const char *__pyx_filename = NULL;
29152   int __pyx_clineno = 0;
29153   __Pyx_RefNannySetupContext("__pyx_unpickle_AQcompute_batch_Cython__set_state", 0);
29154 
29155   /* "(tree fragment)":12
29156  *     return __pyx_result
29157  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):
29158  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]             # <<<<<<<<<<<<<<
29159  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
29160  *         __pyx_result.__dict__.update(__pyx_state[13])
29161  */
29162   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29163     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29164     __PYX_ERR(1, 12, __pyx_L1_error)
29165   }
29166   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29167   __Pyx_GOTREF(__pyx_t_1);
29168   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29169   __Pyx_GIVEREF(__pyx_t_1);
29170   __Pyx_GOTREF(__pyx_v___pyx_result->As);
29171   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->As));
29172   __pyx_v___pyx_result->As = ((PyArrayObject *)__pyx_t_1);
29173   __pyx_t_1 = 0;
29174   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29175     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29176     __PYX_ERR(1, 12, __pyx_L1_error)
29177   }
29178   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29179   __Pyx_GOTREF(__pyx_t_1);
29180   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29181   __Pyx_GIVEREF(__pyx_t_1);
29182   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.Q);
29183   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.Q));
29184   __pyx_v___pyx_result->__pyx_base.Q = ((PyArrayObject *)__pyx_t_1);
29185   __pyx_t_1 = 0;
29186   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29187     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29188     __PYX_ERR(1, 12, __pyx_L1_error)
29189   }
29190   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29191   __Pyx_GOTREF(__pyx_t_1);
29192   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29193   __Pyx_GIVEREF(__pyx_t_1);
29194   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.Q_square_root);
29195   __Pyx_DECREF(__pyx_v___pyx_result->__pyx_base.Q_square_root);
29196   __pyx_v___pyx_result->__pyx_base.Q_square_root = ((PyObject*)__pyx_t_1);
29197   __pyx_t_1 = 0;
29198   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29199     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29200     __PYX_ERR(1, 12, __pyx_L1_error)
29201   }
29202   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29203   __Pyx_GOTREF(__pyx_t_1);
29204   if (!(likely(PyDict_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
29205   __Pyx_GIVEREF(__pyx_t_1);
29206   __Pyx_GOTREF(__pyx_v___pyx_result->Q_svd_dict);
29207   __Pyx_DECREF(__pyx_v___pyx_result->Q_svd_dict);
29208   __pyx_v___pyx_result->Q_svd_dict = ((PyObject*)__pyx_t_1);
29209   __pyx_t_1 = 0;
29210   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29211     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29212     __PYX_ERR(1, 12, __pyx_L1_error)
29213   }
29214   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29215   __Pyx_GOTREF(__pyx_t_1);
29216   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29217   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29218   __pyx_v___pyx_result->__pyx_base.Q_time_var_index = __pyx_t_2;
29219   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29220     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29221     __PYX_ERR(1, 12, __pyx_L1_error)
29222   }
29223   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29224   __Pyx_GOTREF(__pyx_t_1);
29225   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29226   __Pyx_GIVEREF(__pyx_t_1);
29227   __Pyx_GOTREF(__pyx_v___pyx_result->Qs);
29228   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->Qs));
29229   __pyx_v___pyx_result->Qs = ((PyArrayObject *)__pyx_t_1);
29230   __pyx_t_1 = 0;
29231   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29232     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29233     __PYX_ERR(1, 12, __pyx_L1_error)
29234   }
29235   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29236   __Pyx_GOTREF(__pyx_t_1);
29237   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29238   __Pyx_GIVEREF(__pyx_t_1);
29239   __Pyx_GOTREF(__pyx_v___pyx_result->dAs);
29240   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dAs));
29241   __pyx_v___pyx_result->dAs = ((PyArrayObject *)__pyx_t_1);
29242   __pyx_t_1 = 0;
29243   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29244     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29245     __PYX_ERR(1, 12, __pyx_L1_error)
29246   }
29247   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29248   __Pyx_GOTREF(__pyx_t_1);
29249   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29250   __Pyx_GIVEREF(__pyx_t_1);
29251   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.dQ);
29252   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.dQ));
29253   __pyx_v___pyx_result->__pyx_base.dQ = ((PyArrayObject *)__pyx_t_1);
29254   __pyx_t_1 = 0;
29255   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29256     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29257     __PYX_ERR(1, 12, __pyx_L1_error)
29258   }
29259   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29260   __Pyx_GOTREF(__pyx_t_1);
29261   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29262   __Pyx_GIVEREF(__pyx_t_1);
29263   __Pyx_GOTREF(__pyx_v___pyx_result->dQs);
29264   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->dQs));
29265   __pyx_v___pyx_result->dQs = ((PyArrayObject *)__pyx_t_1);
29266   __pyx_t_1 = 0;
29267   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29268     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29269     __PYX_ERR(1, 12, __pyx_L1_error)
29270   }
29271   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29272   __Pyx_GOTREF(__pyx_t_1);
29273   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29274   __Pyx_GIVEREF(__pyx_t_1);
29275   __Pyx_GOTREF(__pyx_v___pyx_result->__pyx_base.index);
29276   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->__pyx_base.index));
29277   __pyx_v___pyx_result->__pyx_base.index = ((PyArrayObject *)__pyx_t_1);
29278   __pyx_t_1 = 0;
29279   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29280     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29281     __PYX_ERR(1, 12, __pyx_L1_error)
29282   }
29283   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29284   __Pyx_GOTREF(__pyx_t_1);
29285   __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29286   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29287   __pyx_v___pyx_result->last_k = __pyx_t_2;
29288   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29289     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29290     __PYX_ERR(1, 12, __pyx_L1_error)
29291   }
29292   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29293   __Pyx_GOTREF(__pyx_t_1);
29294   if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 12, __pyx_L1_error)
29295   __Pyx_GIVEREF(__pyx_t_1);
29296   __Pyx_GOTREF(__pyx_v___pyx_result->reconstruct_indices);
29297   __Pyx_DECREF(((PyObject *)__pyx_v___pyx_result->reconstruct_indices));
29298   __pyx_v___pyx_result->reconstruct_indices = ((PyArrayObject *)__pyx_t_1);
29299   __pyx_t_1 = 0;
29300   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29301     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29302     __PYX_ERR(1, 12, __pyx_L1_error)
29303   }
29304   __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
29305   __Pyx_GOTREF(__pyx_t_1);
29306   __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
29307   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29308   __pyx_v___pyx_result->__pyx_base.svd_each_time = __pyx_t_3;
29309 
29310   /* "(tree fragment)":13
29311  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):
29312  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29313  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
29314  *         __pyx_result.__dict__.update(__pyx_state[13])
29315  */
29316   if (unlikely(__pyx_v___pyx_state == Py_None)) {
29317     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
29318     __PYX_ERR(1, 13, __pyx_L1_error)
29319   }
29320   __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
29321   __pyx_t_5 = ((__pyx_t_4 > 13) != 0);
29322   if (__pyx_t_5) {
29323   } else {
29324     __pyx_t_3 = __pyx_t_5;
29325     goto __pyx_L4_bool_binop_done;
29326   }
29327   __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
29328   __pyx_t_6 = (__pyx_t_5 != 0);
29329   __pyx_t_3 = __pyx_t_6;
29330   __pyx_L4_bool_binop_done:;
29331   if (__pyx_t_3) {
29332 
29333     /* "(tree fragment)":14
29334  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29335  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
29336  *         __pyx_result.__dict__.update(__pyx_state[13])             # <<<<<<<<<<<<<<
29337  */
29338     __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
29339     __Pyx_GOTREF(__pyx_t_7);
29340     __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
29341     __Pyx_GOTREF(__pyx_t_8);
29342     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29343     if (unlikely(__pyx_v___pyx_state == Py_None)) {
29344       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
29345       __PYX_ERR(1, 14, __pyx_L1_error)
29346     }
29347     __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
29348     __Pyx_GOTREF(__pyx_t_7);
29349     __pyx_t_9 = NULL;
29350     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
29351       __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
29352       if (likely(__pyx_t_9)) {
29353         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
29354         __Pyx_INCREF(__pyx_t_9);
29355         __Pyx_INCREF(function);
29356         __Pyx_DECREF_SET(__pyx_t_8, function);
29357       }
29358     }
29359     __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
29360     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
29361     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
29362     if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
29363     __Pyx_GOTREF(__pyx_t_1);
29364     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29365     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
29366 
29367     /* "(tree fragment)":13
29368  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):
29369  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29370  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
29371  *         __pyx_result.__dict__.update(__pyx_state[13])
29372  */
29373   }
29374 
29375   /* "(tree fragment)":11
29376  *         __pyx_unpickle_AQcompute_batch_Cython__set_state(<AQcompute_batch_Cython> __pyx_result, __pyx_state)
29377  *     return __pyx_result
29378  * cdef __pyx_unpickle_AQcompute_batch_Cython__set_state(AQcompute_batch_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
29379  *     __pyx_result.As = __pyx_state[0]; __pyx_result.Q = __pyx_state[1]; __pyx_result.Q_square_root = __pyx_state[2]; __pyx_result.Q_svd_dict = __pyx_state[3]; __pyx_result.Q_time_var_index = __pyx_state[4]; __pyx_result.Qs = __pyx_state[5]; __pyx_result.dAs = __pyx_state[6]; __pyx_result.dQ = __pyx_state[7]; __pyx_result.dQs = __pyx_state[8]; __pyx_result.index = __pyx_state[9]; __pyx_result.last_k = __pyx_state[10]; __pyx_result.reconstruct_indices = __pyx_state[11]; __pyx_result.svd_each_time = __pyx_state[12]
29380  *     if len(__pyx_state) > 13 and hasattr(__pyx_result, '__dict__'):
29381  */
29382 
29383   /* function exit code */
29384   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29385   goto __pyx_L0;
29386   __pyx_L1_error:;
29387   __Pyx_XDECREF(__pyx_t_1);
29388   __Pyx_XDECREF(__pyx_t_7);
29389   __Pyx_XDECREF(__pyx_t_8);
29390   __Pyx_XDECREF(__pyx_t_9);
29391   __Pyx_AddTraceback("GPy.models.state_space_cython.__pyx_unpickle_AQcompute_batch_Cython__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
29392   __pyx_r = 0;
29393   __pyx_L0:;
29394   __Pyx_XGIVEREF(__pyx_r);
29395   __Pyx_RefNannyFinishContext();
29396   return __pyx_r;
29397 }
29398 
29399 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":735
29400  * ctypedef npy_cdouble     complex_t
29401  *
29402  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
29403  *     return PyArray_MultiIterNew(1, <void*>a)
29404  *
29405  */
29406 
__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject * __pyx_v_a)29407 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
29408   PyObject *__pyx_r = NULL;
29409   __Pyx_RefNannyDeclarations
29410   PyObject *__pyx_t_1 = NULL;
29411   int __pyx_lineno = 0;
29412   const char *__pyx_filename = NULL;
29413   int __pyx_clineno = 0;
29414   __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
29415 
29416   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":736
29417  *
29418  * cdef inline object PyArray_MultiIterNew1(a):
29419  *     return PyArray_MultiIterNew(1, <void*>a)             # <<<<<<<<<<<<<<
29420  *
29421  * cdef inline object PyArray_MultiIterNew2(a, b):
29422  */
29423   __Pyx_XDECREF(__pyx_r);
29424   __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 736, __pyx_L1_error)
29425   __Pyx_GOTREF(__pyx_t_1);
29426   __pyx_r = __pyx_t_1;
29427   __pyx_t_1 = 0;
29428   goto __pyx_L0;
29429 
29430   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":735
29431  * ctypedef npy_cdouble     complex_t
29432  *
29433  * cdef inline object PyArray_MultiIterNew1(a):             # <<<<<<<<<<<<<<
29434  *     return PyArray_MultiIterNew(1, <void*>a)
29435  *
29436  */
29437 
29438   /* function exit code */
29439   __pyx_L1_error:;
29440   __Pyx_XDECREF(__pyx_t_1);
29441   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
29442   __pyx_r = 0;
29443   __pyx_L0:;
29444   __Pyx_XGIVEREF(__pyx_r);
29445   __Pyx_RefNannyFinishContext();
29446   return __pyx_r;
29447 }
29448 
29449 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":738
29450  *     return PyArray_MultiIterNew(1, <void*>a)
29451  *
29452  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
29453  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
29454  *
29455  */
29456 
__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject * __pyx_v_a,PyObject * __pyx_v_b)29457 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
29458   PyObject *__pyx_r = NULL;
29459   __Pyx_RefNannyDeclarations
29460   PyObject *__pyx_t_1 = NULL;
29461   int __pyx_lineno = 0;
29462   const char *__pyx_filename = NULL;
29463   int __pyx_clineno = 0;
29464   __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
29465 
29466   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":739
29467  *
29468  * cdef inline object PyArray_MultiIterNew2(a, b):
29469  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)             # <<<<<<<<<<<<<<
29470  *
29471  * cdef inline object PyArray_MultiIterNew3(a, b, c):
29472  */
29473   __Pyx_XDECREF(__pyx_r);
29474   __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 739, __pyx_L1_error)
29475   __Pyx_GOTREF(__pyx_t_1);
29476   __pyx_r = __pyx_t_1;
29477   __pyx_t_1 = 0;
29478   goto __pyx_L0;
29479 
29480   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":738
29481  *     return PyArray_MultiIterNew(1, <void*>a)
29482  *
29483  * cdef inline object PyArray_MultiIterNew2(a, b):             # <<<<<<<<<<<<<<
29484  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
29485  *
29486  */
29487 
29488   /* function exit code */
29489   __pyx_L1_error:;
29490   __Pyx_XDECREF(__pyx_t_1);
29491   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
29492   __pyx_r = 0;
29493   __pyx_L0:;
29494   __Pyx_XGIVEREF(__pyx_r);
29495   __Pyx_RefNannyFinishContext();
29496   return __pyx_r;
29497 }
29498 
29499 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":741
29500  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
29501  *
29502  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
29503  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
29504  *
29505  */
29506 
__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c)29507 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
29508   PyObject *__pyx_r = NULL;
29509   __Pyx_RefNannyDeclarations
29510   PyObject *__pyx_t_1 = NULL;
29511   int __pyx_lineno = 0;
29512   const char *__pyx_filename = NULL;
29513   int __pyx_clineno = 0;
29514   __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
29515 
29516   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":742
29517  *
29518  * cdef inline object PyArray_MultiIterNew3(a, b, c):
29519  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)             # <<<<<<<<<<<<<<
29520  *
29521  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
29522  */
29523   __Pyx_XDECREF(__pyx_r);
29524   __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 742, __pyx_L1_error)
29525   __Pyx_GOTREF(__pyx_t_1);
29526   __pyx_r = __pyx_t_1;
29527   __pyx_t_1 = 0;
29528   goto __pyx_L0;
29529 
29530   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":741
29531  *     return PyArray_MultiIterNew(2, <void*>a, <void*>b)
29532  *
29533  * cdef inline object PyArray_MultiIterNew3(a, b, c):             # <<<<<<<<<<<<<<
29534  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
29535  *
29536  */
29537 
29538   /* function exit code */
29539   __pyx_L1_error:;
29540   __Pyx_XDECREF(__pyx_t_1);
29541   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
29542   __pyx_r = 0;
29543   __pyx_L0:;
29544   __Pyx_XGIVEREF(__pyx_r);
29545   __Pyx_RefNannyFinishContext();
29546   return __pyx_r;
29547 }
29548 
29549 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":744
29550  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
29551  *
29552  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
29553  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
29554  *
29555  */
29556 
__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d)29557 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
29558   PyObject *__pyx_r = NULL;
29559   __Pyx_RefNannyDeclarations
29560   PyObject *__pyx_t_1 = NULL;
29561   int __pyx_lineno = 0;
29562   const char *__pyx_filename = NULL;
29563   int __pyx_clineno = 0;
29564   __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
29565 
29566   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":745
29567  *
29568  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
29569  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)             # <<<<<<<<<<<<<<
29570  *
29571  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
29572  */
29573   __Pyx_XDECREF(__pyx_r);
29574   __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 745, __pyx_L1_error)
29575   __Pyx_GOTREF(__pyx_t_1);
29576   __pyx_r = __pyx_t_1;
29577   __pyx_t_1 = 0;
29578   goto __pyx_L0;
29579 
29580   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":744
29581  *     return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
29582  *
29583  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):             # <<<<<<<<<<<<<<
29584  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
29585  *
29586  */
29587 
29588   /* function exit code */
29589   __pyx_L1_error:;
29590   __Pyx_XDECREF(__pyx_t_1);
29591   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
29592   __pyx_r = 0;
29593   __pyx_L0:;
29594   __Pyx_XGIVEREF(__pyx_r);
29595   __Pyx_RefNannyFinishContext();
29596   return __pyx_r;
29597 }
29598 
29599 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":747
29600  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
29601  *
29602  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
29603  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
29604  *
29605  */
29606 
__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject * __pyx_v_a,PyObject * __pyx_v_b,PyObject * __pyx_v_c,PyObject * __pyx_v_d,PyObject * __pyx_v_e)29607 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
29608   PyObject *__pyx_r = NULL;
29609   __Pyx_RefNannyDeclarations
29610   PyObject *__pyx_t_1 = NULL;
29611   int __pyx_lineno = 0;
29612   const char *__pyx_filename = NULL;
29613   int __pyx_clineno = 0;
29614   __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
29615 
29616   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":748
29617  *
29618  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
29619  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)             # <<<<<<<<<<<<<<
29620  *
29621  * cdef inline tuple PyDataType_SHAPE(dtype d):
29622  */
29623   __Pyx_XDECREF(__pyx_r);
29624   __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 748, __pyx_L1_error)
29625   __Pyx_GOTREF(__pyx_t_1);
29626   __pyx_r = __pyx_t_1;
29627   __pyx_t_1 = 0;
29628   goto __pyx_L0;
29629 
29630   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":747
29631  *     return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
29632  *
29633  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):             # <<<<<<<<<<<<<<
29634  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
29635  *
29636  */
29637 
29638   /* function exit code */
29639   __pyx_L1_error:;
29640   __Pyx_XDECREF(__pyx_t_1);
29641   __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
29642   __pyx_r = 0;
29643   __pyx_L0:;
29644   __Pyx_XGIVEREF(__pyx_r);
29645   __Pyx_RefNannyFinishContext();
29646   return __pyx_r;
29647 }
29648 
29649 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":750
29650  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
29651  *
29652  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
29653  *     if PyDataType_HASSUBARRAY(d):
29654  *         return <tuple>d.subarray.shape
29655  */
29656 
__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr * __pyx_v_d)29657 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
29658   PyObject *__pyx_r = NULL;
29659   __Pyx_RefNannyDeclarations
29660   int __pyx_t_1;
29661   __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
29662 
29663   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":751
29664  *
29665  * cdef inline tuple PyDataType_SHAPE(dtype d):
29666  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
29667  *         return <tuple>d.subarray.shape
29668  *     else:
29669  */
29670   __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
29671   if (__pyx_t_1) {
29672 
29673     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":752
29674  * cdef inline tuple PyDataType_SHAPE(dtype d):
29675  *     if PyDataType_HASSUBARRAY(d):
29676  *         return <tuple>d.subarray.shape             # <<<<<<<<<<<<<<
29677  *     else:
29678  *         return ()
29679  */
29680     __Pyx_XDECREF(__pyx_r);
29681     __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
29682     __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
29683     goto __pyx_L0;
29684 
29685     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":751
29686  *
29687  * cdef inline tuple PyDataType_SHAPE(dtype d):
29688  *     if PyDataType_HASSUBARRAY(d):             # <<<<<<<<<<<<<<
29689  *         return <tuple>d.subarray.shape
29690  *     else:
29691  */
29692   }
29693 
29694   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":754
29695  *         return <tuple>d.subarray.shape
29696  *     else:
29697  *         return ()             # <<<<<<<<<<<<<<
29698  *
29699  *
29700  */
29701   /*else*/ {
29702     __Pyx_XDECREF(__pyx_r);
29703     __Pyx_INCREF(__pyx_empty_tuple);
29704     __pyx_r = __pyx_empty_tuple;
29705     goto __pyx_L0;
29706   }
29707 
29708   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":750
29709  *     return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
29710  *
29711  * cdef inline tuple PyDataType_SHAPE(dtype d):             # <<<<<<<<<<<<<<
29712  *     if PyDataType_HASSUBARRAY(d):
29713  *         return <tuple>d.subarray.shape
29714  */
29715 
29716   /* function exit code */
29717   __pyx_L0:;
29718   __Pyx_XGIVEREF(__pyx_r);
29719   __Pyx_RefNannyFinishContext();
29720   return __pyx_r;
29721 }
29722 
29723 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":931
29724  *     int _import_umath() except -1
29725  *
29726  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
29727  *     Py_INCREF(base) # important to do this before stealing the reference below!
29728  *     PyArray_SetBaseObject(arr, base)
29729  */
29730 
__pyx_f_5numpy_set_array_base(PyArrayObject * __pyx_v_arr,PyObject * __pyx_v_base)29731 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
29732   __Pyx_RefNannyDeclarations
29733   __Pyx_RefNannySetupContext("set_array_base", 0);
29734 
29735   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":932
29736  *
29737  * cdef inline void set_array_base(ndarray arr, object base):
29738  *     Py_INCREF(base) # important to do this before stealing the reference below!             # <<<<<<<<<<<<<<
29739  *     PyArray_SetBaseObject(arr, base)
29740  *
29741  */
29742   Py_INCREF(__pyx_v_base);
29743 
29744   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":933
29745  * cdef inline void set_array_base(ndarray arr, object base):
29746  *     Py_INCREF(base) # important to do this before stealing the reference below!
29747  *     PyArray_SetBaseObject(arr, base)             # <<<<<<<<<<<<<<
29748  *
29749  * cdef inline object get_array_base(ndarray arr):
29750  */
29751   (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
29752 
29753   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":931
29754  *     int _import_umath() except -1
29755  *
29756  * cdef inline void set_array_base(ndarray arr, object base):             # <<<<<<<<<<<<<<
29757  *     Py_INCREF(base) # important to do this before stealing the reference below!
29758  *     PyArray_SetBaseObject(arr, base)
29759  */
29760 
29761   /* function exit code */
29762   __Pyx_RefNannyFinishContext();
29763 }
29764 
29765 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":935
29766  *     PyArray_SetBaseObject(arr, base)
29767  *
29768  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
29769  *     base = PyArray_BASE(arr)
29770  *     if base is NULL:
29771  */
29772 
__pyx_f_5numpy_get_array_base(PyArrayObject * __pyx_v_arr)29773 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
29774   PyObject *__pyx_v_base;
29775   PyObject *__pyx_r = NULL;
29776   __Pyx_RefNannyDeclarations
29777   int __pyx_t_1;
29778   __Pyx_RefNannySetupContext("get_array_base", 0);
29779 
29780   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":936
29781  *
29782  * cdef inline object get_array_base(ndarray arr):
29783  *     base = PyArray_BASE(arr)             # <<<<<<<<<<<<<<
29784  *     if base is NULL:
29785  *         return None
29786  */
29787   __pyx_v_base = PyArray_BASE(__pyx_v_arr);
29788 
29789   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":937
29790  * cdef inline object get_array_base(ndarray arr):
29791  *     base = PyArray_BASE(arr)
29792  *     if base is NULL:             # <<<<<<<<<<<<<<
29793  *         return None
29794  *     return <object>base
29795  */
29796   __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
29797   if (__pyx_t_1) {
29798 
29799     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":938
29800  *     base = PyArray_BASE(arr)
29801  *     if base is NULL:
29802  *         return None             # <<<<<<<<<<<<<<
29803  *     return <object>base
29804  *
29805  */
29806     __Pyx_XDECREF(__pyx_r);
29807     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
29808     goto __pyx_L0;
29809 
29810     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":937
29811  * cdef inline object get_array_base(ndarray arr):
29812  *     base = PyArray_BASE(arr)
29813  *     if base is NULL:             # <<<<<<<<<<<<<<
29814  *         return None
29815  *     return <object>base
29816  */
29817   }
29818 
29819   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":939
29820  *     if base is NULL:
29821  *         return None
29822  *     return <object>base             # <<<<<<<<<<<<<<
29823  *
29824  * # Versions of the import_* functions which are more suitable for
29825  */
29826   __Pyx_XDECREF(__pyx_r);
29827   __Pyx_INCREF(((PyObject *)__pyx_v_base));
29828   __pyx_r = ((PyObject *)__pyx_v_base);
29829   goto __pyx_L0;
29830 
29831   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":935
29832  *     PyArray_SetBaseObject(arr, base)
29833  *
29834  * cdef inline object get_array_base(ndarray arr):             # <<<<<<<<<<<<<<
29835  *     base = PyArray_BASE(arr)
29836  *     if base is NULL:
29837  */
29838 
29839   /* function exit code */
29840   __pyx_L0:;
29841   __Pyx_XGIVEREF(__pyx_r);
29842   __Pyx_RefNannyFinishContext();
29843   return __pyx_r;
29844 }
29845 
29846 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":943
29847  * # Versions of the import_* functions which are more suitable for
29848  * # Cython code.
29849  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
29850  *     try:
29851  *         __pyx_import_array()
29852  */
29853 
__pyx_f_5numpy_import_array(void)29854 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
29855   int __pyx_r;
29856   __Pyx_RefNannyDeclarations
29857   PyObject *__pyx_t_1 = NULL;
29858   PyObject *__pyx_t_2 = NULL;
29859   PyObject *__pyx_t_3 = NULL;
29860   int __pyx_t_4;
29861   PyObject *__pyx_t_5 = NULL;
29862   PyObject *__pyx_t_6 = NULL;
29863   PyObject *__pyx_t_7 = NULL;
29864   PyObject *__pyx_t_8 = NULL;
29865   int __pyx_lineno = 0;
29866   const char *__pyx_filename = NULL;
29867   int __pyx_clineno = 0;
29868   __Pyx_RefNannySetupContext("import_array", 0);
29869 
29870   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":944
29871  * # Cython code.
29872  * cdef inline int import_array() except -1:
29873  *     try:             # <<<<<<<<<<<<<<
29874  *         __pyx_import_array()
29875  *     except Exception:
29876  */
29877   {
29878     __Pyx_PyThreadState_declare
29879     __Pyx_PyThreadState_assign
29880     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
29881     __Pyx_XGOTREF(__pyx_t_1);
29882     __Pyx_XGOTREF(__pyx_t_2);
29883     __Pyx_XGOTREF(__pyx_t_3);
29884     /*try:*/ {
29885 
29886       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":945
29887  * cdef inline int import_array() except -1:
29888  *     try:
29889  *         __pyx_import_array()             # <<<<<<<<<<<<<<
29890  *     except Exception:
29891  *         raise ImportError("numpy.core.multiarray failed to import")
29892  */
29893       __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 945, __pyx_L3_error)
29894 
29895       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":944
29896  * # Cython code.
29897  * cdef inline int import_array() except -1:
29898  *     try:             # <<<<<<<<<<<<<<
29899  *         __pyx_import_array()
29900  *     except Exception:
29901  */
29902     }
29903     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
29904     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
29905     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
29906     goto __pyx_L8_try_end;
29907     __pyx_L3_error:;
29908 
29909     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":946
29910  *     try:
29911  *         __pyx_import_array()
29912  *     except Exception:             # <<<<<<<<<<<<<<
29913  *         raise ImportError("numpy.core.multiarray failed to import")
29914  *
29915  */
29916     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
29917     if (__pyx_t_4) {
29918       __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
29919       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 946, __pyx_L5_except_error)
29920       __Pyx_GOTREF(__pyx_t_5);
29921       __Pyx_GOTREF(__pyx_t_6);
29922       __Pyx_GOTREF(__pyx_t_7);
29923 
29924       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":947
29925  *         __pyx_import_array()
29926  *     except Exception:
29927  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
29928  *
29929  * cdef inline int import_umath() except -1:
29930  */
29931       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 947, __pyx_L5_except_error)
29932       __Pyx_GOTREF(__pyx_t_8);
29933       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
29934       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
29935       __PYX_ERR(2, 947, __pyx_L5_except_error)
29936     }
29937     goto __pyx_L5_except_error;
29938     __pyx_L5_except_error:;
29939 
29940     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":944
29941  * # Cython code.
29942  * cdef inline int import_array() except -1:
29943  *     try:             # <<<<<<<<<<<<<<
29944  *         __pyx_import_array()
29945  *     except Exception:
29946  */
29947     __Pyx_XGIVEREF(__pyx_t_1);
29948     __Pyx_XGIVEREF(__pyx_t_2);
29949     __Pyx_XGIVEREF(__pyx_t_3);
29950     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
29951     goto __pyx_L1_error;
29952     __pyx_L8_try_end:;
29953   }
29954 
29955   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":943
29956  * # Versions of the import_* functions which are more suitable for
29957  * # Cython code.
29958  * cdef inline int import_array() except -1:             # <<<<<<<<<<<<<<
29959  *     try:
29960  *         __pyx_import_array()
29961  */
29962 
29963   /* function exit code */
29964   __pyx_r = 0;
29965   goto __pyx_L0;
29966   __pyx_L1_error:;
29967   __Pyx_XDECREF(__pyx_t_5);
29968   __Pyx_XDECREF(__pyx_t_6);
29969   __Pyx_XDECREF(__pyx_t_7);
29970   __Pyx_XDECREF(__pyx_t_8);
29971   __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
29972   __pyx_r = -1;
29973   __pyx_L0:;
29974   __Pyx_RefNannyFinishContext();
29975   return __pyx_r;
29976 }
29977 
29978 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":949
29979  *         raise ImportError("numpy.core.multiarray failed to import")
29980  *
29981  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
29982  *     try:
29983  *         _import_umath()
29984  */
29985 
__pyx_f_5numpy_import_umath(void)29986 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
29987   int __pyx_r;
29988   __Pyx_RefNannyDeclarations
29989   PyObject *__pyx_t_1 = NULL;
29990   PyObject *__pyx_t_2 = NULL;
29991   PyObject *__pyx_t_3 = NULL;
29992   int __pyx_t_4;
29993   PyObject *__pyx_t_5 = NULL;
29994   PyObject *__pyx_t_6 = NULL;
29995   PyObject *__pyx_t_7 = NULL;
29996   PyObject *__pyx_t_8 = NULL;
29997   int __pyx_lineno = 0;
29998   const char *__pyx_filename = NULL;
29999   int __pyx_clineno = 0;
30000   __Pyx_RefNannySetupContext("import_umath", 0);
30001 
30002   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":950
30003  *
30004  * cdef inline int import_umath() except -1:
30005  *     try:             # <<<<<<<<<<<<<<
30006  *         _import_umath()
30007  *     except Exception:
30008  */
30009   {
30010     __Pyx_PyThreadState_declare
30011     __Pyx_PyThreadState_assign
30012     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
30013     __Pyx_XGOTREF(__pyx_t_1);
30014     __Pyx_XGOTREF(__pyx_t_2);
30015     __Pyx_XGOTREF(__pyx_t_3);
30016     /*try:*/ {
30017 
30018       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":951
30019  * cdef inline int import_umath() except -1:
30020  *     try:
30021  *         _import_umath()             # <<<<<<<<<<<<<<
30022  *     except Exception:
30023  *         raise ImportError("numpy.core.umath failed to import")
30024  */
30025       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 951, __pyx_L3_error)
30026 
30027       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":950
30028  *
30029  * cdef inline int import_umath() except -1:
30030  *     try:             # <<<<<<<<<<<<<<
30031  *         _import_umath()
30032  *     except Exception:
30033  */
30034     }
30035     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
30036     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
30037     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
30038     goto __pyx_L8_try_end;
30039     __pyx_L3_error:;
30040 
30041     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":952
30042  *     try:
30043  *         _import_umath()
30044  *     except Exception:             # <<<<<<<<<<<<<<
30045  *         raise ImportError("numpy.core.umath failed to import")
30046  *
30047  */
30048     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
30049     if (__pyx_t_4) {
30050       __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
30051       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 952, __pyx_L5_except_error)
30052       __Pyx_GOTREF(__pyx_t_5);
30053       __Pyx_GOTREF(__pyx_t_6);
30054       __Pyx_GOTREF(__pyx_t_7);
30055 
30056       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":953
30057  *         _import_umath()
30058  *     except Exception:
30059  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
30060  *
30061  * cdef inline int import_ufunc() except -1:
30062  */
30063       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 953, __pyx_L5_except_error)
30064       __Pyx_GOTREF(__pyx_t_8);
30065       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
30066       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30067       __PYX_ERR(2, 953, __pyx_L5_except_error)
30068     }
30069     goto __pyx_L5_except_error;
30070     __pyx_L5_except_error:;
30071 
30072     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":950
30073  *
30074  * cdef inline int import_umath() except -1:
30075  *     try:             # <<<<<<<<<<<<<<
30076  *         _import_umath()
30077  *     except Exception:
30078  */
30079     __Pyx_XGIVEREF(__pyx_t_1);
30080     __Pyx_XGIVEREF(__pyx_t_2);
30081     __Pyx_XGIVEREF(__pyx_t_3);
30082     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
30083     goto __pyx_L1_error;
30084     __pyx_L8_try_end:;
30085   }
30086 
30087   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":949
30088  *         raise ImportError("numpy.core.multiarray failed to import")
30089  *
30090  * cdef inline int import_umath() except -1:             # <<<<<<<<<<<<<<
30091  *     try:
30092  *         _import_umath()
30093  */
30094 
30095   /* function exit code */
30096   __pyx_r = 0;
30097   goto __pyx_L0;
30098   __pyx_L1_error:;
30099   __Pyx_XDECREF(__pyx_t_5);
30100   __Pyx_XDECREF(__pyx_t_6);
30101   __Pyx_XDECREF(__pyx_t_7);
30102   __Pyx_XDECREF(__pyx_t_8);
30103   __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
30104   __pyx_r = -1;
30105   __pyx_L0:;
30106   __Pyx_RefNannyFinishContext();
30107   return __pyx_r;
30108 }
30109 
30110 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":955
30111  *         raise ImportError("numpy.core.umath failed to import")
30112  *
30113  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
30114  *     try:
30115  *         _import_umath()
30116  */
30117 
__pyx_f_5numpy_import_ufunc(void)30118 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
30119   int __pyx_r;
30120   __Pyx_RefNannyDeclarations
30121   PyObject *__pyx_t_1 = NULL;
30122   PyObject *__pyx_t_2 = NULL;
30123   PyObject *__pyx_t_3 = NULL;
30124   int __pyx_t_4;
30125   PyObject *__pyx_t_5 = NULL;
30126   PyObject *__pyx_t_6 = NULL;
30127   PyObject *__pyx_t_7 = NULL;
30128   PyObject *__pyx_t_8 = NULL;
30129   int __pyx_lineno = 0;
30130   const char *__pyx_filename = NULL;
30131   int __pyx_clineno = 0;
30132   __Pyx_RefNannySetupContext("import_ufunc", 0);
30133 
30134   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":956
30135  *
30136  * cdef inline int import_ufunc() except -1:
30137  *     try:             # <<<<<<<<<<<<<<
30138  *         _import_umath()
30139  *     except Exception:
30140  */
30141   {
30142     __Pyx_PyThreadState_declare
30143     __Pyx_PyThreadState_assign
30144     __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
30145     __Pyx_XGOTREF(__pyx_t_1);
30146     __Pyx_XGOTREF(__pyx_t_2);
30147     __Pyx_XGOTREF(__pyx_t_3);
30148     /*try:*/ {
30149 
30150       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":957
30151  * cdef inline int import_ufunc() except -1:
30152  *     try:
30153  *         _import_umath()             # <<<<<<<<<<<<<<
30154  *     except Exception:
30155  *         raise ImportError("numpy.core.umath failed to import")
30156  */
30157       __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 957, __pyx_L3_error)
30158 
30159       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":956
30160  *
30161  * cdef inline int import_ufunc() except -1:
30162  *     try:             # <<<<<<<<<<<<<<
30163  *         _import_umath()
30164  *     except Exception:
30165  */
30166     }
30167     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
30168     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
30169     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
30170     goto __pyx_L8_try_end;
30171     __pyx_L3_error:;
30172 
30173     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":958
30174  *     try:
30175  *         _import_umath()
30176  *     except Exception:             # <<<<<<<<<<<<<<
30177  *         raise ImportError("numpy.core.umath failed to import")
30178  *
30179  */
30180     __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
30181     if (__pyx_t_4) {
30182       __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
30183       if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 958, __pyx_L5_except_error)
30184       __Pyx_GOTREF(__pyx_t_5);
30185       __Pyx_GOTREF(__pyx_t_6);
30186       __Pyx_GOTREF(__pyx_t_7);
30187 
30188       /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":959
30189  *         _import_umath()
30190  *     except Exception:
30191  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
30192  *
30193  * cdef extern from *:
30194  */
30195       __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 959, __pyx_L5_except_error)
30196       __Pyx_GOTREF(__pyx_t_8);
30197       __Pyx_Raise(__pyx_t_8, 0, 0, 0);
30198       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
30199       __PYX_ERR(2, 959, __pyx_L5_except_error)
30200     }
30201     goto __pyx_L5_except_error;
30202     __pyx_L5_except_error:;
30203 
30204     /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":956
30205  *
30206  * cdef inline int import_ufunc() except -1:
30207  *     try:             # <<<<<<<<<<<<<<
30208  *         _import_umath()
30209  *     except Exception:
30210  */
30211     __Pyx_XGIVEREF(__pyx_t_1);
30212     __Pyx_XGIVEREF(__pyx_t_2);
30213     __Pyx_XGIVEREF(__pyx_t_3);
30214     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
30215     goto __pyx_L1_error;
30216     __pyx_L8_try_end:;
30217   }
30218 
30219   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":955
30220  *         raise ImportError("numpy.core.umath failed to import")
30221  *
30222  * cdef inline int import_ufunc() except -1:             # <<<<<<<<<<<<<<
30223  *     try:
30224  *         _import_umath()
30225  */
30226 
30227   /* function exit code */
30228   __pyx_r = 0;
30229   goto __pyx_L0;
30230   __pyx_L1_error:;
30231   __Pyx_XDECREF(__pyx_t_5);
30232   __Pyx_XDECREF(__pyx_t_6);
30233   __Pyx_XDECREF(__pyx_t_7);
30234   __Pyx_XDECREF(__pyx_t_8);
30235   __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
30236   __pyx_r = -1;
30237   __pyx_L0:;
30238   __Pyx_RefNannyFinishContext();
30239   return __pyx_r;
30240 }
30241 
30242 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":969
30243  *
30244  *
30245  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
30246  *     """
30247  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
30248  */
30249 
__pyx_f_5numpy_is_timedelta64_object(PyObject * __pyx_v_obj)30250 static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
30251   int __pyx_r;
30252   __Pyx_RefNannyDeclarations
30253   __Pyx_RefNannySetupContext("is_timedelta64_object", 0);
30254 
30255   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":981
30256  *     bool
30257  *     """
30258  *     return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type)             # <<<<<<<<<<<<<<
30259  *
30260  *
30261  */
30262   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
30263   goto __pyx_L0;
30264 
30265   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":969
30266  *
30267  *
30268  * cdef inline bint is_timedelta64_object(object obj):             # <<<<<<<<<<<<<<
30269  *     """
30270  *     Cython equivalent of `isinstance(obj, np.timedelta64)`
30271  */
30272 
30273   /* function exit code */
30274   __pyx_L0:;
30275   __Pyx_RefNannyFinishContext();
30276   return __pyx_r;
30277 }
30278 
30279 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":984
30280  *
30281  *
30282  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
30283  *     """
30284  *     Cython equivalent of `isinstance(obj, np.datetime64)`
30285  */
30286 
__pyx_f_5numpy_is_datetime64_object(PyObject * __pyx_v_obj)30287 static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
30288   int __pyx_r;
30289   __Pyx_RefNannyDeclarations
30290   __Pyx_RefNannySetupContext("is_datetime64_object", 0);
30291 
30292   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":996
30293  *     bool
30294  *     """
30295  *     return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type)             # <<<<<<<<<<<<<<
30296  *
30297  *
30298  */
30299   __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
30300   goto __pyx_L0;
30301 
30302   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":984
30303  *
30304  *
30305  * cdef inline bint is_datetime64_object(object obj):             # <<<<<<<<<<<<<<
30306  *     """
30307  *     Cython equivalent of `isinstance(obj, np.datetime64)`
30308  */
30309 
30310   /* function exit code */
30311   __pyx_L0:;
30312   __Pyx_RefNannyFinishContext();
30313   return __pyx_r;
30314 }
30315 
30316 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":999
30317  *
30318  *
30319  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
30320  *     """
30321  *     returns the int64 value underlying scalar numpy datetime64 object
30322  */
30323 
__pyx_f_5numpy_get_datetime64_value(PyObject * __pyx_v_obj)30324 static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
30325   npy_datetime __pyx_r;
30326 
30327   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1006
30328  *     also needed.  That can be found using `get_datetime64_unit`.
30329  *     """
30330  *     return (<PyDatetimeScalarObject*>obj).obval             # <<<<<<<<<<<<<<
30331  *
30332  *
30333  */
30334   __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
30335   goto __pyx_L0;
30336 
30337   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":999
30338  *
30339  *
30340  * cdef inline npy_datetime get_datetime64_value(object obj) nogil:             # <<<<<<<<<<<<<<
30341  *     """
30342  *     returns the int64 value underlying scalar numpy datetime64 object
30343  */
30344 
30345   /* function exit code */
30346   __pyx_L0:;
30347   return __pyx_r;
30348 }
30349 
30350 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1009
30351  *
30352  *
30353  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
30354  *     """
30355  *     returns the int64 value underlying scalar numpy timedelta64 object
30356  */
30357 
__pyx_f_5numpy_get_timedelta64_value(PyObject * __pyx_v_obj)30358 static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
30359   npy_timedelta __pyx_r;
30360 
30361   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1013
30362  *     returns the int64 value underlying scalar numpy timedelta64 object
30363  *     """
30364  *     return (<PyTimedeltaScalarObject*>obj).obval             # <<<<<<<<<<<<<<
30365  *
30366  *
30367  */
30368   __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
30369   goto __pyx_L0;
30370 
30371   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1009
30372  *
30373  *
30374  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil:             # <<<<<<<<<<<<<<
30375  *     """
30376  *     returns the int64 value underlying scalar numpy timedelta64 object
30377  */
30378 
30379   /* function exit code */
30380   __pyx_L0:;
30381   return __pyx_r;
30382 }
30383 
30384 /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1016
30385  *
30386  *
30387  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
30388  *     """
30389  *     returns the unit part of the dtype for a numpy datetime64 object.
30390  */
30391 
__pyx_f_5numpy_get_datetime64_unit(PyObject * __pyx_v_obj)30392 static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
30393   NPY_DATETIMEUNIT __pyx_r;
30394 
30395   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1020
30396  *     returns the unit part of the dtype for a numpy datetime64 object.
30397  *     """
30398  *     return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base             # <<<<<<<<<<<<<<
30399  */
30400   __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
30401   goto __pyx_L0;
30402 
30403   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1016
30404  *
30405  *
30406  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
30407  *     """
30408  *     returns the unit part of the dtype for a numpy datetime64 object.
30409  */
30410 
30411   /* function exit code */
30412   __pyx_L0:;
30413   return __pyx_r;
30414 }
30415 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
30416 
__pyx_tp_new_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)30417 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
30418   struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *p;
30419   PyObject *o;
30420   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30421     o = (*t->tp_alloc)(t, 0);
30422   } else {
30423     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30424   }
30425   if (unlikely(!o)) return 0;
30426   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *)o);
30427   p->__pyx_vtab = __pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
30428   return o;
30429 }
30430 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(PyObject * o)30431 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(PyObject *o) {
30432   #if CYTHON_USE_TP_FINALIZE
30433   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
30434     if (PyObject_CallFinalizerFromDealloc(o)) return;
30435   }
30436   #endif
30437   (*Py_TYPE(o)->tp_free)(o);
30438 }
30439 
30440 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython[] = {
30441   {"f_a", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_1f_a, METH_VARARGS|METH_KEYWORDS, 0},
30442   {"Ak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_3Ak, METH_VARARGS|METH_KEYWORDS, 0},
30443   {"Qk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_5Qk, METH_O, 0},
30444   {"Q_srk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_7Q_srk, METH_O, 0},
30445   {"dAk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_9dAk, METH_O, 0},
30446   {"dQk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_11dQk, METH_O, 0},
30447   {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_13reset, METH_VARARGS|METH_KEYWORDS, 0},
30448   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_15__reduce_cython__, METH_NOARGS, 0},
30449   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_17__setstate_cython__, METH_O, 0},
30450   {0, 0, 0, 0}
30451 };
30452 
30453 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython = {
30454   PyVarObject_HEAD_INIT(0, 0)
30455   "GPy.models.state_space_cython.Dynamic_Callables_Cython", /*tp_name*/
30456   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython), /*tp_basicsize*/
30457   0, /*tp_itemsize*/
30458   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython, /*tp_dealloc*/
30459   #if PY_VERSION_HEX < 0x030800b4
30460   0, /*tp_print*/
30461   #endif
30462   #if PY_VERSION_HEX >= 0x030800b4
30463   0, /*tp_vectorcall_offset*/
30464   #endif
30465   0, /*tp_getattr*/
30466   0, /*tp_setattr*/
30467   #if PY_MAJOR_VERSION < 3
30468   0, /*tp_compare*/
30469   #endif
30470   #if PY_MAJOR_VERSION >= 3
30471   0, /*tp_as_async*/
30472   #endif
30473   0, /*tp_repr*/
30474   0, /*tp_as_number*/
30475   0, /*tp_as_sequence*/
30476   0, /*tp_as_mapping*/
30477   0, /*tp_hash*/
30478   0, /*tp_call*/
30479   0, /*tp_str*/
30480   0, /*tp_getattro*/
30481   0, /*tp_setattro*/
30482   0, /*tp_as_buffer*/
30483   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
30484   0, /*tp_doc*/
30485   0, /*tp_traverse*/
30486   0, /*tp_clear*/
30487   0, /*tp_richcompare*/
30488   0, /*tp_weaklistoffset*/
30489   0, /*tp_iter*/
30490   0, /*tp_iternext*/
30491   __pyx_methods_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython, /*tp_methods*/
30492   0, /*tp_members*/
30493   0, /*tp_getset*/
30494   0, /*tp_base*/
30495   0, /*tp_dict*/
30496   0, /*tp_descr_get*/
30497   0, /*tp_descr_set*/
30498   0, /*tp_dictoffset*/
30499   0, /*tp_init*/
30500   0, /*tp_alloc*/
30501   __pyx_tp_new_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython, /*tp_new*/
30502   0, /*tp_free*/
30503   0, /*tp_is_gc*/
30504   0, /*tp_bases*/
30505   0, /*tp_mro*/
30506   0, /*tp_cache*/
30507   0, /*tp_subclasses*/
30508   0, /*tp_weaklist*/
30509   0, /*tp_del*/
30510   0, /*tp_version_tag*/
30511   #if PY_VERSION_HEX >= 0x030400a1
30512   0, /*tp_finalize*/
30513   #endif
30514   #if PY_VERSION_HEX >= 0x030800b1
30515   0, /*tp_vectorcall*/
30516   #endif
30517   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30518   0, /*tp_print*/
30519   #endif
30520 };
30521 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
30522 
__pyx_tp_new_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)30523 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
30524   struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *p;
30525   PyObject *o;
30526   if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
30527     o = (*t->tp_alloc)(t, 0);
30528   } else {
30529     o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
30530   }
30531   if (unlikely(!o)) return 0;
30532   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *)o);
30533   p->__pyx_vtab = __pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
30534   return o;
30535 }
30536 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(PyObject * o)30537 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(PyObject *o) {
30538   #if CYTHON_USE_TP_FINALIZE
30539   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
30540     if (PyObject_CallFinalizerFromDealloc(o)) return;
30541   }
30542   #endif
30543   (*Py_TYPE(o)->tp_free)(o);
30544 }
30545 
30546 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_Measurement_Callables_Cython[] = {
30547   {"f_h", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_1f_h, METH_VARARGS|METH_KEYWORDS, 0},
30548   {"Hk", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_3Hk, METH_VARARGS|METH_KEYWORDS, 0},
30549   {"Rk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_5Rk, METH_O, 0},
30550   {"R_isrk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_7R_isrk, METH_O, 0},
30551   {"dHk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_9dHk, METH_O, 0},
30552   {"dRk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_11dRk, METH_O, 0},
30553   {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_13reset, METH_VARARGS|METH_KEYWORDS, 0},
30554   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_15__reduce_cython__, METH_NOARGS, 0},
30555   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_17__setstate_cython__, METH_O, 0},
30556   {0, 0, 0, 0}
30557 };
30558 
30559 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython = {
30560   PyVarObject_HEAD_INIT(0, 0)
30561   "GPy.models.state_space_cython.Measurement_Callables_Cython", /*tp_name*/
30562   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython), /*tp_basicsize*/
30563   0, /*tp_itemsize*/
30564   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Measurement_Callables_Cython, /*tp_dealloc*/
30565   #if PY_VERSION_HEX < 0x030800b4
30566   0, /*tp_print*/
30567   #endif
30568   #if PY_VERSION_HEX >= 0x030800b4
30569   0, /*tp_vectorcall_offset*/
30570   #endif
30571   0, /*tp_getattr*/
30572   0, /*tp_setattr*/
30573   #if PY_MAJOR_VERSION < 3
30574   0, /*tp_compare*/
30575   #endif
30576   #if PY_MAJOR_VERSION >= 3
30577   0, /*tp_as_async*/
30578   #endif
30579   0, /*tp_repr*/
30580   0, /*tp_as_number*/
30581   0, /*tp_as_sequence*/
30582   0, /*tp_as_mapping*/
30583   0, /*tp_hash*/
30584   0, /*tp_call*/
30585   0, /*tp_str*/
30586   0, /*tp_getattro*/
30587   0, /*tp_setattro*/
30588   0, /*tp_as_buffer*/
30589   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
30590   0, /*tp_doc*/
30591   0, /*tp_traverse*/
30592   0, /*tp_clear*/
30593   0, /*tp_richcompare*/
30594   0, /*tp_weaklistoffset*/
30595   0, /*tp_iter*/
30596   0, /*tp_iternext*/
30597   __pyx_methods_3GPy_6models_18state_space_cython_Measurement_Callables_Cython, /*tp_methods*/
30598   0, /*tp_members*/
30599   0, /*tp_getset*/
30600   0, /*tp_base*/
30601   0, /*tp_dict*/
30602   0, /*tp_descr_get*/
30603   0, /*tp_descr_set*/
30604   0, /*tp_dictoffset*/
30605   0, /*tp_init*/
30606   0, /*tp_alloc*/
30607   __pyx_tp_new_3GPy_6models_18state_space_cython_Measurement_Callables_Cython, /*tp_new*/
30608   0, /*tp_free*/
30609   0, /*tp_is_gc*/
30610   0, /*tp_bases*/
30611   0, /*tp_mro*/
30612   0, /*tp_cache*/
30613   0, /*tp_subclasses*/
30614   0, /*tp_weaklist*/
30615   0, /*tp_del*/
30616   0, /*tp_version_tag*/
30617   #if PY_VERSION_HEX >= 0x030400a1
30618   0, /*tp_finalize*/
30619   #endif
30620   #if PY_VERSION_HEX >= 0x030800b1
30621   0, /*tp_vectorcall*/
30622   #endif
30623   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30624   0, /*tp_print*/
30625   #endif
30626 };
30627 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_R_handling_Cython __pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython;
30628 
__pyx_tp_new_3GPy_6models_18state_space_cython_R_handling_Cython(PyTypeObject * t,PyObject * a,PyObject * k)30629 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_R_handling_Cython(PyTypeObject *t, PyObject *a, PyObject *k) {
30630   struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *p;
30631   PyObject *o = __pyx_tp_new_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(t, a, k);
30632   if (unlikely(!o)) return 0;
30633   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)o);
30634   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython*)__pyx_vtabptr_3GPy_6models_18state_space_cython_R_handling_Cython;
30635   p->R = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30636   p->index = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30637   p->dR = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30638   p->R_square_root = ((PyObject*)Py_None); Py_INCREF(Py_None);
30639   return o;
30640 }
30641 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject * o)30642 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject *o) {
30643   struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)o;
30644   #if CYTHON_USE_TP_FINALIZE
30645   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30646     if (PyObject_CallFinalizerFromDealloc(o)) return;
30647   }
30648   #endif
30649   PyObject_GC_UnTrack(o);
30650   Py_CLEAR(p->R);
30651   Py_CLEAR(p->index);
30652   Py_CLEAR(p->dR);
30653   Py_CLEAR(p->R_square_root);
30654   #if CYTHON_USE_TYPE_SLOTS
30655   if (PyType_IS_GC(Py_TYPE(o)->tp_base))
30656   #endif
30657   PyObject_GC_Track(o);
30658   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Measurement_Callables_Cython(o);
30659 }
30660 
__pyx_tp_traverse_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject * o,visitproc v,void * a)30661 static int __pyx_tp_traverse_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject *o, visitproc v, void *a) {
30662   int e;
30663   struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)o;
30664   e = ((likely(__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython)) ? ((__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython->tp_traverse) ? __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3GPy_6models_18state_space_cython_R_handling_Cython)); if (e) return e;
30665   if (p->R) {
30666     e = (*v)(((PyObject *)p->R), a); if (e) return e;
30667   }
30668   if (p->index) {
30669     e = (*v)(((PyObject *)p->index), a); if (e) return e;
30670   }
30671   if (p->dR) {
30672     e = (*v)(((PyObject *)p->dR), a); if (e) return e;
30673   }
30674   if (p->R_square_root) {
30675     e = (*v)(p->R_square_root, a); if (e) return e;
30676   }
30677   return 0;
30678 }
30679 
__pyx_tp_clear_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject * o)30680 static int __pyx_tp_clear_3GPy_6models_18state_space_cython_R_handling_Cython(PyObject *o) {
30681   PyObject* tmp;
30682   struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython *)o;
30683   if (likely(__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython)) { if (__pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython->tp_clear) __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3GPy_6models_18state_space_cython_R_handling_Cython);
30684   tmp = ((PyObject*)p->R);
30685   p->R = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30686   Py_XDECREF(tmp);
30687   tmp = ((PyObject*)p->index);
30688   p->index = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30689   Py_XDECREF(tmp);
30690   tmp = ((PyObject*)p->dR);
30691   p->dR = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30692   Py_XDECREF(tmp);
30693   tmp = ((PyObject*)p->R_square_root);
30694   p->R_square_root = ((PyObject*)Py_None); Py_INCREF(Py_None);
30695   Py_XDECREF(tmp);
30696   return 0;
30697 }
30698 
30699 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_R_handling_Cython[] = {
30700   {"Rk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_3Rk, METH_O, 0},
30701   {"dRk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_5dRk, METH_O, 0},
30702   {"R_isrk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_7R_isrk, METH_O, __pyx_doc_3GPy_6models_18state_space_cython_17R_handling_Cython_6R_isrk},
30703   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_9__reduce_cython__, METH_NOARGS, 0},
30704   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_11__setstate_cython__, METH_O, 0},
30705   {0, 0, 0, 0}
30706 };
30707 
30708 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython = {
30709   PyVarObject_HEAD_INIT(0, 0)
30710   "GPy.models.state_space_cython.R_handling_Cython", /*tp_name*/
30711   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_R_handling_Cython), /*tp_basicsize*/
30712   0, /*tp_itemsize*/
30713   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_R_handling_Cython, /*tp_dealloc*/
30714   #if PY_VERSION_HEX < 0x030800b4
30715   0, /*tp_print*/
30716   #endif
30717   #if PY_VERSION_HEX >= 0x030800b4
30718   0, /*tp_vectorcall_offset*/
30719   #endif
30720   0, /*tp_getattr*/
30721   0, /*tp_setattr*/
30722   #if PY_MAJOR_VERSION < 3
30723   0, /*tp_compare*/
30724   #endif
30725   #if PY_MAJOR_VERSION >= 3
30726   0, /*tp_as_async*/
30727   #endif
30728   0, /*tp_repr*/
30729   0, /*tp_as_number*/
30730   0, /*tp_as_sequence*/
30731   0, /*tp_as_mapping*/
30732   0, /*tp_hash*/
30733   0, /*tp_call*/
30734   0, /*tp_str*/
30735   0, /*tp_getattro*/
30736   0, /*tp_setattro*/
30737   0, /*tp_as_buffer*/
30738   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30739   "\n    The calss handles noise matrix R.\n    ", /*tp_doc*/
30740   __pyx_tp_traverse_3GPy_6models_18state_space_cython_R_handling_Cython, /*tp_traverse*/
30741   __pyx_tp_clear_3GPy_6models_18state_space_cython_R_handling_Cython, /*tp_clear*/
30742   0, /*tp_richcompare*/
30743   0, /*tp_weaklistoffset*/
30744   0, /*tp_iter*/
30745   0, /*tp_iternext*/
30746   __pyx_methods_3GPy_6models_18state_space_cython_R_handling_Cython, /*tp_methods*/
30747   0, /*tp_members*/
30748   0, /*tp_getset*/
30749   0, /*tp_base*/
30750   0, /*tp_dict*/
30751   0, /*tp_descr_get*/
30752   0, /*tp_descr_set*/
30753   0, /*tp_dictoffset*/
30754   __pyx_pw_3GPy_6models_18state_space_cython_17R_handling_Cython_1__init__, /*tp_init*/
30755   0, /*tp_alloc*/
30756   __pyx_tp_new_3GPy_6models_18state_space_cython_R_handling_Cython, /*tp_new*/
30757   0, /*tp_free*/
30758   0, /*tp_is_gc*/
30759   0, /*tp_bases*/
30760   0, /*tp_mro*/
30761   0, /*tp_cache*/
30762   0, /*tp_subclasses*/
30763   0, /*tp_weaklist*/
30764   0, /*tp_del*/
30765   0, /*tp_version_tag*/
30766   #if PY_VERSION_HEX >= 0x030400a1
30767   0, /*tp_finalize*/
30768   #endif
30769   #if PY_VERSION_HEX >= 0x030800b1
30770   0, /*tp_vectorcall*/
30771   #endif
30772   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30773   0, /*tp_print*/
30774   #endif
30775 };
30776 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython __pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
30777 
__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyTypeObject * t,PyObject * a,PyObject * k)30778 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k) {
30779   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *p;
30780   PyObject *o = __pyx_tp_new_3GPy_6models_18state_space_cython_R_handling_Cython(t, a, k);
30781   if (unlikely(!o)) return 0;
30782   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)o);
30783   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Measurement_Callables_Cython*)__pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
30784   p->H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30785   p->dH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30786   return o;
30787 }
30788 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject * o)30789 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject *o) {
30790   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)o;
30791   #if CYTHON_USE_TP_FINALIZE
30792   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30793     if (PyObject_CallFinalizerFromDealloc(o)) return;
30794   }
30795   #endif
30796   PyObject_GC_UnTrack(o);
30797   Py_CLEAR(p->H);
30798   Py_CLEAR(p->dH);
30799   PyObject_GC_Track(o);
30800   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_R_handling_Cython(o);
30801 }
30802 
__pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject * o,visitproc v,void * a)30803 static int __pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject *o, visitproc v, void *a) {
30804   int e;
30805   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)o;
30806   e = __pyx_tp_traverse_3GPy_6models_18state_space_cython_R_handling_Cython(o, v, a); if (e) return e;
30807   if (p->H) {
30808     e = (*v)(((PyObject *)p->H), a); if (e) return e;
30809   }
30810   if (p->dH) {
30811     e = (*v)(((PyObject *)p->dH), a); if (e) return e;
30812   }
30813   return 0;
30814 }
30815 
__pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject * o)30816 static int __pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython(PyObject *o) {
30817   PyObject* tmp;
30818   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython *)o;
30819   __pyx_tp_clear_3GPy_6models_18state_space_cython_R_handling_Cython(o);
30820   tmp = ((PyObject*)p->H);
30821   p->H = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30822   Py_XDECREF(tmp);
30823   tmp = ((PyObject*)p->dH);
30824   p->dH = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30825   Py_XDECREF(tmp);
30826   return 0;
30827 }
30828 
30829 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython[] = {
30830   {"f_h", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_3f_h, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_2f_h},
30831   {"Hk", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_5Hk, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_4Hk},
30832   {"dHk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_7dHk, METH_O, 0},
30833   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_9__reduce_cython__, METH_NOARGS, 0},
30834   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_11__setstate_cython__, METH_O, 0},
30835   {0, 0, 0, 0}
30836 };
30837 
30838 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython = {
30839   PyVarObject_HEAD_INIT(0, 0)
30840   "GPy.models.state_space_cython.Std_Measurement_Callables_Cython", /*tp_name*/
30841   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython), /*tp_basicsize*/
30842   0, /*tp_itemsize*/
30843   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython, /*tp_dealloc*/
30844   #if PY_VERSION_HEX < 0x030800b4
30845   0, /*tp_print*/
30846   #endif
30847   #if PY_VERSION_HEX >= 0x030800b4
30848   0, /*tp_vectorcall_offset*/
30849   #endif
30850   0, /*tp_getattr*/
30851   0, /*tp_setattr*/
30852   #if PY_MAJOR_VERSION < 3
30853   0, /*tp_compare*/
30854   #endif
30855   #if PY_MAJOR_VERSION >= 3
30856   0, /*tp_as_async*/
30857   #endif
30858   0, /*tp_repr*/
30859   0, /*tp_as_number*/
30860   0, /*tp_as_sequence*/
30861   0, /*tp_as_mapping*/
30862   0, /*tp_hash*/
30863   0, /*tp_call*/
30864   0, /*tp_str*/
30865   0, /*tp_getattro*/
30866   0, /*tp_setattro*/
30867   0, /*tp_as_buffer*/
30868   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
30869   0, /*tp_doc*/
30870   __pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython, /*tp_traverse*/
30871   __pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython, /*tp_clear*/
30872   0, /*tp_richcompare*/
30873   0, /*tp_weaklistoffset*/
30874   0, /*tp_iter*/
30875   0, /*tp_iternext*/
30876   __pyx_methods_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython, /*tp_methods*/
30877   0, /*tp_members*/
30878   0, /*tp_getset*/
30879   0, /*tp_base*/
30880   0, /*tp_dict*/
30881   0, /*tp_descr_get*/
30882   0, /*tp_descr_set*/
30883   0, /*tp_dictoffset*/
30884   __pyx_pw_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_1__init__, /*tp_init*/
30885   0, /*tp_alloc*/
30886   __pyx_tp_new_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython, /*tp_new*/
30887   0, /*tp_free*/
30888   0, /*tp_is_gc*/
30889   0, /*tp_bases*/
30890   0, /*tp_mro*/
30891   0, /*tp_cache*/
30892   0, /*tp_subclasses*/
30893   0, /*tp_weaklist*/
30894   0, /*tp_del*/
30895   0, /*tp_version_tag*/
30896   #if PY_VERSION_HEX >= 0x030400a1
30897   0, /*tp_finalize*/
30898   #endif
30899   #if PY_VERSION_HEX >= 0x030800b1
30900   0, /*tp_vectorcall*/
30901   #endif
30902   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
30903   0, /*tp_print*/
30904   #endif
30905 };
30906 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Q_handling_Cython __pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython;
30907 
__pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython(PyTypeObject * t,PyObject * a,PyObject * k)30908 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython(PyTypeObject *t, PyObject *a, PyObject *k) {
30909   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *p;
30910   PyObject *o = __pyx_tp_new_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(t, a, k);
30911   if (unlikely(!o)) return 0;
30912   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)o);
30913   p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython*)__pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython;
30914   p->Q = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30915   p->index = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30916   p->dQ = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30917   p->Q_square_root = ((PyObject*)Py_None); Py_INCREF(Py_None);
30918   return o;
30919 }
30920 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject * o)30921 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject *o) {
30922   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)o;
30923   #if CYTHON_USE_TP_FINALIZE
30924   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
30925     if (PyObject_CallFinalizerFromDealloc(o)) return;
30926   }
30927   #endif
30928   PyObject_GC_UnTrack(o);
30929   Py_CLEAR(p->Q);
30930   Py_CLEAR(p->index);
30931   Py_CLEAR(p->dQ);
30932   Py_CLEAR(p->Q_square_root);
30933   #if CYTHON_USE_TYPE_SLOTS
30934   if (PyType_IS_GC(Py_TYPE(o)->tp_base))
30935   #endif
30936   PyObject_GC_Track(o);
30937   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython(o);
30938 }
30939 
__pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject * o,visitproc v,void * a)30940 static int __pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject *o, visitproc v, void *a) {
30941   int e;
30942   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)o;
30943   e = ((likely(__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython)) ? ((__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython->tp_traverse) ? __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython)); if (e) return e;
30944   if (p->Q) {
30945     e = (*v)(((PyObject *)p->Q), a); if (e) return e;
30946   }
30947   if (p->index) {
30948     e = (*v)(((PyObject *)p->index), a); if (e) return e;
30949   }
30950   if (p->dQ) {
30951     e = (*v)(((PyObject *)p->dQ), a); if (e) return e;
30952   }
30953   if (p->Q_square_root) {
30954     e = (*v)(p->Q_square_root, a); if (e) return e;
30955   }
30956   return 0;
30957 }
30958 
__pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject * o)30959 static int __pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython(PyObject *o) {
30960   PyObject* tmp;
30961   struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython *)o;
30962   if (likely(__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython)) { if (__pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython->tp_clear) __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython);
30963   tmp = ((PyObject*)p->Q);
30964   p->Q = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30965   Py_XDECREF(tmp);
30966   tmp = ((PyObject*)p->index);
30967   p->index = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30968   Py_XDECREF(tmp);
30969   tmp = ((PyObject*)p->dQ);
30970   p->dQ = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
30971   Py_XDECREF(tmp);
30972   tmp = ((PyObject*)p->Q_square_root);
30973   p->Q_square_root = ((PyObject*)Py_None); Py_INCREF(Py_None);
30974   Py_XDECREF(tmp);
30975   return 0;
30976 }
30977 
30978 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_Q_handling_Cython[] = {
30979   {"Qk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_3Qk, METH_O, __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython_2Qk},
30980   {"dQk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_5dQk, METH_O, 0},
30981   {"Q_srk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_7Q_srk, METH_O, __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython_6Q_srk},
30982   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_9__reduce_cython__, METH_NOARGS, 0},
30983   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_11__setstate_cython__, METH_O, 0},
30984   {0, 0, 0, 0}
30985 };
30986 
30987 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython = {
30988   PyVarObject_HEAD_INIT(0, 0)
30989   "GPy.models.state_space_cython.Q_handling_Cython", /*tp_name*/
30990   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_Q_handling_Cython), /*tp_basicsize*/
30991   0, /*tp_itemsize*/
30992   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Q_handling_Cython, /*tp_dealloc*/
30993   #if PY_VERSION_HEX < 0x030800b4
30994   0, /*tp_print*/
30995   #endif
30996   #if PY_VERSION_HEX >= 0x030800b4
30997   0, /*tp_vectorcall_offset*/
30998   #endif
30999   0, /*tp_getattr*/
31000   0, /*tp_setattr*/
31001   #if PY_MAJOR_VERSION < 3
31002   0, /*tp_compare*/
31003   #endif
31004   #if PY_MAJOR_VERSION >= 3
31005   0, /*tp_as_async*/
31006   #endif
31007   0, /*tp_repr*/
31008   0, /*tp_as_number*/
31009   0, /*tp_as_sequence*/
31010   0, /*tp_as_mapping*/
31011   0, /*tp_hash*/
31012   0, /*tp_call*/
31013   0, /*tp_str*/
31014   0, /*tp_getattro*/
31015   0, /*tp_setattro*/
31016   0, /*tp_as_buffer*/
31017   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31018   0, /*tp_doc*/
31019   __pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython, /*tp_traverse*/
31020   __pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython, /*tp_clear*/
31021   0, /*tp_richcompare*/
31022   0, /*tp_weaklistoffset*/
31023   0, /*tp_iter*/
31024   0, /*tp_iternext*/
31025   __pyx_methods_3GPy_6models_18state_space_cython_Q_handling_Cython, /*tp_methods*/
31026   0, /*tp_members*/
31027   0, /*tp_getset*/
31028   0, /*tp_base*/
31029   0, /*tp_dict*/
31030   0, /*tp_descr_get*/
31031   0, /*tp_descr_set*/
31032   0, /*tp_dictoffset*/
31033   __pyx_pw_3GPy_6models_18state_space_cython_17Q_handling_Cython_1__init__, /*tp_init*/
31034   0, /*tp_alloc*/
31035   __pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython, /*tp_new*/
31036   0, /*tp_free*/
31037   0, /*tp_is_gc*/
31038   0, /*tp_bases*/
31039   0, /*tp_mro*/
31040   0, /*tp_cache*/
31041   0, /*tp_subclasses*/
31042   0, /*tp_weaklist*/
31043   0, /*tp_del*/
31044   0, /*tp_version_tag*/
31045   #if PY_VERSION_HEX >= 0x030400a1
31046   0, /*tp_finalize*/
31047   #endif
31048   #if PY_VERSION_HEX >= 0x030800b1
31049   0, /*tp_vectorcall*/
31050   #endif
31051   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31052   0, /*tp_print*/
31053   #endif
31054 };
31055 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
31056 
__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyTypeObject * t,PyObject * a,PyObject * k)31057 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyTypeObject *t, PyObject *a, PyObject *k) {
31058   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *p;
31059   PyObject *o = __pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython(t, a, k);
31060   if (unlikely(!o)) return 0;
31061   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)o);
31062   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython*)__pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
31063   p->A = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31064   p->dA = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31065   return o;
31066 }
31067 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject * o)31068 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject *o) {
31069   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)o;
31070   #if CYTHON_USE_TP_FINALIZE
31071   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31072     if (PyObject_CallFinalizerFromDealloc(o)) return;
31073   }
31074   #endif
31075   PyObject_GC_UnTrack(o);
31076   Py_CLEAR(p->A);
31077   Py_CLEAR(p->dA);
31078   PyObject_GC_Track(o);
31079   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Q_handling_Cython(o);
31080 }
31081 
__pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject * o,visitproc v,void * a)31082 static int __pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject *o, visitproc v, void *a) {
31083   int e;
31084   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)o;
31085   e = __pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython(o, v, a); if (e) return e;
31086   if (p->A) {
31087     e = (*v)(((PyObject *)p->A), a); if (e) return e;
31088   }
31089   if (p->dA) {
31090     e = (*v)(((PyObject *)p->dA), a); if (e) return e;
31091   }
31092   return 0;
31093 }
31094 
__pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject * o)31095 static int __pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython(PyObject *o) {
31096   PyObject* tmp;
31097   struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython *)o;
31098   __pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython(o);
31099   tmp = ((PyObject*)p->A);
31100   p->A = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31101   Py_XDECREF(tmp);
31102   tmp = ((PyObject*)p->dA);
31103   p->dA = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31104   Py_XDECREF(tmp);
31105   return 0;
31106 }
31107 
31108 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython[] = {
31109   {"f_a", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_3f_a, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_2f_a},
31110   {"Ak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_5Ak, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_4Ak},
31111   {"dAk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_7dAk, METH_O, 0},
31112   {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_9reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_8reset},
31113   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_11__reduce_cython__, METH_NOARGS, 0},
31114   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_13__setstate_cython__, METH_O, 0},
31115   {0, 0, 0, 0}
31116 };
31117 
31118 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython = {
31119   PyVarObject_HEAD_INIT(0, 0)
31120   "GPy.models.state_space_cython.Std_Dynamic_Callables_Cython", /*tp_name*/
31121   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython), /*tp_basicsize*/
31122   0, /*tp_itemsize*/
31123   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython, /*tp_dealloc*/
31124   #if PY_VERSION_HEX < 0x030800b4
31125   0, /*tp_print*/
31126   #endif
31127   #if PY_VERSION_HEX >= 0x030800b4
31128   0, /*tp_vectorcall_offset*/
31129   #endif
31130   0, /*tp_getattr*/
31131   0, /*tp_setattr*/
31132   #if PY_MAJOR_VERSION < 3
31133   0, /*tp_compare*/
31134   #endif
31135   #if PY_MAJOR_VERSION >= 3
31136   0, /*tp_as_async*/
31137   #endif
31138   0, /*tp_repr*/
31139   0, /*tp_as_number*/
31140   0, /*tp_as_sequence*/
31141   0, /*tp_as_mapping*/
31142   0, /*tp_hash*/
31143   0, /*tp_call*/
31144   0, /*tp_str*/
31145   0, /*tp_getattro*/
31146   0, /*tp_setattro*/
31147   0, /*tp_as_buffer*/
31148   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31149   0, /*tp_doc*/
31150   __pyx_tp_traverse_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython, /*tp_traverse*/
31151   __pyx_tp_clear_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython, /*tp_clear*/
31152   0, /*tp_richcompare*/
31153   0, /*tp_weaklistoffset*/
31154   0, /*tp_iter*/
31155   0, /*tp_iternext*/
31156   __pyx_methods_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython, /*tp_methods*/
31157   0, /*tp_members*/
31158   0, /*tp_getset*/
31159   0, /*tp_base*/
31160   0, /*tp_dict*/
31161   0, /*tp_descr_get*/
31162   0, /*tp_descr_set*/
31163   0, /*tp_dictoffset*/
31164   __pyx_pw_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_1__init__, /*tp_init*/
31165   0, /*tp_alloc*/
31166   __pyx_tp_new_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython, /*tp_new*/
31167   0, /*tp_free*/
31168   0, /*tp_is_gc*/
31169   0, /*tp_bases*/
31170   0, /*tp_mro*/
31171   0, /*tp_cache*/
31172   0, /*tp_subclasses*/
31173   0, /*tp_weaklist*/
31174   0, /*tp_del*/
31175   0, /*tp_version_tag*/
31176   #if PY_VERSION_HEX >= 0x030400a1
31177   0, /*tp_finalize*/
31178   #endif
31179   #if PY_VERSION_HEX >= 0x030800b1
31180   0, /*tp_vectorcall*/
31181   #endif
31182   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31183   0, /*tp_print*/
31184   #endif
31185 };
31186 static struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_AQcompute_batch_Cython __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
31187 
__pyx_tp_new_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyTypeObject * t,PyObject * a,PyObject * k)31188 static PyObject *__pyx_tp_new_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyTypeObject *t, PyObject *a, PyObject *k) {
31189   struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *p;
31190   PyObject *o = __pyx_tp_new_3GPy_6models_18state_space_cython_Q_handling_Cython(t, a, k);
31191   if (unlikely(!o)) return 0;
31192   p = ((struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)o);
31193   p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython*)__pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
31194   p->As = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31195   p->Qs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31196   p->dAs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31197   p->dQs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31198   p->reconstruct_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31199   p->Q_svd_dict = ((PyObject*)Py_None); Py_INCREF(Py_None);
31200   return o;
31201 }
31202 
__pyx_tp_dealloc_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject * o)31203 static void __pyx_tp_dealloc_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject *o) {
31204   struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)o;
31205   #if CYTHON_USE_TP_FINALIZE
31206   if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
31207     if (PyObject_CallFinalizerFromDealloc(o)) return;
31208   }
31209   #endif
31210   PyObject_GC_UnTrack(o);
31211   Py_CLEAR(p->As);
31212   Py_CLEAR(p->Qs);
31213   Py_CLEAR(p->dAs);
31214   Py_CLEAR(p->dQs);
31215   Py_CLEAR(p->reconstruct_indices);
31216   Py_CLEAR(p->Q_svd_dict);
31217   PyObject_GC_Track(o);
31218   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_Q_handling_Cython(o);
31219 }
31220 
__pyx_tp_traverse_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject * o,visitproc v,void * a)31221 static int __pyx_tp_traverse_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject *o, visitproc v, void *a) {
31222   int e;
31223   struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)o;
31224   e = __pyx_tp_traverse_3GPy_6models_18state_space_cython_Q_handling_Cython(o, v, a); if (e) return e;
31225   if (p->As) {
31226     e = (*v)(((PyObject *)p->As), a); if (e) return e;
31227   }
31228   if (p->Qs) {
31229     e = (*v)(((PyObject *)p->Qs), a); if (e) return e;
31230   }
31231   if (p->dAs) {
31232     e = (*v)(((PyObject *)p->dAs), a); if (e) return e;
31233   }
31234   if (p->dQs) {
31235     e = (*v)(((PyObject *)p->dQs), a); if (e) return e;
31236   }
31237   if (p->reconstruct_indices) {
31238     e = (*v)(((PyObject *)p->reconstruct_indices), a); if (e) return e;
31239   }
31240   if (p->Q_svd_dict) {
31241     e = (*v)(p->Q_svd_dict, a); if (e) return e;
31242   }
31243   return 0;
31244 }
31245 
__pyx_tp_clear_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject * o)31246 static int __pyx_tp_clear_3GPy_6models_18state_space_cython_AQcompute_batch_Cython(PyObject *o) {
31247   PyObject* tmp;
31248   struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *p = (struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *)o;
31249   __pyx_tp_clear_3GPy_6models_18state_space_cython_Q_handling_Cython(o);
31250   tmp = ((PyObject*)p->As);
31251   p->As = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31252   Py_XDECREF(tmp);
31253   tmp = ((PyObject*)p->Qs);
31254   p->Qs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31255   Py_XDECREF(tmp);
31256   tmp = ((PyObject*)p->dAs);
31257   p->dAs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31258   Py_XDECREF(tmp);
31259   tmp = ((PyObject*)p->dQs);
31260   p->dQs = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31261   Py_XDECREF(tmp);
31262   tmp = ((PyObject*)p->reconstruct_indices);
31263   p->reconstruct_indices = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
31264   Py_XDECREF(tmp);
31265   tmp = ((PyObject*)p->Q_svd_dict);
31266   p->Q_svd_dict = ((PyObject*)Py_None); Py_INCREF(Py_None);
31267   Py_XDECREF(tmp);
31268   return 0;
31269 }
31270 
31271 static PyMethodDef __pyx_methods_3GPy_6models_18state_space_cython_AQcompute_batch_Cython[] = {
31272   {"f_a", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_3f_a, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_2f_a},
31273   {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_5reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_4reset},
31274   {"Ak", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_7Ak, METH_VARARGS|METH_KEYWORDS, 0},
31275   {"Qk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_9Qk, METH_O, 0},
31276   {"dAk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_11dAk, METH_O, 0},
31277   {"dQk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_13dQk, METH_O, 0},
31278   {"Q_srk", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_15Q_srk, METH_O, __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_14Q_srk},
31279   {"Q_inverse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_17Q_inverse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_16Q_inverse},
31280   {"__reduce_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_19__reduce_cython__, METH_NOARGS, 0},
31281   {"__setstate_cython__", (PyCFunction)__pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_21__setstate_cython__, METH_O, 0},
31282   {0, 0, 0, 0}
31283 };
31284 
31285 static PyTypeObject __pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython = {
31286   PyVarObject_HEAD_INIT(0, 0)
31287   "GPy.models.state_space_cython.AQcompute_batch_Cython", /*tp_name*/
31288   sizeof(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython), /*tp_basicsize*/
31289   0, /*tp_itemsize*/
31290   __pyx_tp_dealloc_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, /*tp_dealloc*/
31291   #if PY_VERSION_HEX < 0x030800b4
31292   0, /*tp_print*/
31293   #endif
31294   #if PY_VERSION_HEX >= 0x030800b4
31295   0, /*tp_vectorcall_offset*/
31296   #endif
31297   0, /*tp_getattr*/
31298   0, /*tp_setattr*/
31299   #if PY_MAJOR_VERSION < 3
31300   0, /*tp_compare*/
31301   #endif
31302   #if PY_MAJOR_VERSION >= 3
31303   0, /*tp_as_async*/
31304   #endif
31305   0, /*tp_repr*/
31306   0, /*tp_as_number*/
31307   0, /*tp_as_sequence*/
31308   0, /*tp_as_mapping*/
31309   0, /*tp_hash*/
31310   0, /*tp_call*/
31311   0, /*tp_str*/
31312   0, /*tp_getattro*/
31313   0, /*tp_setattro*/
31314   0, /*tp_as_buffer*/
31315   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
31316   "\n        Class for calculating matrices A, Q, dA, dQ of the discrete Kalman Filter\n        from the matrices F, L, Qc, P_ing, dF, dQc, dP_inf of the continuos state\n        equation. dt - time steps.       \n        \n        It has the same interface as AQcompute_once.\n        \n        It computes matrices for all time steps. This object is used when\n        there are not so many (controlled by internal variable) \n        different time steps and storing all the matrices do not take too much memory.\n        \n        Since all the matrices are computed all together, this object can be used\n        in smoother without repeating the computations.        \n        ", /*tp_doc*/
31317   __pyx_tp_traverse_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, /*tp_traverse*/
31318   __pyx_tp_clear_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, /*tp_clear*/
31319   0, /*tp_richcompare*/
31320   0, /*tp_weaklistoffset*/
31321   0, /*tp_iter*/
31322   0, /*tp_iternext*/
31323   __pyx_methods_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, /*tp_methods*/
31324   0, /*tp_members*/
31325   0, /*tp_getset*/
31326   0, /*tp_base*/
31327   0, /*tp_dict*/
31328   0, /*tp_descr_get*/
31329   0, /*tp_descr_set*/
31330   0, /*tp_dictoffset*/
31331   __pyx_pw_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_1__init__, /*tp_init*/
31332   0, /*tp_alloc*/
31333   __pyx_tp_new_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, /*tp_new*/
31334   0, /*tp_free*/
31335   0, /*tp_is_gc*/
31336   0, /*tp_bases*/
31337   0, /*tp_mro*/
31338   0, /*tp_cache*/
31339   0, /*tp_subclasses*/
31340   0, /*tp_weaklist*/
31341   0, /*tp_del*/
31342   0, /*tp_version_tag*/
31343   #if PY_VERSION_HEX >= 0x030400a1
31344   0, /*tp_finalize*/
31345   #endif
31346   #if PY_VERSION_HEX >= 0x030800b1
31347   0, /*tp_vectorcall*/
31348   #endif
31349   #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
31350   0, /*tp_print*/
31351   #endif
31352 };
31353 
31354 static PyMethodDef __pyx_methods[] = {
31355   {0, 0, 0, 0}
31356 };
31357 
31358 #if PY_MAJOR_VERSION >= 3
31359 #if CYTHON_PEP489_MULTI_PHASE_INIT
31360 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
31361 static int __pyx_pymod_exec_state_space_cython(PyObject* module); /*proto*/
31362 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
31363   {Py_mod_create, (void*)__pyx_pymod_create},
31364   {Py_mod_exec, (void*)__pyx_pymod_exec_state_space_cython},
31365   {0, NULL}
31366 };
31367 #endif
31368 
31369 static struct PyModuleDef __pyx_moduledef = {
31370     PyModuleDef_HEAD_INIT,
31371     "state_space_cython",
31372     __pyx_k_Contains_some_cython_code_for_s, /* m_doc */
31373   #if CYTHON_PEP489_MULTI_PHASE_INIT
31374     0, /* m_size */
31375   #else
31376     -1, /* m_size */
31377   #endif
31378     __pyx_methods /* m_methods */,
31379   #if CYTHON_PEP489_MULTI_PHASE_INIT
31380     __pyx_moduledef_slots, /* m_slots */
31381   #else
31382     NULL, /* m_reload */
31383   #endif
31384     NULL, /* m_traverse */
31385     NULL, /* m_clear */
31386     NULL /* m_free */
31387 };
31388 #endif
31389 #ifndef CYTHON_SMALL_CODE
31390 #if defined(__clang__)
31391     #define CYTHON_SMALL_CODE
31392 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
31393     #define CYTHON_SMALL_CODE __attribute__((cold))
31394 #else
31395     #define CYTHON_SMALL_CODE
31396 #endif
31397 #endif
31398 
31399 static __Pyx_StringTabEntry __pyx_string_tab[] = {
31400   {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
31401   {&__pyx_n_s_AQcompute_batch_Cython, __pyx_k_AQcompute_batch_Cython, sizeof(__pyx_k_AQcompute_batch_Cython), 0, 0, 1, 1},
31402   {&__pyx_n_s_A_time_var_index, __pyx_k_A_time_var_index, sizeof(__pyx_k_A_time_var_index), 0, 0, 1, 1},
31403   {&__pyx_n_s_Ak, __pyx_k_Ak, sizeof(__pyx_k_Ak), 0, 0, 1, 1},
31404   {&__pyx_n_s_As, __pyx_k_As, sizeof(__pyx_k_As), 0, 0, 1, 1},
31405   {&__pyx_n_s_DTYPE, __pyx_k_DTYPE, sizeof(__pyx_k_DTYPE), 0, 0, 1, 1},
31406   {&__pyx_n_s_DTYPE_int, __pyx_k_DTYPE_int, sizeof(__pyx_k_DTYPE_int), 0, 0, 1, 1},
31407   {&__pyx_n_s_Dynamic_Callables_Cython, __pyx_k_Dynamic_Callables_Cython, sizeof(__pyx_k_Dynamic_Callables_Cython), 0, 0, 1, 1},
31408   {&__pyx_n_s_GPy_models_state_space_cython, __pyx_k_GPy_models_state_space_cython, sizeof(__pyx_k_GPy_models_state_space_cython), 0, 0, 1, 1},
31409   {&__pyx_kp_s_GPy_models_state_space_cython_py, __pyx_k_GPy_models_state_space_cython_py, sizeof(__pyx_k_GPy_models_state_space_cython_py), 0, 0, 1, 0},
31410   {&__pyx_n_s_H, __pyx_k_H, sizeof(__pyx_k_H), 0, 0, 1, 1},
31411   {&__pyx_n_s_H_time_var_index, __pyx_k_H_time_var_index, sizeof(__pyx_k_H_time_var_index), 0, 0, 1, 1},
31412   {&__pyx_n_s_Hk, __pyx_k_Hk, sizeof(__pyx_k_Hk), 0, 0, 1, 1},
31413   {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
31414   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x14, __pyx_k_Incompatible_checksums_s_vs_0x14, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x14), 0, 0, 1, 0},
31415   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x70, __pyx_k_Incompatible_checksums_s_vs_0x70, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x70), 0, 0, 1, 0},
31416   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x77, __pyx_k_Incompatible_checksums_s_vs_0x77, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x77), 0, 0, 1, 0},
31417   {&__pyx_kp_s_Incompatible_checksums_s_vs_0x9e, __pyx_k_Incompatible_checksums_s_vs_0x9e, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x9e), 0, 0, 1, 0},
31418   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xd4, __pyx_k_Incompatible_checksums_s_vs_0xd4, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xd4), 0, 0, 1, 0},
31419   {&__pyx_kp_s_Incompatible_checksums_s_vs_0xdf, __pyx_k_Incompatible_checksums_s_vs_0xdf, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xdf), 0, 0, 1, 0},
31420   {&__pyx_n_s_K, __pyx_k_K, sizeof(__pyx_k_K), 0, 0, 1, 1},
31421   {&__pyx_kp_s_Kalman_Filter_Update_SVD_S_is_ne, __pyx_k_Kalman_Filter_Update_SVD_S_is_ne, sizeof(__pyx_k_Kalman_Filter_Update_SVD_S_is_ne), 0, 0, 1, 0},
31422   {&__pyx_n_s_M, __pyx_k_M, sizeof(__pyx_k_M), 0, 0, 1, 1},
31423   {&__pyx_n_s_Measurement_Callables_Cython, __pyx_k_Measurement_Callables_Cython, sizeof(__pyx_k_Measurement_Callables_Cython), 0, 0, 1, 1},
31424   {&__pyx_kp_s_Measurement_dimension_larger_the, __pyx_k_Measurement_dimension_larger_the, sizeof(__pyx_k_Measurement_dimension_larger_the), 0, 0, 1, 0},
31425   {&__pyx_kp_s_Nan_measurements_are_currently_n, __pyx_k_Nan_measurements_are_currently_n, sizeof(__pyx_k_Nan_measurements_are_currently_n), 0, 0, 1, 0},
31426   {&__pyx_kp_s_Nan_values_in_likelihood_update, __pyx_k_Nan_values_in_likelihood_update, sizeof(__pyx_k_Nan_values_in_likelihood_update), 0, 0, 1, 0},
31427   {&__pyx_n_s_NotImplemented, __pyx_k_NotImplemented, sizeof(__pyx_k_NotImplemented), 0, 0, 1, 1},
31428   {&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1},
31429   {&__pyx_n_s_P_init, __pyx_k_P_init, sizeof(__pyx_k_P_init), 0, 0, 1, 1},
31430   {&__pyx_n_s_P_pred, __pyx_k_P_pred, sizeof(__pyx_k_P_pred), 0, 0, 1, 1},
31431   {&__pyx_n_s_P_upd, __pyx_k_P_upd, sizeof(__pyx_k_P_upd), 0, 0, 1, 1},
31432   {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
31433   {&__pyx_n_s_Prev_cov, __pyx_k_Prev_cov, sizeof(__pyx_k_Prev_cov), 0, 0, 1, 1},
31434   {&__pyx_n_s_Q, __pyx_k_Q, sizeof(__pyx_k_Q), 0, 0, 1, 1},
31435   {&__pyx_n_s_Q_handling_Cython, __pyx_k_Q_handling_Cython, sizeof(__pyx_k_Q_handling_Cython), 0, 0, 1, 1},
31436   {&__pyx_n_s_Q_inverse, __pyx_k_Q_inverse, sizeof(__pyx_k_Q_inverse), 0, 0, 1, 1},
31437   {&__pyx_n_s_Q_inverse_dict, __pyx_k_Q_inverse_dict, sizeof(__pyx_k_Q_inverse_dict), 0, 0, 1, 1},
31438   {&__pyx_n_s_Q_square_root_dict, __pyx_k_Q_square_root_dict, sizeof(__pyx_k_Q_square_root_dict), 0, 0, 1, 1},
31439   {&__pyx_n_s_Q_sr, __pyx_k_Q_sr, sizeof(__pyx_k_Q_sr), 0, 0, 1, 1},
31440   {&__pyx_n_s_Q_srk, __pyx_k_Q_srk, sizeof(__pyx_k_Q_srk), 0, 0, 1, 1},
31441   {&__pyx_n_s_Q_time_var_index, __pyx_k_Q_time_var_index, sizeof(__pyx_k_Q_time_var_index), 0, 0, 1, 1},
31442   {&__pyx_n_s_Qk, __pyx_k_Qk, sizeof(__pyx_k_Qk), 0, 0, 1, 1},
31443   {&__pyx_n_s_Qs, __pyx_k_Qs, sizeof(__pyx_k_Qs), 0, 0, 1, 1},
31444   {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
31445   {&__pyx_n_s_R_handling_Cython, __pyx_k_R_handling_Cython, sizeof(__pyx_k_R_handling_Cython), 0, 0, 1, 1},
31446   {&__pyx_n_s_R_isr, __pyx_k_R_isr, sizeof(__pyx_k_R_isr), 0, 0, 1, 1},
31447   {&__pyx_n_s_R_isrk, __pyx_k_R_isrk, sizeof(__pyx_k_R_isrk), 0, 0, 1, 1},
31448   {&__pyx_n_s_R_time_var_index, __pyx_k_R_time_var_index, sizeof(__pyx_k_R_time_var_index), 0, 0, 1, 1},
31449   {&__pyx_n_s_Rk, __pyx_k_Rk, sizeof(__pyx_k_Rk), 0, 0, 1, 1},
31450   {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1},
31451   {&__pyx_n_s_S_new, __pyx_k_S_new, sizeof(__pyx_k_S_new), 0, 0, 1, 1},
31452   {&__pyx_n_s_S_old, __pyx_k_S_old, sizeof(__pyx_k_S_old), 0, 0, 1, 1},
31453   {&__pyx_n_s_S_pred, __pyx_k_S_pred, sizeof(__pyx_k_S_pred), 0, 0, 1, 1},
31454   {&__pyx_n_s_S_svd, __pyx_k_S_svd, sizeof(__pyx_k_S_svd), 0, 0, 1, 1},
31455   {&__pyx_n_s_S_upd, __pyx_k_S_upd, sizeof(__pyx_k_S_upd), 0, 0, 1, 1},
31456   {&__pyx_n_s_Std_Dynamic_Callables_Cython, __pyx_k_Std_Dynamic_Callables_Cython, sizeof(__pyx_k_Std_Dynamic_Callables_Cython), 0, 0, 1, 1},
31457   {&__pyx_n_s_Std_Measurement_Callables_Cython, __pyx_k_Std_Measurement_Callables_Cython, sizeof(__pyx_k_Std_Measurement_Callables_Cython), 0, 0, 1, 1},
31458   {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
31459   {&__pyx_n_s_U, __pyx_k_U, sizeof(__pyx_k_U), 0, 0, 1, 1},
31460   {&__pyx_n_s_U_upd, __pyx_k_U_upd, sizeof(__pyx_k_U_upd), 0, 0, 1, 1},
31461   {&__pyx_n_s_V_new, __pyx_k_V_new, sizeof(__pyx_k_V_new), 0, 0, 1, 1},
31462   {&__pyx_n_s_V_old, __pyx_k_V_old, sizeof(__pyx_k_V_old), 0, 0, 1, 1},
31463   {&__pyx_n_s_V_pred, __pyx_k_V_pred, sizeof(__pyx_k_V_pred), 0, 0, 1, 1},
31464   {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
31465   {&__pyx_n_s_Vh, __pyx_k_Vh, sizeof(__pyx_k_Vh), 0, 0, 1, 1},
31466   {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1},
31467   {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1},
31468   {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
31469   {&__pyx_n_s_any, __pyx_k_any, sizeof(__pyx_k_any), 0, 0, 1, 1},
31470   {&__pyx_n_s_axis, __pyx_k_axis, sizeof(__pyx_k_axis), 0, 0, 1, 1},
31471   {&__pyx_n_s_calc_grad_log_likelihood, __pyx_k_calc_grad_log_likelihood, sizeof(__pyx_k_calc_grad_log_likelihood), 0, 0, 1, 1},
31472   {&__pyx_n_s_calc_log_likelihood, __pyx_k_calc_log_likelihood, sizeof(__pyx_k_calc_log_likelihood), 0, 0, 1, 1},
31473   {&__pyx_n_s_check_finite, __pyx_k_check_finite, sizeof(__pyx_k_check_finite), 0, 0, 1, 1},
31474   {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
31475   {&__pyx_n_s_compute_derivatives, __pyx_k_compute_derivatives, sizeof(__pyx_k_compute_derivatives), 0, 0, 1, 1},
31476   {&__pyx_n_s_compute_uv, __pyx_k_compute_uv, sizeof(__pyx_k_compute_uv), 0, 0, 1, 1},
31477   {&__pyx_n_s_cont_discr_kalman_filter_raw_Cy, __pyx_k_cont_discr_kalman_filter_raw_Cy, sizeof(__pyx_k_cont_discr_kalman_filter_raw_Cy), 0, 0, 1, 1},
31478   {&__pyx_kp_s_cython_Ak_is_not_implemented, __pyx_k_cython_Ak_is_not_implemented, sizeof(__pyx_k_cython_Ak_is_not_implemented), 0, 0, 1, 0},
31479   {&__pyx_kp_s_cython_Hk_is_not_implemented, __pyx_k_cython_Hk_is_not_implemented, sizeof(__pyx_k_cython_Hk_is_not_implemented), 0, 0, 1, 0},
31480   {&__pyx_kp_s_cython_Q_srk_is_not_implemented, __pyx_k_cython_Q_srk_is_not_implemented, sizeof(__pyx_k_cython_Q_srk_is_not_implemented), 0, 0, 1, 0},
31481   {&__pyx_kp_s_cython_Qk_is_not_implemented, __pyx_k_cython_Qk_is_not_implemented, sizeof(__pyx_k_cython_Qk_is_not_implemented), 0, 0, 1, 0},
31482   {&__pyx_kp_s_cython_Rk_is_not_implemented, __pyx_k_cython_Rk_is_not_implemented, sizeof(__pyx_k_cython_Rk_is_not_implemented), 0, 0, 1, 0},
31483   {&__pyx_kp_s_cython_dAk_is_not_implemented, __pyx_k_cython_dAk_is_not_implemented, sizeof(__pyx_k_cython_dAk_is_not_implemented), 0, 0, 1, 0},
31484   {&__pyx_kp_s_cython_dQk_is_not_implemented, __pyx_k_cython_dQk_is_not_implemented, sizeof(__pyx_k_cython_dQk_is_not_implemented), 0, 0, 1, 0},
31485   {&__pyx_kp_s_cython_f_a_is_not_implemented, __pyx_k_cython_f_a_is_not_implemented, sizeof(__pyx_k_cython_f_a_is_not_implemented), 0, 0, 1, 0},
31486   {&__pyx_kp_s_cython_reset_is_not_implemented, __pyx_k_cython_reset_is_not_implemented, sizeof(__pyx_k_cython_reset_is_not_implemented), 0, 0, 1, 0},
31487   {&__pyx_n_s_dA, __pyx_k_dA, sizeof(__pyx_k_dA), 0, 0, 1, 1},
31488   {&__pyx_n_s_dA_all_params, __pyx_k_dA_all_params, sizeof(__pyx_k_dA_all_params), 0, 0, 1, 1},
31489   {&__pyx_kp_s_dA_derivative_is_None, __pyx_k_dA_derivative_is_None, sizeof(__pyx_k_dA_derivative_is_None), 0, 0, 1, 0},
31490   {&__pyx_n_s_dAk, __pyx_k_dAk, sizeof(__pyx_k_dAk), 0, 0, 1, 1},
31491   {&__pyx_n_s_dAs, __pyx_k_dAs, sizeof(__pyx_k_dAs), 0, 0, 1, 1},
31492   {&__pyx_n_s_dH, __pyx_k_dH, sizeof(__pyx_k_dH), 0, 0, 1, 1},
31493   {&__pyx_n_s_dH_all_params, __pyx_k_dH_all_params, sizeof(__pyx_k_dH_all_params), 0, 0, 1, 1},
31494   {&__pyx_kp_s_dH_derivative_is_None, __pyx_k_dH_derivative_is_None, sizeof(__pyx_k_dH_derivative_is_None), 0, 0, 1, 0},
31495   {&__pyx_n_s_dHk, __pyx_k_dHk, sizeof(__pyx_k_dHk), 0, 0, 1, 1},
31496   {&__pyx_n_s_dK, __pyx_k_dK, sizeof(__pyx_k_dK), 0, 0, 1, 1},
31497   {&__pyx_n_s_dP_init, __pyx_k_dP_init, sizeof(__pyx_k_dP_init), 0, 0, 1, 1},
31498   {&__pyx_n_s_dP_pred, __pyx_k_dP_pred, sizeof(__pyx_k_dP_pred), 0, 0, 1, 1},
31499   {&__pyx_n_s_dP_pred_all_params, __pyx_k_dP_pred_all_params, sizeof(__pyx_k_dP_pred_all_params), 0, 0, 1, 1},
31500   {&__pyx_n_s_dP_upd, __pyx_k_dP_upd, sizeof(__pyx_k_dP_upd), 0, 0, 1, 1},
31501   {&__pyx_n_s_dQ, __pyx_k_dQ, sizeof(__pyx_k_dQ), 0, 0, 1, 1},
31502   {&__pyx_n_s_dQ_all_params, __pyx_k_dQ_all_params, sizeof(__pyx_k_dQ_all_params), 0, 0, 1, 1},
31503   {&__pyx_kp_s_dQ_derivative_is_None, __pyx_k_dQ_derivative_is_None, sizeof(__pyx_k_dQ_derivative_is_None), 0, 0, 1, 0},
31504   {&__pyx_n_s_dQk, __pyx_k_dQk, sizeof(__pyx_k_dQk), 0, 0, 1, 1},
31505   {&__pyx_n_s_dQs, __pyx_k_dQs, sizeof(__pyx_k_dQs), 0, 0, 1, 1},
31506   {&__pyx_n_s_dR, __pyx_k_dR, sizeof(__pyx_k_dR), 0, 0, 1, 1},
31507   {&__pyx_n_s_dR_all_params, __pyx_k_dR_all_params, sizeof(__pyx_k_dR_all_params), 0, 0, 1, 1},
31508   {&__pyx_kp_s_dR_derivative_is_None, __pyx_k_dR_derivative_is_None, sizeof(__pyx_k_dR_derivative_is_None), 0, 0, 1, 0},
31509   {&__pyx_n_s_dRk, __pyx_k_dRk, sizeof(__pyx_k_dRk), 0, 0, 1, 1},
31510   {&__pyx_n_s_dS, __pyx_k_dS, sizeof(__pyx_k_dS), 0, 0, 1, 1},
31511   {&__pyx_n_s_d_log_likelihood_update, __pyx_k_d_log_likelihood_update, sizeof(__pyx_k_d_log_likelihood_update), 0, 0, 1, 1},
31512   {&__pyx_n_s_diag, __pyx_k_diag, sizeof(__pyx_k_diag), 0, 0, 1, 1},
31513   {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
31514   {&__pyx_n_s_dm_init, __pyx_k_dm_init, sizeof(__pyx_k_dm_init), 0, 0, 1, 1},
31515   {&__pyx_n_s_dm_pred, __pyx_k_dm_pred, sizeof(__pyx_k_dm_pred), 0, 0, 1, 1},
31516   {&__pyx_n_s_dm_pred_all_params, __pyx_k_dm_pred_all_params, sizeof(__pyx_k_dm_pred_all_params), 0, 0, 1, 1},
31517   {&__pyx_n_s_dm_upd, __pyx_k_dm_upd, sizeof(__pyx_k_dm_upd), 0, 0, 1, 1},
31518   {&__pyx_n_s_dot, __pyx_k_dot, sizeof(__pyx_k_dot), 0, 0, 1, 1},
31519   {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
31520   {&__pyx_n_s_dv, __pyx_k_dv, sizeof(__pyx_k_dv), 0, 0, 1, 1},
31521   {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
31522   {&__pyx_n_s_f_a, __pyx_k_f_a, sizeof(__pyx_k_f_a), 0, 0, 1, 1},
31523   {&__pyx_n_s_f_h, __pyx_k_f_h, sizeof(__pyx_k_f_h), 0, 0, 1, 1},
31524   {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
31525   {&__pyx_n_s_full_matrices, __pyx_k_full_matrices, sizeof(__pyx_k_full_matrices), 0, 0, 1, 1},
31526   {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
31527   {&__pyx_n_s_grad_log_likelihood, __pyx_k_grad_log_likelihood, sizeof(__pyx_k_grad_log_likelihood), 0, 0, 1, 1},
31528   {&__pyx_n_s_grad_params_no, __pyx_k_grad_params_no, sizeof(__pyx_k_grad_params_no), 0, 0, 1, 1},
31529   {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
31530   {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
31531   {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
31532   {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
31533   {&__pyx_n_s_isnan, __pyx_k_isnan, sizeof(__pyx_k_isnan), 0, 0, 1, 1},
31534   {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
31535   {&__pyx_n_s_jitter, __pyx_k_jitter, sizeof(__pyx_k_jitter), 0, 0, 1, 1},
31536   {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
31537   {&__pyx_n_s_k_measurment, __pyx_k_k_measurment, sizeof(__pyx_k_k_measurment), 0, 0, 1, 1},
31538   {&__pyx_n_s_kalman_prediction_step_SVD_Cyth, __pyx_k_kalman_prediction_step_SVD_Cyth, sizeof(__pyx_k_kalman_prediction_step_SVD_Cyth), 0, 0, 1, 1},
31539   {&__pyx_n_s_kalman_update_step_SVD_Cython, __pyx_k_kalman_update_step_SVD_Cython, sizeof(__pyx_k_kalman_update_step_SVD_Cython), 0, 0, 1, 1},
31540   {&__pyx_n_s_linalg, __pyx_k_linalg, sizeof(__pyx_k_linalg), 0, 0, 1, 1},
31541   {&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
31542   {&__pyx_n_s_log_likelihood, __pyx_k_log_likelihood, sizeof(__pyx_k_log_likelihood), 0, 0, 1, 1},
31543   {&__pyx_n_s_log_likelihood_update, __pyx_k_log_likelihood_update, sizeof(__pyx_k_log_likelihood_update), 0, 0, 1, 1},
31544   {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
31545   {&__pyx_n_s_m_init, __pyx_k_m_init, sizeof(__pyx_k_m_init), 0, 0, 1, 1},
31546   {&__pyx_n_s_m_pred, __pyx_k_m_pred, sizeof(__pyx_k_m_pred), 0, 0, 1, 1},
31547   {&__pyx_n_s_m_upd, __pyx_k_m_upd, sizeof(__pyx_k_m_upd), 0, 0, 1, 1},
31548   {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
31549   {&__pyx_n_s_measurement, __pyx_k_measurement, sizeof(__pyx_k_measurement), 0, 0, 1, 1},
31550   {&__pyx_n_s_measurement_dim_gt_one, __pyx_k_measurement_dim_gt_one, sizeof(__pyx_k_measurement_dim_gt_one), 0, 0, 1, 1},
31551   {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
31552   {&__pyx_n_s_nbytes, __pyx_k_nbytes, sizeof(__pyx_k_nbytes), 0, 0, 1, 1},
31553   {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
31554   {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
31555   {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
31556   {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
31557   {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
31558   {&__pyx_n_s_overwrite_a, __pyx_k_overwrite_a, sizeof(__pyx_k_overwrite_a), 0, 0, 1, 1},
31559   {&__pyx_n_s_p_P, __pyx_k_p_P, sizeof(__pyx_k_p_P), 0, 0, 1, 1},
31560   {&__pyx_n_s_p_dP, __pyx_k_p_dP, sizeof(__pyx_k_p_dP), 0, 0, 1, 1},
31561   {&__pyx_n_s_p_dm, __pyx_k_p_dm, sizeof(__pyx_k_p_dm), 0, 0, 1, 1},
31562   {&__pyx_n_s_p_dynamic_callables, __pyx_k_p_dynamic_callables, sizeof(__pyx_k_p_dynamic_callables), 0, 0, 1, 1},
31563   {&__pyx_n_s_p_kalman_filter_type, __pyx_k_p_kalman_filter_type, sizeof(__pyx_k_p_kalman_filter_type), 0, 0, 1, 1},
31564   {&__pyx_n_s_p_m, __pyx_k_p_m, sizeof(__pyx_k_p_m), 0, 0, 1, 1},
31565   {&__pyx_n_s_p_measurement_callables, __pyx_k_p_measurement_callables, sizeof(__pyx_k_p_measurement_callables), 0, 0, 1, 1},
31566   {&__pyx_n_s_p_unique_Q_number, __pyx_k_p_unique_Q_number, sizeof(__pyx_k_p_unique_Q_number), 0, 0, 1, 1},
31567   {&__pyx_n_s_p_unique_R_number, __pyx_k_p_unique_R_number, sizeof(__pyx_k_p_unique_R_number), 0, 0, 1, 1},
31568   {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1},
31569   {&__pyx_n_s_param_number, __pyx_k_param_number, sizeof(__pyx_k_param_number), 0, 0, 1, 1},
31570   {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
31571   {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
31572   {&__pyx_n_s_prev_mean, __pyx_k_prev_mean, sizeof(__pyx_k_prev_mean), 0, 0, 1, 1},
31573   {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
31574   {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
31575   {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
31576   {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
31577   {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
31578   {&__pyx_n_s_pyx_unpickle_AQcompute_batch_C, __pyx_k_pyx_unpickle_AQcompute_batch_C, sizeof(__pyx_k_pyx_unpickle_AQcompute_batch_C), 0, 0, 1, 1},
31579   {&__pyx_n_s_pyx_unpickle_Dynamic_Callables, __pyx_k_pyx_unpickle_Dynamic_Callables, sizeof(__pyx_k_pyx_unpickle_Dynamic_Callables), 0, 0, 1, 1},
31580   {&__pyx_n_s_pyx_unpickle_Measurement_Calla, __pyx_k_pyx_unpickle_Measurement_Calla, sizeof(__pyx_k_pyx_unpickle_Measurement_Calla), 0, 0, 1, 1},
31581   {&__pyx_n_s_pyx_unpickle_Q_handling_Cython, __pyx_k_pyx_unpickle_Q_handling_Cython, sizeof(__pyx_k_pyx_unpickle_Q_handling_Cython), 0, 0, 1, 1},
31582   {&__pyx_n_s_pyx_unpickle_R_handling_Cython, __pyx_k_pyx_unpickle_R_handling_Cython, sizeof(__pyx_k_pyx_unpickle_R_handling_Cython), 0, 0, 1, 1},
31583   {&__pyx_n_s_pyx_unpickle_Std_Dynamic_Calla, __pyx_k_pyx_unpickle_Std_Dynamic_Calla, sizeof(__pyx_k_pyx_unpickle_Std_Dynamic_Calla), 0, 0, 1, 1},
31584   {&__pyx_n_s_pyx_unpickle_Std_Measurement_C, __pyx_k_pyx_unpickle_Std_Measurement_C, sizeof(__pyx_k_pyx_unpickle_Std_Measurement_C), 0, 0, 1, 1},
31585   {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
31586   {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
31587   {&__pyx_n_s_reconstruct_indices, __pyx_k_reconstruct_indices, sizeof(__pyx_k_reconstruct_indices), 0, 0, 1, 1},
31588   {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
31589   {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
31590   {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
31591   {&__pyx_n_s_regular, __pyx_k_regular, sizeof(__pyx_k_regular), 0, 0, 1, 1},
31592   {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
31593   {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
31594   {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
31595   {&__pyx_n_s_scipy, __pyx_k_scipy, sizeof(__pyx_k_scipy), 0, 0, 1, 1},
31596   {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
31597   {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
31598   {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
31599   {&__pyx_n_s_sp, __pyx_k_sp, sizeof(__pyx_k_sp), 0, 0, 1, 1},
31600   {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
31601   {&__pyx_n_s_state_dim, __pyx_k_state_dim, sizeof(__pyx_k_state_dim), 0, 0, 1, 1},
31602   {&__pyx_n_s_steps_no, __pyx_k_steps_no, sizeof(__pyx_k_steps_no), 0, 0, 1, 1},
31603   {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
31604   {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
31605   {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
31606   {&__pyx_n_s_svd, __pyx_k_svd, sizeof(__pyx_k_svd), 0, 0, 1, 1},
31607   {&__pyx_n_s_svd_1_matr, __pyx_k_svd_1_matr, sizeof(__pyx_k_svd_1_matr), 0, 0, 1, 1},
31608   {&__pyx_n_s_svd_2_matr, __pyx_k_svd_2_matr, sizeof(__pyx_k_svd_2_matr), 0, 0, 1, 1},
31609   {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
31610   {&__pyx_n_s_time_series_no, __pyx_k_time_series_no, sizeof(__pyx_k_time_series_no), 0, 0, 1, 1},
31611   {&__pyx_n_s_tmp1, __pyx_k_tmp1, sizeof(__pyx_k_tmp1), 0, 0, 1, 1},
31612   {&__pyx_n_s_tmp2, __pyx_k_tmp2, sizeof(__pyx_k_tmp2), 0, 0, 1, 1},
31613   {&__pyx_n_s_tmp3, __pyx_k_tmp3, sizeof(__pyx_k_tmp3), 0, 0, 1, 1},
31614   {&__pyx_n_s_tmp5, __pyx_k_tmp5, sizeof(__pyx_k_tmp5), 0, 0, 1, 1},
31615   {&__pyx_n_s_total_size_of_data, __pyx_k_total_size_of_data, sizeof(__pyx_k_total_size_of_data), 0, 0, 1, 1},
31616   {&__pyx_n_s_unique, __pyx_k_unique, sizeof(__pyx_k_unique), 0, 0, 1, 1},
31617   {&__pyx_n_s_unique_Q_number, __pyx_k_unique_Q_number, sizeof(__pyx_k_unique_Q_number), 0, 0, 1, 1},
31618   {&__pyx_n_s_unique_R_number, __pyx_k_unique_R_number, sizeof(__pyx_k_unique_R_number), 0, 0, 1, 1},
31619   {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
31620   {&__pyx_n_s_v, __pyx_k_v, sizeof(__pyx_k_v), 0, 0, 1, 1},
31621   {&__pyx_n_s_vstack, __pyx_k_vstack, sizeof(__pyx_k_vstack), 0, 0, 1, 1},
31622   {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
31623   {0, 0, 0, 0, 0, 0, 0}
31624 };
__Pyx_InitCachedBuiltins(void)31625 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
31626   __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 23, __pyx_L1_error)
31627   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 124, __pyx_L1_error)
31628   __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 177, __pyx_L1_error)
31629   __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 664, __pyx_L1_error)
31630   __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 947, __pyx_L1_error)
31631   return 0;
31632   __pyx_L1_error:;
31633   return -1;
31634 }
31635 
__Pyx_InitCachedConstants(void)31636 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
31637   __Pyx_RefNannyDeclarations
31638   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
31639 
31640   /* "GPy/models/state_space_cython.pyx":23
31641  * cdef class Dynamic_Callables_Cython:
31642  *     cpdef f_a(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] A):
31643  *         raise NotImplemented("(cython) f_a is not implemented!")             # <<<<<<<<<<<<<<
31644  *
31645  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix
31646  */
31647   __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_cython_f_a_is_not_implemented); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 23, __pyx_L1_error)
31648   __Pyx_GOTREF(__pyx_tuple_);
31649   __Pyx_GIVEREF(__pyx_tuple_);
31650 
31651   /* "GPy/models/state_space_cython.pyx":26
31652  *
31653  *     cpdef Ak(self, int k, np.ndarray[DTYPE_t, ndim=2] m, np.ndarray[DTYPE_t, ndim=2] P): # returns state iteration matrix
31654  *         raise NotImplemented("(cython) Ak is not implemented!")             # <<<<<<<<<<<<<<
31655  *
31656  *     cpdef Qk(self, int k):
31657  */
31658   __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_cython_Ak_is_not_implemented); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 26, __pyx_L1_error)
31659   __Pyx_GOTREF(__pyx_tuple__2);
31660   __Pyx_GIVEREF(__pyx_tuple__2);
31661 
31662   /* "GPy/models/state_space_cython.pyx":29
31663  *
31664  *     cpdef Qk(self, int k):
31665  *         raise NotImplemented("(cython) Qk is not implemented!")             # <<<<<<<<<<<<<<
31666  *
31667  *     cpdef Q_srk(self, int k):
31668  */
31669   __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_cython_Qk_is_not_implemented); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 29, __pyx_L1_error)
31670   __Pyx_GOTREF(__pyx_tuple__3);
31671   __Pyx_GIVEREF(__pyx_tuple__3);
31672 
31673   /* "GPy/models/state_space_cython.pyx":32
31674  *
31675  *     cpdef Q_srk(self, int k):
31676  *         raise NotImplemented("(cython) Q_srk is not implemented!")             # <<<<<<<<<<<<<<
31677  *
31678  *     cpdef dAk(self, int k):
31679  */
31680   __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_cython_Q_srk_is_not_implemented); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 32, __pyx_L1_error)
31681   __Pyx_GOTREF(__pyx_tuple__4);
31682   __Pyx_GIVEREF(__pyx_tuple__4);
31683 
31684   /* "GPy/models/state_space_cython.pyx":35
31685  *
31686  *     cpdef dAk(self, int k):
31687  *         raise NotImplemented("(cython) dAk is not implemented!")             # <<<<<<<<<<<<<<
31688  *
31689  *     cpdef dQk(self, int k):
31690  */
31691   __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_cython_dAk_is_not_implemented); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 35, __pyx_L1_error)
31692   __Pyx_GOTREF(__pyx_tuple__5);
31693   __Pyx_GIVEREF(__pyx_tuple__5);
31694 
31695   /* "GPy/models/state_space_cython.pyx":38
31696  *
31697  *     cpdef dQk(self, int k):
31698  *         raise NotImplemented("(cython) dQk is not implemented!")             # <<<<<<<<<<<<<<
31699  *
31700  *     cpdef reset(self, bint compute_derivatives = False):
31701  */
31702   __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_cython_dQk_is_not_implemented); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 38, __pyx_L1_error)
31703   __Pyx_GOTREF(__pyx_tuple__6);
31704   __Pyx_GIVEREF(__pyx_tuple__6);
31705 
31706   /* "GPy/models/state_space_cython.pyx":41
31707  *
31708  *     cpdef reset(self, bint compute_derivatives = False):
31709  *         raise NotImplemented("(cython) reset is not implemented!")             # <<<<<<<<<<<<<<
31710  *
31711  * # Template class for measurement callables
31712  */
31713   __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_cython_reset_is_not_implemented); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 41, __pyx_L1_error)
31714   __Pyx_GOTREF(__pyx_tuple__7);
31715   __Pyx_GIVEREF(__pyx_tuple__7);
31716 
31717   /* "GPy/models/state_space_cython.pyx":49
31718  *
31719  *     cpdef Hk(self, int k, np.ndarray[DTYPE_t, ndim=2] m_pred, np.ndarray[DTYPE_t, ndim=2] P_pred): # returns state iteration matrix
31720  *         raise NotImplemented("(cython) Hk is not implemented!")             # <<<<<<<<<<<<<<
31721  *
31722  *     cpdef Rk(self, int k):
31723  */
31724   __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_cython_Hk_is_not_implemented); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 49, __pyx_L1_error)
31725   __Pyx_GOTREF(__pyx_tuple__8);
31726   __Pyx_GIVEREF(__pyx_tuple__8);
31727 
31728   /* "GPy/models/state_space_cython.pyx":52
31729  *
31730  *     cpdef Rk(self, int k):
31731  *         raise NotImplemented("(cython) Rk is not implemented!")             # <<<<<<<<<<<<<<
31732  *
31733  *     cpdef R_isrk(self, int k):
31734  */
31735   __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_cython_Rk_is_not_implemented); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 52, __pyx_L1_error)
31736   __Pyx_GOTREF(__pyx_tuple__9);
31737   __Pyx_GIVEREF(__pyx_tuple__9);
31738 
31739   /* "GPy/models/state_space_cython.pyx":119
31740  *
31741  *     cpdef Rk(self, int k):
31742  *         return self.R[:,:, <int>self.index[self.R_time_var_index, k]]             # <<<<<<<<<<<<<<
31743  *
31744  *
31745  */
31746   __pyx_slice__10 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__10)) __PYX_ERR(0, 119, __pyx_L1_error)
31747   __Pyx_GOTREF(__pyx_slice__10);
31748   __Pyx_GIVEREF(__pyx_slice__10);
31749 
31750   /* "GPy/models/state_space_cython.pyx":124
31751  *     cpdef dRk(self,int k):
31752  *         if self.dR is None:
31753  *             raise ValueError("dR derivative is None")             # <<<<<<<<<<<<<<
31754  *
31755  *         return self.dR # the same dirivative on each iteration
31756  */
31757   __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_dR_derivative_is_None); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 124, __pyx_L1_error)
31758   __Pyx_GOTREF(__pyx_tuple__11);
31759   __Pyx_GIVEREF(__pyx_tuple__11);
31760 
31761   /* "GPy/models/state_space_cython.pyx":206
31762  *     cpdef dHk(self,int k):
31763  *         if self.dH is None:
31764  *             raise ValueError("dH derivative is None")             # <<<<<<<<<<<<<<
31765  *
31766  *         return self.dH # the same dirivative on each iteration
31767  */
31768   __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_dH_derivative_is_None); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 206, __pyx_L1_error)
31769   __Pyx_GOTREF(__pyx_tuple__12);
31770   __Pyx_GIVEREF(__pyx_tuple__12);
31771 
31772   /* "GPy/models/state_space_cython.pyx":273
31773  *     cpdef dQk(self, int k):
31774  *         if self.dQ is None:
31775  *             raise ValueError("dQ derivative is None")             # <<<<<<<<<<<<<<
31776  *
31777  *         return self.dQ # the same dirivative on each iteration
31778  */
31779   __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_dQ_derivative_is_None); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 273, __pyx_L1_error)
31780   __Pyx_GOTREF(__pyx_tuple__13);
31781   __Pyx_GIVEREF(__pyx_tuple__13);
31782 
31783   /* "GPy/models/state_space_cython.pyx":360
31784  *     cpdef dAk(self, int k):
31785  *         if self.dA is None:
31786  *             raise ValueError("dA derivative is None")             # <<<<<<<<<<<<<<
31787  *
31788  *         return self.dA # the same dirivative on each iteration
31789  */
31790   __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_dA_derivative_is_None); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 360, __pyx_L1_error)
31791   __Pyx_GOTREF(__pyx_tuple__14);
31792   __Pyx_GIVEREF(__pyx_tuple__14);
31793 
31794   /* "GPy/models/state_space_cython.pyx":817
31795  *             #log_likelihood_update = log_likelihood_update[0,0] # to make int
31796  *             if np.any(np.isnan(log_likelihood_update)): # some member in P_pred is None.
31797  *                 raise ValueError("Nan values in likelihood update!")             # <<<<<<<<<<<<<<
31798  *         else:
31799  *             log_likelihood_update = None
31800  */
31801   __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_Nan_values_in_likelihood_update); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 817, __pyx_L1_error)
31802   __Pyx_GOTREF(__pyx_tuple__15);
31803   __Pyx_GIVEREF(__pyx_tuple__15);
31804 
31805   /* "GPy/models/state_space_cython.pyx":823
31806  *     else:
31807  *         measurement_dim_gt_one = True
31808  *         raise ValueError("""Measurement dimension larger then 1 is currently not supported""")             # <<<<<<<<<<<<<<
31809  *
31810  *     # Old  method of computing updated covariance (for testing) ->
31811  */
31812   __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Measurement_dimension_larger_the); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 823, __pyx_L1_error)
31813   __Pyx_GOTREF(__pyx_tuple__16);
31814   __Pyx_GIVEREF(__pyx_tuple__16);
31815 
31816   /* "GPy/models/state_space_cython.pyx":928
31817  *     # Mean estimations. Initial values will be included
31818  *     cdef np.ndarray[DTYPE_t, ndim=3] M = np.empty(((steps_no+1),state_dim,time_series_no), dtype=DTYPE)
31819  *     M[0,:,:] = m_init # Initialize mean values             # <<<<<<<<<<<<<<
31820  *     # Variance estimations. Initial values will be included
31821  *     cdef np.ndarray[DTYPE_t, ndim=3] P = np.empty(((steps_no+1),state_dim,state_dim))
31822  */
31823   __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_0, __pyx_slice__10, __pyx_slice__10); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 928, __pyx_L1_error)
31824   __Pyx_GOTREF(__pyx_tuple__17);
31825   __Pyx_GIVEREF(__pyx_tuple__17);
31826 
31827   /* "GPy/models/state_space_cython.pyx":982
31828  *         else:
31829  *             if not np.all(np.isnan(k_measurment)):
31830  *                     raise ValueError("""Nan measurements are currently not supported if             # <<<<<<<<<<<<<<
31831  *                                      they are intermixed with not NaN measurements""")
31832  *             else:
31833  */
31834   __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Nan_measurements_are_currently_n); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 982, __pyx_L1_error)
31835   __Pyx_GOTREF(__pyx_tuple__18);
31836   __Pyx_GIVEREF(__pyx_tuple__18);
31837 
31838   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":947
31839  *         __pyx_import_array()
31840  *     except Exception:
31841  *         raise ImportError("numpy.core.multiarray failed to import")             # <<<<<<<<<<<<<<
31842  *
31843  * cdef inline int import_umath() except -1:
31844  */
31845   __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 947, __pyx_L1_error)
31846   __Pyx_GOTREF(__pyx_tuple__19);
31847   __Pyx_GIVEREF(__pyx_tuple__19);
31848 
31849   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":953
31850  *         _import_umath()
31851  *     except Exception:
31852  *         raise ImportError("numpy.core.umath failed to import")             # <<<<<<<<<<<<<<
31853  *
31854  * cdef inline int import_ufunc() except -1:
31855  */
31856   __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 953, __pyx_L1_error)
31857   __Pyx_GOTREF(__pyx_tuple__20);
31858   __Pyx_GIVEREF(__pyx_tuple__20);
31859 
31860   /* "GPy/models/state_space_cython.pyx":547
31861  *
31862  * @cython.boundscheck(False)
31863  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,             # <<<<<<<<<<<<<<
31864  *                                 Dynamic_Callables_Cython p_dynamic_callables,
31865  *                                 bint calc_grad_log_likelihood=False,
31866  */
31867   __pyx_tuple__21 = PyTuple_Pack(31, __pyx_n_s_k, __pyx_n_s_p_m, __pyx_n_s_p_P, __pyx_n_s_p_dynamic_callables, __pyx_n_s_calc_grad_log_likelihood, __pyx_n_s_p_dm, __pyx_n_s_p_dP, __pyx_n_s_Prev_cov, __pyx_n_s_S_old, __pyx_n_s_V_old, __pyx_n_s_A, __pyx_n_s_Q, __pyx_n_s_Q_sr, __pyx_n_s_m_pred, __pyx_n_s_svd_1_matr, __pyx_n_s_res, __pyx_n_s_U, __pyx_n_s_S, __pyx_n_s_Vh, __pyx_n_s_V_new, __pyx_n_s_S_new, __pyx_n_s_P_pred, __pyx_n_s_dA_all_params, __pyx_n_s_dQ_all_params, __pyx_n_s_dm_pred, __pyx_n_s_dP_pred, __pyx_n_s_param_number, __pyx_n_s_j, __pyx_n_s_ret, __pyx_n_s_dA, __pyx_n_s_dQ); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 547, __pyx_L1_error)
31868   __Pyx_GOTREF(__pyx_tuple__21);
31869   __Pyx_GIVEREF(__pyx_tuple__21);
31870   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(7, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_GPy_models_state_space_cython_py, __pyx_n_s_kalman_prediction_step_SVD_Cyth, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 547, __pyx_L1_error)
31871 
31872   /* "GPy/models/state_space_cython.pyx":686
31873  *
31874  * @cython.boundscheck(False)
31875  * def _kalman_update_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m, tuple p_P,             # <<<<<<<<<<<<<<
31876  *                             Measurement_Callables_Cython p_measurement_callables,
31877  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
31878  */
31879   __pyx_tuple__23 = PyTuple_Pack(52, __pyx_n_s_k, __pyx_n_s_p_m, __pyx_n_s_p_P, __pyx_n_s_p_measurement_callables, __pyx_n_s_measurement, __pyx_n_s_calc_log_likelihood, __pyx_n_s_calc_grad_log_likelihood, __pyx_n_s_p_dm, __pyx_n_s_p_dP, __pyx_n_s_m_pred, __pyx_n_s_P_pred, __pyx_n_s_S_pred, __pyx_n_s_V_pred, __pyx_n_s_H, __pyx_n_s_R, __pyx_n_s_R_isr, __pyx_n_s_time_series_no, __pyx_n_s_log_likelihood_update, __pyx_n_s_v, __pyx_n_s_svd_2_matr, __pyx_n_s_res, __pyx_n_s_U, __pyx_n_s_S_svd, __pyx_n_s_Vh, __pyx_n_s_U_upd, __pyx_n_s_S_upd, __pyx_n_s_P_upd, __pyx_n_s_S, __pyx_n_s_K, __pyx_n_s_measurement_dim_gt_one, __pyx_n_s_dm_upd, __pyx_n_s_dP_upd, __pyx_n_s_d_log_likelihood_update, __pyx_n_s_dm_pred_all_params, __pyx_n_s_dP_pred_all_params, __pyx_n_s_param_number, __pyx_n_s_dH_all_params, __pyx_n_s_dR_all_params, __pyx_n_s_param, __pyx_n_s_dH, __pyx_n_s_dR, __pyx_n_s_dm_pred, __pyx_n_s_dP_pred, __pyx_n_s_dv, __pyx_n_s_dS, __pyx_n_s_tmp1, __pyx_n_s_tmp2, __pyx_n_s_tmp3, __pyx_n_s_dK, __pyx_n_s_tmp5, __pyx_n_s_ret, __pyx_n_s_m_upd); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 686, __pyx_L1_error)
31880   __Pyx_GOTREF(__pyx_tuple__23);
31881   __Pyx_GIVEREF(__pyx_tuple__23);
31882   __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(9, 0, 52, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_GPy_models_state_space_cython_py, __pyx_n_s_kalman_update_step_SVD_Cython, 686, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 686, __pyx_L1_error)
31883 
31884   /* "GPy/models/state_space_cython.pyx":912
31885  *
31886  * @cython.boundscheck(False)
31887  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,             # <<<<<<<<<<<<<<
31888  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
31889  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
31890  */
31891   __pyx_tuple__25 = PyTuple_Pack(35, __pyx_n_s_state_dim, __pyx_n_s_p_dynamic_callables, __pyx_n_s_p_measurement_callables, __pyx_n_s_X, __pyx_n_s_Y, __pyx_n_s_m_init, __pyx_n_s_P_init, __pyx_n_s_p_kalman_filter_type, __pyx_n_s_calc_log_likelihood, __pyx_n_s_calc_grad_log_likelihood, __pyx_n_s_grad_params_no, __pyx_n_s_dm_init, __pyx_n_s_dP_init, __pyx_n_s_steps_no, __pyx_n_s_time_series_no, __pyx_n_s_M, __pyx_n_s_P, __pyx_n_s_U, __pyx_n_s_S, __pyx_n_s_Vh, __pyx_n_s_P_upd, __pyx_n_s_log_likelihood, __pyx_n_s_grad_log_likelihood, __pyx_n_s_dm_upd, __pyx_n_s_dP_upd, __pyx_n_s_prev_mean, __pyx_n_s_k_measurment, __pyx_n_s_m_pred, __pyx_n_s_m_upd, __pyx_n_s_P_pred, __pyx_n_s_dm_pred, __pyx_n_s_dP_pred, __pyx_n_s_log_likelihood_update, __pyx_n_s_d_log_likelihood_update, __pyx_n_s_k); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 912, __pyx_L1_error)
31892   __Pyx_GOTREF(__pyx_tuple__25);
31893   __Pyx_GIVEREF(__pyx_tuple__25);
31894   __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(13, 0, 35, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_GPy_models_state_space_cython_py, __pyx_n_s_cont_discr_kalman_filter_raw_Cy, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 912, __pyx_L1_error)
31895 
31896   /* "(tree fragment)":1
31897  * def __pyx_unpickle_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
31898  *     cdef object __pyx_PickleError
31899  *     cdef object __pyx_result
31900  */
31901   __pyx_tuple__27 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 1, __pyx_L1_error)
31902   __Pyx_GOTREF(__pyx_tuple__27);
31903   __Pyx_GIVEREF(__pyx_tuple__27);
31904   __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Dynamic_Callables, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(1, 1, __pyx_L1_error)
31905   __pyx_tuple__29 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 1, __pyx_L1_error)
31906   __Pyx_GOTREF(__pyx_tuple__29);
31907   __Pyx_GIVEREF(__pyx_tuple__29);
31908   __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Measurement_Calla, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(1, 1, __pyx_L1_error)
31909   __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 1, __pyx_L1_error)
31910   __Pyx_GOTREF(__pyx_tuple__31);
31911   __Pyx_GIVEREF(__pyx_tuple__31);
31912   __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_R_handling_Cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(1, 1, __pyx_L1_error)
31913   __pyx_tuple__33 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 1, __pyx_L1_error)
31914   __Pyx_GOTREF(__pyx_tuple__33);
31915   __Pyx_GIVEREF(__pyx_tuple__33);
31916   __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Std_Measurement_C, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 1, __pyx_L1_error)
31917   __pyx_tuple__35 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 1, __pyx_L1_error)
31918   __Pyx_GOTREF(__pyx_tuple__35);
31919   __Pyx_GIVEREF(__pyx_tuple__35);
31920   __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Q_handling_Cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
31921   __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 1, __pyx_L1_error)
31922   __Pyx_GOTREF(__pyx_tuple__37);
31923   __Pyx_GIVEREF(__pyx_tuple__37);
31924   __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Std_Dynamic_Calla, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(1, 1, __pyx_L1_error)
31925   __pyx_tuple__39 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 1, __pyx_L1_error)
31926   __Pyx_GOTREF(__pyx_tuple__39);
31927   __Pyx_GIVEREF(__pyx_tuple__39);
31928   __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_AQcompute_batch_C, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 1, __pyx_L1_error)
31929   __Pyx_RefNannyFinishContext();
31930   return 0;
31931   __pyx_L1_error:;
31932   __Pyx_RefNannyFinishContext();
31933   return -1;
31934 }
31935 
__Pyx_InitGlobals(void)31936 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
31937   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
31938   __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
31939   __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
31940   __pyx_float_1eneg_17 = PyFloat_FromDouble(1e-17); if (unlikely(!__pyx_float_1eneg_17)) __PYX_ERR(0, 1, __pyx_L1_error)
31941   __pyx_float_neg_0_5 = PyFloat_FromDouble(-0.5); if (unlikely(!__pyx_float_neg_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
31942   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
31943   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
31944   __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
31945   __pyx_int_21422583 = PyInt_FromLong(21422583L); if (unlikely(!__pyx_int_21422583)) __PYX_ERR(0, 1, __pyx_L1_error)
31946   __pyx_int_117883743 = PyInt_FromLong(117883743L); if (unlikely(!__pyx_int_117883743)) __PYX_ERR(0, 1, __pyx_L1_error)
31947   __pyx_int_125522784 = PyInt_FromLong(125522784L); if (unlikely(!__pyx_int_125522784)) __PYX_ERR(0, 1, __pyx_L1_error)
31948   __pyx_int_166296743 = PyInt_FromLong(166296743L); if (unlikely(!__pyx_int_166296743)) __PYX_ERR(0, 1, __pyx_L1_error)
31949   __pyx_int_222419149 = PyInt_FromLong(222419149L); if (unlikely(!__pyx_int_222419149)) __PYX_ERR(0, 1, __pyx_L1_error)
31950   __pyx_int_234819414 = PyInt_FromLong(234819414L); if (unlikely(!__pyx_int_234819414)) __PYX_ERR(0, 1, __pyx_L1_error)
31951   return 0;
31952   __pyx_L1_error:;
31953   return -1;
31954 }
31955 
31956 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
31957 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
31958 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
31959 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
31960 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
31961 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
31962 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
31963 
__Pyx_modinit_global_init_code(void)31964 static int __Pyx_modinit_global_init_code(void) {
31965   __Pyx_RefNannyDeclarations
31966   __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
31967   /*--- Global init code ---*/
31968   __Pyx_RefNannyFinishContext();
31969   return 0;
31970 }
31971 
__Pyx_modinit_variable_export_code(void)31972 static int __Pyx_modinit_variable_export_code(void) {
31973   __Pyx_RefNannyDeclarations
31974   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
31975   /*--- Variable export code ---*/
31976   __Pyx_RefNannyFinishContext();
31977   return 0;
31978 }
31979 
__Pyx_modinit_function_export_code(void)31980 static int __Pyx_modinit_function_export_code(void) {
31981   __Pyx_RefNannyDeclarations
31982   __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
31983   /*--- Function export code ---*/
31984   __Pyx_RefNannyFinishContext();
31985   return 0;
31986 }
31987 
__Pyx_modinit_type_init_code(void)31988 static int __Pyx_modinit_type_init_code(void) {
31989   __Pyx_RefNannyDeclarations
31990   int __pyx_lineno = 0;
31991   const char *__pyx_filename = NULL;
31992   int __pyx_clineno = 0;
31993   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
31994   /*--- Type init code ---*/
31995   __pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
31996   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.f_a = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_f_a;
31997   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.Ak = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Ak;
31998   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.Qk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Qk;
31999   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.Q_srk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_Q_srk;
32000   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.dAk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dAk;
32001   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.dQk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_dQk;
32002   __pyx_vtable_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.reset = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args))__pyx_f_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset;
32003   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
32004   #if PY_VERSION_HEX < 0x030800B1
32005   __pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.tp_print = 0;
32006   #endif
32007   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32008     __pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32009   }
32010   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
32011   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Dynamic_Callables_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
32012   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
32013   __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython = &__pyx_type_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
32014   __pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
32015   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.f_h = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_f_h;
32016   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.Hk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Hk;
32017   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.Rk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_Rk;
32018   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.R_isrk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_R_isrk;
32019   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.dHk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dHk;
32020   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.dRk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_dRk;
32021   __pyx_vtable_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.reset = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset *__pyx_optional_args))__pyx_f_3GPy_6models_18state_space_cython_28Measurement_Callables_Cython_reset;
32022   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
32023   #if PY_VERSION_HEX < 0x030800B1
32024   __pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.tp_print = 0;
32025   #endif
32026   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32027     __pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32028   }
32029   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
32030   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Measurement_Callables_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
32031   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 44, __pyx_L1_error)
32032   __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython = &__pyx_type_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
32033   __pyx_vtabptr_3GPy_6models_18state_space_cython_R_handling_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython;
32034   __pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython.__pyx_base = *__pyx_vtabptr_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
32035   __pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython.__pyx_base.Rk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_Rk;
32036   __pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython.__pyx_base.R_isrk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_R_isrk;
32037   __pyx_vtable_3GPy_6models_18state_space_cython_R_handling_Cython.__pyx_base.dRk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17R_handling_Cython_dRk;
32038   __pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_base = __pyx_ptype_3GPy_6models_18state_space_cython_Measurement_Callables_Cython;
32039   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
32040   #if PY_VERSION_HEX < 0x030800B1
32041   __pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_print = 0;
32042   #endif
32043   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32044     __pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32045   }
32046   #if CYTHON_COMPILING_IN_CPYTHON
32047   {
32048     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 66, __pyx_L1_error)
32049     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
32050       __pyx_wrapperbase_3GPy_6models_18state_space_cython_17R_handling_Cython___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
32051       __pyx_wrapperbase_3GPy_6models_18state_space_cython_17R_handling_Cython___init__.doc = __pyx_doc_3GPy_6models_18state_space_cython_17R_handling_Cython___init__;
32052       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3GPy_6models_18state_space_cython_17R_handling_Cython___init__;
32053     }
32054   }
32055   #endif
32056   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_R_handling_Cython) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
32057   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_R_handling_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
32058   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython) < 0) __PYX_ERR(0, 66, __pyx_L1_error)
32059   __pyx_ptype_3GPy_6models_18state_space_cython_R_handling_Cython = &__pyx_type_3GPy_6models_18state_space_cython_R_handling_Cython;
32060   __pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
32061   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.__pyx_base = *__pyx_vtabptr_3GPy_6models_18state_space_cython_R_handling_Cython;
32062   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.__pyx_base.__pyx_base.f_h = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_f_h;
32063   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.__pyx_base.__pyx_base.Hk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_Hk;
32064   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.__pyx_base.__pyx_base.dHk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Measurement_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_32Std_Measurement_Callables_Cython_dHk;
32065   __pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_base = __pyx_ptype_3GPy_6models_18state_space_cython_R_handling_Cython;
32066   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
32067   #if PY_VERSION_HEX < 0x030800B1
32068   __pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_print = 0;
32069   #endif
32070   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32071     __pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32072   }
32073   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
32074   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Std_Measurement_Callables_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
32075   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
32076   __pyx_ptype_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython = &__pyx_type_3GPy_6models_18state_space_cython_Std_Measurement_Callables_Cython;
32077   __pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython;
32078   __pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython.__pyx_base = *__pyx_vtabptr_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
32079   __pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython.__pyx_base.Qk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Qk;
32080   __pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython.__pyx_base.Q_srk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_Q_srk;
32081   __pyx_vtable_3GPy_6models_18state_space_cython_Q_handling_Cython.__pyx_base.dQk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_17Q_handling_Cython_dQk;
32082   __pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_base = __pyx_ptype_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython;
32083   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
32084   #if PY_VERSION_HEX < 0x030800B1
32085   __pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_print = 0;
32086   #endif
32087   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32088     __pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32089   }
32090   #if CYTHON_COMPILING_IN_CPYTHON
32091   {
32092     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 212, __pyx_L1_error)
32093     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
32094       __pyx_wrapperbase_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
32095       __pyx_wrapperbase_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__.doc = __pyx_doc_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__;
32096       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3GPy_6models_18state_space_cython_17Q_handling_Cython___init__;
32097     }
32098   }
32099   #endif
32100   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
32101   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Q_handling_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
32102   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
32103   __pyx_ptype_3GPy_6models_18state_space_cython_Q_handling_Cython = &__pyx_type_3GPy_6models_18state_space_cython_Q_handling_Cython;
32104   __pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
32105   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.__pyx_base = *__pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython;
32106   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.__pyx_base.__pyx_base.f_a = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_f_a;
32107   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.__pyx_base.__pyx_base.Ak = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_Ak;
32108   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.__pyx_base.__pyx_base.dAk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_dAk;
32109   __pyx_vtable_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.__pyx_base.__pyx_base.reset = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args))__pyx_f_3GPy_6models_18state_space_cython_28Std_Dynamic_Callables_Cython_reset;
32110   __pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_base = __pyx_ptype_3GPy_6models_18state_space_cython_Q_handling_Cython;
32111   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
32112   #if PY_VERSION_HEX < 0x030800B1
32113   __pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_print = 0;
32114   #endif
32115   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32116     __pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32117   }
32118   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
32119   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Std_Dynamic_Callables_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
32120   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython) < 0) __PYX_ERR(0, 318, __pyx_L1_error)
32121   __pyx_ptype_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython = &__pyx_type_3GPy_6models_18state_space_cython_Std_Dynamic_Callables_Cython;
32122   __pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython = &__pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
32123   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base = *__pyx_vtabptr_3GPy_6models_18state_space_cython_Q_handling_Cython;
32124   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.f_a = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_f_a;
32125   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.Ak = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, PyArrayObject *, PyArrayObject *, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Ak;
32126   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.Qk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Qk;
32127   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.Q_srk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_srk;
32128   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.dAk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dAk;
32129   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.dQk = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int, int __pyx_skip_dispatch))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_dQk;
32130   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.__pyx_base.__pyx_base.reset = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_Dynamic_Callables_Cython *, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_24Dynamic_Callables_Cython_reset *__pyx_optional_args))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_reset;
32131   __pyx_vtable_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.Q_inverse = (PyObject *(*)(struct __pyx_obj_3GPy_6models_18state_space_cython_AQcompute_batch_Cython *, int, int __pyx_skip_dispatch, struct __pyx_opt_args_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse *__pyx_optional_args))__pyx_f_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython_Q_inverse;
32132   __pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_base = __pyx_ptype_3GPy_6models_18state_space_cython_Q_handling_Cython;
32133   if (PyType_Ready(&__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
32134   #if PY_VERSION_HEX < 0x030800B1
32135   __pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_print = 0;
32136   #endif
32137   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_dictoffset && __pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_getattro == PyObject_GenericGetAttr)) {
32138     __pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_getattro = __Pyx_PyObject_GenericGetAttr;
32139   }
32140   #if CYTHON_COMPILING_IN_CPYTHON
32141   {
32142     PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 373, __pyx_L1_error)
32143     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
32144       __pyx_wrapperbase_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
32145       __pyx_wrapperbase_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__.doc = __pyx_doc_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__;
32146       ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_3GPy_6models_18state_space_cython_22AQcompute_batch_Cython___init__;
32147     }
32148   }
32149   #endif
32150   if (__Pyx_SetVtable(__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython.tp_dict, __pyx_vtabptr_3GPy_6models_18state_space_cython_AQcompute_batch_Cython) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
32151   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AQcompute_batch_Cython, (PyObject *)&__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
32152   if (__Pyx_setup_reduce((PyObject*)&__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
32153   __pyx_ptype_3GPy_6models_18state_space_cython_AQcompute_batch_Cython = &__pyx_type_3GPy_6models_18state_space_cython_AQcompute_batch_Cython;
32154   __Pyx_RefNannyFinishContext();
32155   return 0;
32156   __pyx_L1_error:;
32157   __Pyx_RefNannyFinishContext();
32158   return -1;
32159 }
32160 
__Pyx_modinit_type_import_code(void)32161 static int __Pyx_modinit_type_import_code(void) {
32162   __Pyx_RefNannyDeclarations
32163   PyObject *__pyx_t_1 = NULL;
32164   int __pyx_lineno = 0;
32165   const char *__pyx_filename = NULL;
32166   int __pyx_clineno = 0;
32167   __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
32168   /*--- Type import code ---*/
32169   __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9, __pyx_L1_error)
32170   __Pyx_GOTREF(__pyx_t_1);
32171   __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
32172   #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
32173   sizeof(PyTypeObject),
32174   #else
32175   sizeof(PyHeapTypeObject),
32176   #endif
32177   __Pyx_ImportType_CheckSize_Warn);
32178    if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(3, 9, __pyx_L1_error)
32179   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32180   __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 200, __pyx_L1_error)
32181   __Pyx_GOTREF(__pyx_t_1);
32182   __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
32183    if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 200, __pyx_L1_error)
32184   __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Ignore);
32185    if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 223, __pyx_L1_error)
32186   __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Ignore);
32187    if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 227, __pyx_L1_error)
32188   __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
32189    if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 239, __pyx_L1_error)
32190   __pyx_ptype_5numpy_generic = __Pyx_ImportType(__pyx_t_1, "numpy", "generic", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32191    if (!__pyx_ptype_5numpy_generic) __PYX_ERR(2, 771, __pyx_L1_error)
32192   __pyx_ptype_5numpy_number = __Pyx_ImportType(__pyx_t_1, "numpy", "number", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32193    if (!__pyx_ptype_5numpy_number) __PYX_ERR(2, 773, __pyx_L1_error)
32194   __pyx_ptype_5numpy_integer = __Pyx_ImportType(__pyx_t_1, "numpy", "integer", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32195    if (!__pyx_ptype_5numpy_integer) __PYX_ERR(2, 775, __pyx_L1_error)
32196   __pyx_ptype_5numpy_signedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "signedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32197    if (!__pyx_ptype_5numpy_signedinteger) __PYX_ERR(2, 777, __pyx_L1_error)
32198   __pyx_ptype_5numpy_unsignedinteger = __Pyx_ImportType(__pyx_t_1, "numpy", "unsignedinteger", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32199    if (!__pyx_ptype_5numpy_unsignedinteger) __PYX_ERR(2, 779, __pyx_L1_error)
32200   __pyx_ptype_5numpy_inexact = __Pyx_ImportType(__pyx_t_1, "numpy", "inexact", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32201    if (!__pyx_ptype_5numpy_inexact) __PYX_ERR(2, 781, __pyx_L1_error)
32202   __pyx_ptype_5numpy_floating = __Pyx_ImportType(__pyx_t_1, "numpy", "floating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32203    if (!__pyx_ptype_5numpy_floating) __PYX_ERR(2, 783, __pyx_L1_error)
32204   __pyx_ptype_5numpy_complexfloating = __Pyx_ImportType(__pyx_t_1, "numpy", "complexfloating", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32205    if (!__pyx_ptype_5numpy_complexfloating) __PYX_ERR(2, 785, __pyx_L1_error)
32206   __pyx_ptype_5numpy_flexible = __Pyx_ImportType(__pyx_t_1, "numpy", "flexible", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32207    if (!__pyx_ptype_5numpy_flexible) __PYX_ERR(2, 787, __pyx_L1_error)
32208   __pyx_ptype_5numpy_character = __Pyx_ImportType(__pyx_t_1, "numpy", "character", sizeof(PyObject), __Pyx_ImportType_CheckSize_Warn);
32209    if (!__pyx_ptype_5numpy_character) __PYX_ERR(2, 789, __pyx_L1_error)
32210   __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Ignore);
32211    if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 827, __pyx_L1_error)
32212   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32213   __Pyx_RefNannyFinishContext();
32214   return 0;
32215   __pyx_L1_error:;
32216   __Pyx_XDECREF(__pyx_t_1);
32217   __Pyx_RefNannyFinishContext();
32218   return -1;
32219 }
32220 
__Pyx_modinit_variable_import_code(void)32221 static int __Pyx_modinit_variable_import_code(void) {
32222   __Pyx_RefNannyDeclarations
32223   __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
32224   /*--- Variable import code ---*/
32225   __Pyx_RefNannyFinishContext();
32226   return 0;
32227 }
32228 
__Pyx_modinit_function_import_code(void)32229 static int __Pyx_modinit_function_import_code(void) {
32230   __Pyx_RefNannyDeclarations
32231   __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
32232   /*--- Function import code ---*/
32233   __Pyx_RefNannyFinishContext();
32234   return 0;
32235 }
32236 
32237 
32238 #ifndef CYTHON_NO_PYINIT_EXPORT
32239 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
32240 #elif PY_MAJOR_VERSION < 3
32241 #ifdef __cplusplus
32242 #define __Pyx_PyMODINIT_FUNC extern "C" void
32243 #else
32244 #define __Pyx_PyMODINIT_FUNC void
32245 #endif
32246 #else
32247 #ifdef __cplusplus
32248 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
32249 #else
32250 #define __Pyx_PyMODINIT_FUNC PyObject *
32251 #endif
32252 #endif
32253 
32254 
32255 #if PY_MAJOR_VERSION < 3
32256 __Pyx_PyMODINIT_FUNC initstate_space_cython(void) CYTHON_SMALL_CODE; /*proto*/
initstate_space_cython(void)32257 __Pyx_PyMODINIT_FUNC initstate_space_cython(void)
32258 #else
32259 __Pyx_PyMODINIT_FUNC PyInit_state_space_cython(void) CYTHON_SMALL_CODE; /*proto*/
32260 __Pyx_PyMODINIT_FUNC PyInit_state_space_cython(void)
32261 #if CYTHON_PEP489_MULTI_PHASE_INIT
32262 {
32263   return PyModuleDef_Init(&__pyx_moduledef);
32264 }
32265 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
32266     #if PY_VERSION_HEX >= 0x030700A1
32267     static PY_INT64_T main_interpreter_id = -1;
32268     PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
32269     if (main_interpreter_id == -1) {
32270         main_interpreter_id = current_id;
32271         return (unlikely(current_id == -1)) ? -1 : 0;
32272     } else if (unlikely(main_interpreter_id != current_id))
32273     #else
32274     static PyInterpreterState *main_interpreter = NULL;
32275     PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
32276     if (!main_interpreter) {
32277         main_interpreter = current_interpreter;
32278     } else if (unlikely(main_interpreter != current_interpreter))
32279     #endif
32280     {
32281         PyErr_SetString(
32282             PyExc_ImportError,
32283             "Interpreter change detected - this module can only be loaded into one interpreter per process.");
32284         return -1;
32285     }
32286     return 0;
32287 }
32288 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
32289     PyObject *value = PyObject_GetAttrString(spec, from_name);
32290     int result = 0;
32291     if (likely(value)) {
32292         if (allow_none || value != Py_None) {
32293             result = PyDict_SetItemString(moddict, to_name, value);
32294         }
32295         Py_DECREF(value);
32296     } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
32297         PyErr_Clear();
32298     } else {
32299         result = -1;
32300     }
32301     return result;
32302 }
32303 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
32304     PyObject *module = NULL, *moddict, *modname;
32305     if (__Pyx_check_single_interpreter())
32306         return NULL;
32307     if (__pyx_m)
32308         return __Pyx_NewRef(__pyx_m);
32309     modname = PyObject_GetAttrString(spec, "name");
32310     if (unlikely(!modname)) goto bad;
32311     module = PyModule_NewObject(modname);
32312     Py_DECREF(modname);
32313     if (unlikely(!module)) goto bad;
32314     moddict = PyModule_GetDict(module);
32315     if (unlikely(!moddict)) goto bad;
32316     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
32317     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
32318     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
32319     if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
32320     return module;
32321 bad:
32322     Py_XDECREF(module);
32323     return NULL;
32324 }
32325 
32326 
32327 static CYTHON_SMALL_CODE int __pyx_pymod_exec_state_space_cython(PyObject *__pyx_pyinit_module)
32328 #endif
32329 #endif
32330 {
32331   PyObject *__pyx_t_1 = NULL;
32332   PyObject *__pyx_t_2 = NULL;
32333   int __pyx_lineno = 0;
32334   const char *__pyx_filename = NULL;
32335   int __pyx_clineno = 0;
32336   __Pyx_RefNannyDeclarations
32337   #if CYTHON_PEP489_MULTI_PHASE_INIT
32338   if (__pyx_m) {
32339     if (__pyx_m == __pyx_pyinit_module) return 0;
32340     PyErr_SetString(PyExc_RuntimeError, "Module 'state_space_cython' has already been imported. Re-initialisation is not supported.");
32341     return -1;
32342   }
32343   #elif PY_MAJOR_VERSION >= 3
32344   if (__pyx_m) return __Pyx_NewRef(__pyx_m);
32345   #endif
32346   #if CYTHON_REFNANNY
32347 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
32348 if (!__Pyx_RefNanny) {
32349   PyErr_Clear();
32350   __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
32351   if (!__Pyx_RefNanny)
32352       Py_FatalError("failed to import 'refnanny' module");
32353 }
32354 #endif
32355   __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_state_space_cython(void)", 0);
32356   if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32357   #ifdef __Pxy_PyFrame_Initialize_Offsets
32358   __Pxy_PyFrame_Initialize_Offsets();
32359   #endif
32360   __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
32361   __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
32362   __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
32363   #ifdef __Pyx_CyFunction_USED
32364   if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32365   #endif
32366   #ifdef __Pyx_FusedFunction_USED
32367   if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32368   #endif
32369   #ifdef __Pyx_Coroutine_USED
32370   if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32371   #endif
32372   #ifdef __Pyx_Generator_USED
32373   if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32374   #endif
32375   #ifdef __Pyx_AsyncGen_USED
32376   if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32377   #endif
32378   #ifdef __Pyx_StopAsyncIteration_USED
32379   if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32380   #endif
32381   /*--- Library function declarations ---*/
32382   /*--- Threads initialization code ---*/
32383   #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
32384   #ifdef WITH_THREAD /* Python build with threading support? */
32385   PyEval_InitThreads();
32386   #endif
32387   #endif
32388   /*--- Module creation code ---*/
32389   #if CYTHON_PEP489_MULTI_PHASE_INIT
32390   __pyx_m = __pyx_pyinit_module;
32391   Py_INCREF(__pyx_m);
32392   #else
32393   #if PY_MAJOR_VERSION < 3
32394   __pyx_m = Py_InitModule4("state_space_cython", __pyx_methods, __pyx_k_Contains_some_cython_code_for_s, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
32395   #else
32396   __pyx_m = PyModule_Create(&__pyx_moduledef);
32397   #endif
32398   if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
32399   #endif
32400   __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
32401   Py_INCREF(__pyx_d);
32402   __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
32403   Py_INCREF(__pyx_b);
32404   __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
32405   Py_INCREF(__pyx_cython_runtime);
32406   if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
32407   /*--- Initialize various global constants etc. ---*/
32408   if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32409   #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
32410   if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32411   #endif
32412   if (__pyx_module_is_main_GPy__models__state_space_cython) {
32413     if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32414   }
32415   #if PY_MAJOR_VERSION >= 3
32416   {
32417     PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
32418     if (!PyDict_GetItemString(modules, "GPy.models.state_space_cython")) {
32419       if (unlikely(PyDict_SetItemString(modules, "GPy.models.state_space_cython", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
32420     }
32421   }
32422   #endif
32423   /*--- Builtin init code ---*/
32424   if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32425   /*--- Constants init code ---*/
32426   if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32427   /*--- Global type/function init code ---*/
32428   (void)__Pyx_modinit_global_init_code();
32429   (void)__Pyx_modinit_variable_export_code();
32430   (void)__Pyx_modinit_function_export_code();
32431   if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
32432   if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
32433   (void)__Pyx_modinit_variable_import_code();
32434   (void)__Pyx_modinit_function_import_code();
32435   /*--- Execution code ---*/
32436   #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
32437   if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32438   #endif
32439 
32440   /* "GPy/models/state_space_cython.pyx":5
32441  * Contains some cython code for state space modelling.
32442  * """
32443  * import numpy as np             # <<<<<<<<<<<<<<
32444  * cimport numpy as np
32445  * import scipy as sp
32446  */
32447   __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
32448   __Pyx_GOTREF(__pyx_t_1);
32449   if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 5, __pyx_L1_error)
32450   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32451 
32452   /* "GPy/models/state_space_cython.pyx":7
32453  * import numpy as np
32454  * cimport numpy as np
32455  * import scipy as sp             # <<<<<<<<<<<<<<
32456  * cimport cython
32457  *
32458  */
32459   __pyx_t_1 = __Pyx_Import(__pyx_n_s_scipy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
32460   __Pyx_GOTREF(__pyx_t_1);
32461   if (PyDict_SetItem(__pyx_d, __pyx_n_s_sp, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
32462   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32463 
32464   /* "GPy/models/state_space_cython.pyx":14
32465  *     bint npy_isnan(double x)
32466  *
32467  * DTYPE = np.float64             # <<<<<<<<<<<<<<
32468  * DTYPE_int = np.int64
32469  *
32470  */
32471   __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
32472   __Pyx_GOTREF(__pyx_t_1);
32473   __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
32474   __Pyx_GOTREF(__pyx_t_2);
32475   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32476   if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
32477   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32478 
32479   /* "GPy/models/state_space_cython.pyx":15
32480  *
32481  * DTYPE = np.float64
32482  * DTYPE_int = np.int64             # <<<<<<<<<<<<<<
32483  *
32484  * ctypedef np.float64_t DTYPE_t
32485  */
32486   __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
32487   __Pyx_GOTREF(__pyx_t_2);
32488   __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
32489   __Pyx_GOTREF(__pyx_t_1);
32490   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
32491   if (PyDict_SetItem(__pyx_d, __pyx_n_s_DTYPE_int, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
32492   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32493 
32494   /* "GPy/models/state_space_cython.pyx":547
32495  *
32496  * @cython.boundscheck(False)
32497  * def _kalman_prediction_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m , tuple p_P,             # <<<<<<<<<<<<<<
32498  *                                 Dynamic_Callables_Cython p_dynamic_callables,
32499  *                                 bint calc_grad_log_likelihood=False,
32500  */
32501   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_1_kalman_prediction_step_SVD_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
32502   __Pyx_GOTREF(__pyx_t_1);
32503   if (PyDict_SetItem(__pyx_d, __pyx_n_s_kalman_prediction_step_SVD_Cyth, __pyx_t_1) < 0) __PYX_ERR(0, 547, __pyx_L1_error)
32504   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32505 
32506   /* "GPy/models/state_space_cython.pyx":686
32507  *
32508  * @cython.boundscheck(False)
32509  * def _kalman_update_step_SVD_Cython(long k, np.ndarray[DTYPE_t, ndim=2] p_m, tuple p_P,             # <<<<<<<<<<<<<<
32510  *                             Measurement_Callables_Cython p_measurement_callables,
32511  *                             np.ndarray[DTYPE_t, ndim=2] measurement,
32512  */
32513   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_3_kalman_update_step_SVD_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 686, __pyx_L1_error)
32514   __Pyx_GOTREF(__pyx_t_1);
32515   if (PyDict_SetItem(__pyx_d, __pyx_n_s_kalman_update_step_SVD_Cython, __pyx_t_1) < 0) __PYX_ERR(0, 686, __pyx_L1_error)
32516   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32517 
32518   /* "GPy/models/state_space_cython.pyx":912
32519  *
32520  * @cython.boundscheck(False)
32521  * def _cont_discr_kalman_filter_raw_Cython(int state_dim, Dynamic_Callables_Cython p_dynamic_callables,             # <<<<<<<<<<<<<<
32522  *                                   Measurement_Callables_Cython p_measurement_callables, X, Y,
32523  *                                   np.ndarray[DTYPE_t, ndim=2] m_init=None, np.ndarray[DTYPE_t, ndim=2] P_init=None,
32524  */
32525   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_5_cont_discr_kalman_filter_raw_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error)
32526   __Pyx_GOTREF(__pyx_t_1);
32527   if (PyDict_SetItem(__pyx_d, __pyx_n_s_cont_discr_kalman_filter_raw_Cy, __pyx_t_1) < 0) __PYX_ERR(0, 912, __pyx_L1_error)
32528   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32529 
32530   /* "(tree fragment)":1
32531  * def __pyx_unpickle_Dynamic_Callables_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32532  *     cdef object __pyx_PickleError
32533  *     cdef object __pyx_result
32534  */
32535   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_7__pyx_unpickle_Dynamic_Callables_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32536   __Pyx_GOTREF(__pyx_t_1);
32537   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Dynamic_Callables, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32538   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32539 
32540   /* "(tree fragment)":11
32541  *         __pyx_unpickle_Dynamic_Callables_Cython__set_state(<Dynamic_Callables_Cython> __pyx_result, __pyx_state)
32542  *     return __pyx_result
32543  * cdef __pyx_unpickle_Dynamic_Callables_Cython__set_state(Dynamic_Callables_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
32544  *     if len(__pyx_state) > 0 and hasattr(__pyx_result, '__dict__'):
32545  *         __pyx_result.__dict__.update(__pyx_state[0])
32546  */
32547   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_9__pyx_unpickle_Measurement_Callables_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32548   __Pyx_GOTREF(__pyx_t_1);
32549   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Measurement_Calla, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32550   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32551 
32552   /* "(tree fragment)":1
32553  * def __pyx_unpickle_R_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32554  *     cdef object __pyx_PickleError
32555  *     cdef object __pyx_result
32556  */
32557   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_11__pyx_unpickle_R_handling_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32558   __Pyx_GOTREF(__pyx_t_1);
32559   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_R_handling_Cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32560   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32561 
32562   /* "(tree fragment)":11
32563  *         __pyx_unpickle_R_handling_Cython__set_state(<R_handling_Cython> __pyx_result, __pyx_state)
32564  *     return __pyx_result
32565  * cdef __pyx_unpickle_R_handling_Cython__set_state(R_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
32566  *     __pyx_result.R = __pyx_state[0]; __pyx_result.R_square_root = __pyx_state[1]; __pyx_result.R_time_var_index = __pyx_state[2]; __pyx_result.dR = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
32567  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
32568  */
32569   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_13__pyx_unpickle_Std_Measurement_Callables_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32570   __Pyx_GOTREF(__pyx_t_1);
32571   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Std_Measurement_C, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32572   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32573 
32574   /* "(tree fragment)":1
32575  * def __pyx_unpickle_Q_handling_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32576  *     cdef object __pyx_PickleError
32577  *     cdef object __pyx_result
32578  */
32579   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_15__pyx_unpickle_Q_handling_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32580   __Pyx_GOTREF(__pyx_t_1);
32581   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Q_handling_Cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32582   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32583 
32584   /* "(tree fragment)":11
32585  *         __pyx_unpickle_Q_handling_Cython__set_state(<Q_handling_Cython> __pyx_result, __pyx_state)
32586  *     return __pyx_result
32587  * cdef __pyx_unpickle_Q_handling_Cython__set_state(Q_handling_Cython __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
32588  *     __pyx_result.Q = __pyx_state[0]; __pyx_result.Q_square_root = __pyx_state[1]; __pyx_result.Q_time_var_index = __pyx_state[2]; __pyx_result.dQ = __pyx_state[3]; __pyx_result.index = __pyx_state[4]; __pyx_result.svd_each_time = __pyx_state[5]
32589  *     if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
32590  */
32591   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_17__pyx_unpickle_Std_Dynamic_Callables_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32592   __Pyx_GOTREF(__pyx_t_1);
32593   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Std_Dynamic_Calla, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32594   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32595 
32596   /* "(tree fragment)":1
32597  * def __pyx_unpickle_AQcompute_batch_Cython(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
32598  *     cdef object __pyx_PickleError
32599  *     cdef object __pyx_result
32600  */
32601   __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3GPy_6models_18state_space_cython_19__pyx_unpickle_AQcompute_batch_Cython, NULL, __pyx_n_s_GPy_models_state_space_cython); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
32602   __Pyx_GOTREF(__pyx_t_1);
32603   if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_AQcompute_batch_C, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
32604   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32605 
32606   /* "GPy/models/state_space_cython.pyx":1
32607  * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
32608  * """
32609  * Contains some cython code for state space modelling.
32610  */
32611   __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
32612   __Pyx_GOTREF(__pyx_t_1);
32613   if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
32614   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
32615 
32616   /* "../../.pyenv/versions/gpy391/lib/python3.9/site-packages/numpy/__init__.pxd":1016
32617  *
32618  *
32619  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil:             # <<<<<<<<<<<<<<
32620  *     """
32621  *     returns the unit part of the dtype for a numpy datetime64 object.
32622  */
32623 
32624   /*--- Wrapped vars code ---*/
32625 
32626   goto __pyx_L0;
32627   __pyx_L1_error:;
32628   __Pyx_XDECREF(__pyx_t_1);
32629   __Pyx_XDECREF(__pyx_t_2);
32630   if (__pyx_m) {
32631     if (__pyx_d) {
32632       __Pyx_AddTraceback("init GPy.models.state_space_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
32633     }
32634     Py_CLEAR(__pyx_m);
32635   } else if (!PyErr_Occurred()) {
32636     PyErr_SetString(PyExc_ImportError, "init GPy.models.state_space_cython");
32637   }
32638   __pyx_L0:;
32639   __Pyx_RefNannyFinishContext();
32640   #if CYTHON_PEP489_MULTI_PHASE_INIT
32641   return (__pyx_m != NULL) ? 0 : -1;
32642   #elif PY_MAJOR_VERSION >= 3
32643   return __pyx_m;
32644   #else
32645   return;
32646   #endif
32647 }
32648 
32649 /* --- Runtime support code --- */
32650 /* Refnanny */
32651 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)32652 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
32653     PyObject *m = NULL, *p = NULL;
32654     void *r = NULL;
32655     m = PyImport_ImportModule(modname);
32656     if (!m) goto end;
32657     p = PyObject_GetAttrString(m, "RefNannyAPI");
32658     if (!p) goto end;
32659     r = PyLong_AsVoidPtr(p);
32660 end:
32661     Py_XDECREF(p);
32662     Py_XDECREF(m);
32663     return (__Pyx_RefNannyAPIStruct *)r;
32664 }
32665 #endif
32666 
32667 /* PyObjectGetAttrStr */
32668 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)32669 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
32670     PyTypeObject* tp = Py_TYPE(obj);
32671     if (likely(tp->tp_getattro))
32672         return tp->tp_getattro(obj, attr_name);
32673 #if PY_MAJOR_VERSION < 3
32674     if (likely(tp->tp_getattr))
32675         return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
32676 #endif
32677     return PyObject_GetAttr(obj, attr_name);
32678 }
32679 #endif
32680 
32681 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)32682 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
32683     PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
32684     if (unlikely(!result)) {
32685         PyErr_Format(PyExc_NameError,
32686 #if PY_MAJOR_VERSION >= 3
32687             "name '%U' is not defined", name);
32688 #else
32689             "name '%.200s' is not defined", PyString_AS_STRING(name));
32690 #endif
32691     }
32692     return result;
32693 }
32694 
32695 /* IsLittleEndian */
__Pyx_Is_Little_Endian(void)32696 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
32697 {
32698   union {
32699     uint32_t u32;
32700     uint8_t u8[4];
32701   } S;
32702   S.u32 = 0x01020304;
32703   return S.u8[0] == 4;
32704 }
32705 
32706 /* BufferFormatCheck */
__Pyx_BufFmt_Init(__Pyx_BufFmt_Context * ctx,__Pyx_BufFmt_StackElem * stack,__Pyx_TypeInfo * type)32707 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
32708                               __Pyx_BufFmt_StackElem* stack,
32709                               __Pyx_TypeInfo* type) {
32710   stack[0].field = &ctx->root;
32711   stack[0].parent_offset = 0;
32712   ctx->root.type = type;
32713   ctx->root.name = "buffer dtype";
32714   ctx->root.offset = 0;
32715   ctx->head = stack;
32716   ctx->head->field = &ctx->root;
32717   ctx->fmt_offset = 0;
32718   ctx->head->parent_offset = 0;
32719   ctx->new_packmode = '@';
32720   ctx->enc_packmode = '@';
32721   ctx->new_count = 1;
32722   ctx->enc_count = 0;
32723   ctx->enc_type = 0;
32724   ctx->is_complex = 0;
32725   ctx->is_valid_array = 0;
32726   ctx->struct_alignment = 0;
32727   while (type->typegroup == 'S') {
32728     ++ctx->head;
32729     ctx->head->field = type->fields;
32730     ctx->head->parent_offset = 0;
32731     type = type->fields->type;
32732   }
32733 }
__Pyx_BufFmt_ParseNumber(const char ** ts)32734 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
32735     int count;
32736     const char* t = *ts;
32737     if (*t < '0' || *t > '9') {
32738       return -1;
32739     } else {
32740         count = *t++ - '0';
32741         while (*t >= '0' && *t <= '9') {
32742             count *= 10;
32743             count += *t++ - '0';
32744         }
32745     }
32746     *ts = t;
32747     return count;
32748 }
__Pyx_BufFmt_ExpectNumber(const char ** ts)32749 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
32750     int number = __Pyx_BufFmt_ParseNumber(ts);
32751     if (number == -1)
32752         PyErr_Format(PyExc_ValueError,\
32753                      "Does not understand character buffer dtype format string ('%c')", **ts);
32754     return number;
32755 }
__Pyx_BufFmt_RaiseUnexpectedChar(char ch)32756 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
32757   PyErr_Format(PyExc_ValueError,
32758                "Unexpected format string character: '%c'", ch);
32759 }
__Pyx_BufFmt_DescribeTypeChar(char ch,int is_complex)32760 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
32761   switch (ch) {
32762     case '?': return "'bool'";
32763     case 'c': return "'char'";
32764     case 'b': return "'signed char'";
32765     case 'B': return "'unsigned char'";
32766     case 'h': return "'short'";
32767     case 'H': return "'unsigned short'";
32768     case 'i': return "'int'";
32769     case 'I': return "'unsigned int'";
32770     case 'l': return "'long'";
32771     case 'L': return "'unsigned long'";
32772     case 'q': return "'long long'";
32773     case 'Q': return "'unsigned long long'";
32774     case 'f': return (is_complex ? "'complex float'" : "'float'");
32775     case 'd': return (is_complex ? "'complex double'" : "'double'");
32776     case 'g': return (is_complex ? "'complex long double'" : "'long double'");
32777     case 'T': return "a struct";
32778     case 'O': return "Python object";
32779     case 'P': return "a pointer";
32780     case 's': case 'p': return "a string";
32781     case 0: return "end";
32782     default: return "unparseable format string";
32783   }
32784 }
__Pyx_BufFmt_TypeCharToStandardSize(char ch,int is_complex)32785 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
32786   switch (ch) {
32787     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32788     case 'h': case 'H': return 2;
32789     case 'i': case 'I': case 'l': case 'L': return 4;
32790     case 'q': case 'Q': return 8;
32791     case 'f': return (is_complex ? 8 : 4);
32792     case 'd': return (is_complex ? 16 : 8);
32793     case 'g': {
32794       PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
32795       return 0;
32796     }
32797     case 'O': case 'P': return sizeof(void*);
32798     default:
32799       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32800       return 0;
32801     }
32802 }
__Pyx_BufFmt_TypeCharToNativeSize(char ch,int is_complex)32803 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
32804   switch (ch) {
32805     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32806     case 'h': case 'H': return sizeof(short);
32807     case 'i': case 'I': return sizeof(int);
32808     case 'l': case 'L': return sizeof(long);
32809     #ifdef HAVE_LONG_LONG
32810     case 'q': case 'Q': return sizeof(PY_LONG_LONG);
32811     #endif
32812     case 'f': return sizeof(float) * (is_complex ? 2 : 1);
32813     case 'd': return sizeof(double) * (is_complex ? 2 : 1);
32814     case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
32815     case 'O': case 'P': return sizeof(void*);
32816     default: {
32817       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32818       return 0;
32819     }
32820   }
32821 }
32822 typedef struct { char c; short x; } __Pyx_st_short;
32823 typedef struct { char c; int x; } __Pyx_st_int;
32824 typedef struct { char c; long x; } __Pyx_st_long;
32825 typedef struct { char c; float x; } __Pyx_st_float;
32826 typedef struct { char c; double x; } __Pyx_st_double;
32827 typedef struct { char c; long double x; } __Pyx_st_longdouble;
32828 typedef struct { char c; void *x; } __Pyx_st_void_p;
32829 #ifdef HAVE_LONG_LONG
32830 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
32831 #endif
__Pyx_BufFmt_TypeCharToAlignment(char ch,CYTHON_UNUSED int is_complex)32832 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
32833   switch (ch) {
32834     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32835     case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
32836     case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
32837     case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
32838 #ifdef HAVE_LONG_LONG
32839     case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
32840 #endif
32841     case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
32842     case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
32843     case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
32844     case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
32845     default:
32846       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32847       return 0;
32848     }
32849 }
32850 /* These are for computing the padding at the end of the struct to align
32851    on the first member of the struct. This will probably the same as above,
32852    but we don't have any guarantees.
32853  */
32854 typedef struct { short x; char c; } __Pyx_pad_short;
32855 typedef struct { int x; char c; } __Pyx_pad_int;
32856 typedef struct { long x; char c; } __Pyx_pad_long;
32857 typedef struct { float x; char c; } __Pyx_pad_float;
32858 typedef struct { double x; char c; } __Pyx_pad_double;
32859 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
32860 typedef struct { void *x; char c; } __Pyx_pad_void_p;
32861 #ifdef HAVE_LONG_LONG
32862 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
32863 #endif
__Pyx_BufFmt_TypeCharToPadding(char ch,CYTHON_UNUSED int is_complex)32864 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
32865   switch (ch) {
32866     case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
32867     case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
32868     case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
32869     case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
32870 #ifdef HAVE_LONG_LONG
32871     case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
32872 #endif
32873     case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
32874     case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
32875     case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
32876     case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
32877     default:
32878       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32879       return 0;
32880     }
32881 }
__Pyx_BufFmt_TypeCharToGroup(char ch,int is_complex)32882 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
32883   switch (ch) {
32884     case 'c':
32885         return 'H';
32886     case 'b': case 'h': case 'i':
32887     case 'l': case 'q': case 's': case 'p':
32888         return 'I';
32889     case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
32890         return 'U';
32891     case 'f': case 'd': case 'g':
32892         return (is_complex ? 'C' : 'R');
32893     case 'O':
32894         return 'O';
32895     case 'P':
32896         return 'P';
32897     default: {
32898       __Pyx_BufFmt_RaiseUnexpectedChar(ch);
32899       return 0;
32900     }
32901   }
32902 }
__Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context * ctx)32903 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
32904   if (ctx->head == NULL || ctx->head->field == &ctx->root) {
32905     const char* expected;
32906     const char* quote;
32907     if (ctx->head == NULL) {
32908       expected = "end";
32909       quote = "";
32910     } else {
32911       expected = ctx->head->field->type->name;
32912       quote = "'";
32913     }
32914     PyErr_Format(PyExc_ValueError,
32915                  "Buffer dtype mismatch, expected %s%s%s but got %s",
32916                  quote, expected, quote,
32917                  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
32918   } else {
32919     __Pyx_StructField* field = ctx->head->field;
32920     __Pyx_StructField* parent = (ctx->head - 1)->field;
32921     PyErr_Format(PyExc_ValueError,
32922                  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
32923                  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
32924                  parent->type->name, field->name);
32925   }
32926 }
__Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context * ctx)32927 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
32928   char group;
32929   size_t size, offset, arraysize = 1;
32930   if (ctx->enc_type == 0) return 0;
32931   if (ctx->head->field->type->arraysize[0]) {
32932     int i, ndim = 0;
32933     if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
32934         ctx->is_valid_array = ctx->head->field->type->ndim == 1;
32935         ndim = 1;
32936         if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
32937             PyErr_Format(PyExc_ValueError,
32938                          "Expected a dimension of size %zu, got %zu",
32939                          ctx->head->field->type->arraysize[0], ctx->enc_count);
32940             return -1;
32941         }
32942     }
32943     if (!ctx->is_valid_array) {
32944       PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
32945                    ctx->head->field->type->ndim, ndim);
32946       return -1;
32947     }
32948     for (i = 0; i < ctx->head->field->type->ndim; i++) {
32949       arraysize *= ctx->head->field->type->arraysize[i];
32950     }
32951     ctx->is_valid_array = 0;
32952     ctx->enc_count = 1;
32953   }
32954   group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
32955   do {
32956     __Pyx_StructField* field = ctx->head->field;
32957     __Pyx_TypeInfo* type = field->type;
32958     if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
32959       size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
32960     } else {
32961       size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
32962     }
32963     if (ctx->enc_packmode == '@') {
32964       size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
32965       size_t align_mod_offset;
32966       if (align_at == 0) return -1;
32967       align_mod_offset = ctx->fmt_offset % align_at;
32968       if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
32969       if (ctx->struct_alignment == 0)
32970           ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
32971                                                                  ctx->is_complex);
32972     }
32973     if (type->size != size || type->typegroup != group) {
32974       if (type->typegroup == 'C' && type->fields != NULL) {
32975         size_t parent_offset = ctx->head->parent_offset + field->offset;
32976         ++ctx->head;
32977         ctx->head->field = type->fields;
32978         ctx->head->parent_offset = parent_offset;
32979         continue;
32980       }
32981       if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
32982       } else {
32983           __Pyx_BufFmt_RaiseExpected(ctx);
32984           return -1;
32985       }
32986     }
32987     offset = ctx->head->parent_offset + field->offset;
32988     if (ctx->fmt_offset != offset) {
32989       PyErr_Format(PyExc_ValueError,
32990                    "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
32991                    (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
32992       return -1;
32993     }
32994     ctx->fmt_offset += size;
32995     if (arraysize)
32996       ctx->fmt_offset += (arraysize - 1) * size;
32997     --ctx->enc_count;
32998     while (1) {
32999       if (field == &ctx->root) {
33000         ctx->head = NULL;
33001         if (ctx->enc_count != 0) {
33002           __Pyx_BufFmt_RaiseExpected(ctx);
33003           return -1;
33004         }
33005         break;
33006       }
33007       ctx->head->field = ++field;
33008       if (field->type == NULL) {
33009         --ctx->head;
33010         field = ctx->head->field;
33011         continue;
33012       } else if (field->type->typegroup == 'S') {
33013         size_t parent_offset = ctx->head->parent_offset + field->offset;
33014         if (field->type->fields->type == NULL) continue;
33015         field = field->type->fields;
33016         ++ctx->head;
33017         ctx->head->field = field;
33018         ctx->head->parent_offset = parent_offset;
33019         break;
33020       } else {
33021         break;
33022       }
33023     }
33024   } while (ctx->enc_count);
33025   ctx->enc_type = 0;
33026   ctx->is_complex = 0;
33027   return 0;
33028 }
33029 static PyObject *
__pyx_buffmt_parse_array(__Pyx_BufFmt_Context * ctx,const char ** tsp)33030 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
33031 {
33032     const char *ts = *tsp;
33033     int i = 0, number, ndim;
33034     ++ts;
33035     if (ctx->new_count != 1) {
33036         PyErr_SetString(PyExc_ValueError,
33037                         "Cannot handle repeated arrays in format string");
33038         return NULL;
33039     }
33040     if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33041     ndim = ctx->head->field->type->ndim;
33042     while (*ts && *ts != ')') {
33043         switch (*ts) {
33044             case ' ': case '\f': case '\r': case '\n': case '\t': case '\v':  continue;
33045             default:  break;
33046         }
33047         number = __Pyx_BufFmt_ExpectNumber(&ts);
33048         if (number == -1) return NULL;
33049         if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
33050             return PyErr_Format(PyExc_ValueError,
33051                         "Expected a dimension of size %zu, got %d",
33052                         ctx->head->field->type->arraysize[i], number);
33053         if (*ts != ',' && *ts != ')')
33054             return PyErr_Format(PyExc_ValueError,
33055                                 "Expected a comma in format string, got '%c'", *ts);
33056         if (*ts == ',') ts++;
33057         i++;
33058     }
33059     if (i != ndim)
33060         return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
33061                             ctx->head->field->type->ndim, i);
33062     if (!*ts) {
33063         PyErr_SetString(PyExc_ValueError,
33064                         "Unexpected end of format string, expected ')'");
33065         return NULL;
33066     }
33067     ctx->is_valid_array = 1;
33068     ctx->new_count = 1;
33069     *tsp = ++ts;
33070     return Py_None;
33071 }
__Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context * ctx,const char * ts)33072 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
33073   int got_Z = 0;
33074   while (1) {
33075     switch(*ts) {
33076       case 0:
33077         if (ctx->enc_type != 0 && ctx->head == NULL) {
33078           __Pyx_BufFmt_RaiseExpected(ctx);
33079           return NULL;
33080         }
33081         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33082         if (ctx->head != NULL) {
33083           __Pyx_BufFmt_RaiseExpected(ctx);
33084           return NULL;
33085         }
33086         return ts;
33087       case ' ':
33088       case '\r':
33089       case '\n':
33090         ++ts;
33091         break;
33092       case '<':
33093         if (!__Pyx_Is_Little_Endian()) {
33094           PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
33095           return NULL;
33096         }
33097         ctx->new_packmode = '=';
33098         ++ts;
33099         break;
33100       case '>':
33101       case '!':
33102         if (__Pyx_Is_Little_Endian()) {
33103           PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
33104           return NULL;
33105         }
33106         ctx->new_packmode = '=';
33107         ++ts;
33108         break;
33109       case '=':
33110       case '@':
33111       case '^':
33112         ctx->new_packmode = *ts++;
33113         break;
33114       case 'T':
33115         {
33116           const char* ts_after_sub;
33117           size_t i, struct_count = ctx->new_count;
33118           size_t struct_alignment = ctx->struct_alignment;
33119           ctx->new_count = 1;
33120           ++ts;
33121           if (*ts != '{') {
33122             PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
33123             return NULL;
33124           }
33125           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33126           ctx->enc_type = 0;
33127           ctx->enc_count = 0;
33128           ctx->struct_alignment = 0;
33129           ++ts;
33130           ts_after_sub = ts;
33131           for (i = 0; i != struct_count; ++i) {
33132             ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
33133             if (!ts_after_sub) return NULL;
33134           }
33135           ts = ts_after_sub;
33136           if (struct_alignment) ctx->struct_alignment = struct_alignment;
33137         }
33138         break;
33139       case '}':
33140         {
33141           size_t alignment = ctx->struct_alignment;
33142           ++ts;
33143           if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33144           ctx->enc_type = 0;
33145           if (alignment && ctx->fmt_offset % alignment) {
33146             ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
33147           }
33148         }
33149         return ts;
33150       case 'x':
33151         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33152         ctx->fmt_offset += ctx->new_count;
33153         ctx->new_count = 1;
33154         ctx->enc_count = 0;
33155         ctx->enc_type = 0;
33156         ctx->enc_packmode = ctx->new_packmode;
33157         ++ts;
33158         break;
33159       case 'Z':
33160         got_Z = 1;
33161         ++ts;
33162         if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
33163           __Pyx_BufFmt_RaiseUnexpectedChar('Z');
33164           return NULL;
33165         }
33166         CYTHON_FALLTHROUGH;
33167       case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
33168       case 'l': case 'L': case 'q': case 'Q':
33169       case 'f': case 'd': case 'g':
33170       case 'O': case 'p':
33171         if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
33172             (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
33173           ctx->enc_count += ctx->new_count;
33174           ctx->new_count = 1;
33175           got_Z = 0;
33176           ++ts;
33177           break;
33178         }
33179         CYTHON_FALLTHROUGH;
33180       case 's':
33181         if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
33182         ctx->enc_count = ctx->new_count;
33183         ctx->enc_packmode = ctx->new_packmode;
33184         ctx->enc_type = *ts;
33185         ctx->is_complex = got_Z;
33186         ++ts;
33187         ctx->new_count = 1;
33188         got_Z = 0;
33189         break;
33190       case ':':
33191         ++ts;
33192         while(*ts != ':') ++ts;
33193         ++ts;
33194         break;
33195       case '(':
33196         if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
33197         break;
33198       default:
33199         {
33200           int number = __Pyx_BufFmt_ExpectNumber(&ts);
33201           if (number == -1) return NULL;
33202           ctx->new_count = (size_t)number;
33203         }
33204     }
33205   }
33206 }
33207 
33208 /* BufferGetAndValidate */
__Pyx_SafeReleaseBuffer(Py_buffer * info)33209   static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
33210   if (unlikely(info->buf == NULL)) return;
33211   if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
33212   __Pyx_ReleaseBuffer(info);
33213 }
__Pyx_ZeroBuffer(Py_buffer * buf)33214 static void __Pyx_ZeroBuffer(Py_buffer* buf) {
33215   buf->buf = NULL;
33216   buf->obj = NULL;
33217   buf->strides = __Pyx_zeros;
33218   buf->shape = __Pyx_zeros;
33219   buf->suboffsets = __Pyx_minusones;
33220 }
__Pyx__GetBufferAndValidate(Py_buffer * buf,PyObject * obj,__Pyx_TypeInfo * dtype,int flags,int nd,int cast,__Pyx_BufFmt_StackElem * stack)33221 static int __Pyx__GetBufferAndValidate(
33222         Py_buffer* buf, PyObject* obj,  __Pyx_TypeInfo* dtype, int flags,
33223         int nd, int cast, __Pyx_BufFmt_StackElem* stack)
33224 {
33225   buf->buf = NULL;
33226   if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
33227     __Pyx_ZeroBuffer(buf);
33228     return -1;
33229   }
33230   if (unlikely(buf->ndim != nd)) {
33231     PyErr_Format(PyExc_ValueError,
33232                  "Buffer has wrong number of dimensions (expected %d, got %d)",
33233                  nd, buf->ndim);
33234     goto fail;
33235   }
33236   if (!cast) {
33237     __Pyx_BufFmt_Context ctx;
33238     __Pyx_BufFmt_Init(&ctx, stack, dtype);
33239     if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
33240   }
33241   if (unlikely((size_t)buf->itemsize != dtype->size)) {
33242     PyErr_Format(PyExc_ValueError,
33243       "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
33244       buf->itemsize, (buf->itemsize > 1) ? "s" : "",
33245       dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
33246     goto fail;
33247   }
33248   if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
33249   return 0;
33250 fail:;
33251   __Pyx_SafeReleaseBuffer(buf);
33252   return -1;
33253 }
33254 
33255 /* PyDictVersioning */
33256   #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)33257 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
33258     PyObject *dict = Py_TYPE(obj)->tp_dict;
33259     return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
33260 }
__Pyx_get_object_dict_version(PyObject * obj)33261 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
33262     PyObject **dictptr = NULL;
33263     Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
33264     if (offset) {
33265 #if CYTHON_COMPILING_IN_CPYTHON
33266         dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
33267 #else
33268         dictptr = _PyObject_GetDictPtr(obj);
33269 #endif
33270     }
33271     return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
33272 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)33273 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
33274     PyObject *dict = Py_TYPE(obj)->tp_dict;
33275     if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
33276         return 0;
33277     return obj_dict_version == __Pyx_get_object_dict_version(obj);
33278 }
33279 #endif
33280 
33281 /* PyFunctionFastCall */
33282   #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)33283 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
33284                                                PyObject *globals) {
33285     PyFrameObject *f;
33286     PyThreadState *tstate = __Pyx_PyThreadState_Current;
33287     PyObject **fastlocals;
33288     Py_ssize_t i;
33289     PyObject *result;
33290     assert(globals != NULL);
33291     /* XXX Perhaps we should create a specialized
33292        PyFrame_New() that doesn't take locals, but does
33293        take builtins without sanity checking them.
33294        */
33295     assert(tstate != NULL);
33296     f = PyFrame_New(tstate, co, globals, NULL);
33297     if (f == NULL) {
33298         return NULL;
33299     }
33300     fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
33301     for (i = 0; i < na; i++) {
33302         Py_INCREF(*args);
33303         fastlocals[i] = *args++;
33304     }
33305     result = PyEval_EvalFrameEx(f,0);
33306     ++tstate->recursion_depth;
33307     Py_DECREF(f);
33308     --tstate->recursion_depth;
33309     return result;
33310 }
33311 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)33312 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
33313     PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
33314     PyObject *globals = PyFunction_GET_GLOBALS(func);
33315     PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
33316     PyObject *closure;
33317 #if PY_MAJOR_VERSION >= 3
33318     PyObject *kwdefs;
33319 #endif
33320     PyObject *kwtuple, **k;
33321     PyObject **d;
33322     Py_ssize_t nd;
33323     Py_ssize_t nk;
33324     PyObject *result;
33325     assert(kwargs == NULL || PyDict_Check(kwargs));
33326     nk = kwargs ? PyDict_Size(kwargs) : 0;
33327     if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
33328         return NULL;
33329     }
33330     if (
33331 #if PY_MAJOR_VERSION >= 3
33332             co->co_kwonlyargcount == 0 &&
33333 #endif
33334             likely(kwargs == NULL || nk == 0) &&
33335             co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
33336         if (argdefs == NULL && co->co_argcount == nargs) {
33337             result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
33338             goto done;
33339         }
33340         else if (nargs == 0 && argdefs != NULL
33341                  && co->co_argcount == Py_SIZE(argdefs)) {
33342             /* function called with no arguments, but all parameters have
33343                a default value: use default values as arguments .*/
33344             args = &PyTuple_GET_ITEM(argdefs, 0);
33345             result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
33346             goto done;
33347         }
33348     }
33349     if (kwargs != NULL) {
33350         Py_ssize_t pos, i;
33351         kwtuple = PyTuple_New(2 * nk);
33352         if (kwtuple == NULL) {
33353             result = NULL;
33354             goto done;
33355         }
33356         k = &PyTuple_GET_ITEM(kwtuple, 0);
33357         pos = i = 0;
33358         while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
33359             Py_INCREF(k[i]);
33360             Py_INCREF(k[i+1]);
33361             i += 2;
33362         }
33363         nk = i / 2;
33364     }
33365     else {
33366         kwtuple = NULL;
33367         k = NULL;
33368     }
33369     closure = PyFunction_GET_CLOSURE(func);
33370 #if PY_MAJOR_VERSION >= 3
33371     kwdefs = PyFunction_GET_KW_DEFAULTS(func);
33372 #endif
33373     if (argdefs != NULL) {
33374         d = &PyTuple_GET_ITEM(argdefs, 0);
33375         nd = Py_SIZE(argdefs);
33376     }
33377     else {
33378         d = NULL;
33379         nd = 0;
33380     }
33381 #if PY_MAJOR_VERSION >= 3
33382     result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
33383                                args, (int)nargs,
33384                                k, (int)nk,
33385                                d, (int)nd, kwdefs, closure);
33386 #else
33387     result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
33388                                args, (int)nargs,
33389                                k, (int)nk,
33390                                d, (int)nd, closure);
33391 #endif
33392     Py_XDECREF(kwtuple);
33393 done:
33394     Py_LeaveRecursiveCall();
33395     return result;
33396 }
33397 #endif
33398 #endif
33399 
33400 /* PyCFunctionFastCall */
33401   #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)33402 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
33403     PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
33404     PyCFunction meth = PyCFunction_GET_FUNCTION(func);
33405     PyObject *self = PyCFunction_GET_SELF(func);
33406     int flags = PyCFunction_GET_FLAGS(func);
33407     assert(PyCFunction_Check(func));
33408     assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
33409     assert(nargs >= 0);
33410     assert(nargs == 0 || args != NULL);
33411     /* _PyCFunction_FastCallDict() must not be called with an exception set,
33412        because it may clear it (directly or indirectly) and so the
33413        caller loses its exception */
33414     assert(!PyErr_Occurred());
33415     if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
33416         return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
33417     } else {
33418         return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
33419     }
33420 }
33421 #endif
33422 
33423 /* PyObjectCall */
33424   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)33425 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
33426     PyObject *result;
33427     ternaryfunc call = func->ob_type->tp_call;
33428     if (unlikely(!call))
33429         return PyObject_Call(func, arg, kw);
33430     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33431         return NULL;
33432     result = (*call)(func, arg, kw);
33433     Py_LeaveRecursiveCall();
33434     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33435         PyErr_SetString(
33436             PyExc_SystemError,
33437             "NULL result without error in PyObject_Call");
33438     }
33439     return result;
33440 }
33441 #endif
33442 
33443 /* PyErrFetchRestore */
33444   #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)33445 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
33446     PyObject *tmp_type, *tmp_value, *tmp_tb;
33447     tmp_type = tstate->curexc_type;
33448     tmp_value = tstate->curexc_value;
33449     tmp_tb = tstate->curexc_traceback;
33450     tstate->curexc_type = type;
33451     tstate->curexc_value = value;
33452     tstate->curexc_traceback = tb;
33453     Py_XDECREF(tmp_type);
33454     Py_XDECREF(tmp_value);
33455     Py_XDECREF(tmp_tb);
33456 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)33457 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
33458     *type = tstate->curexc_type;
33459     *value = tstate->curexc_value;
33460     *tb = tstate->curexc_traceback;
33461     tstate->curexc_type = 0;
33462     tstate->curexc_value = 0;
33463     tstate->curexc_traceback = 0;
33464 }
33465 #endif
33466 
33467 /* RaiseException */
33468   #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)33469 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
33470                         CYTHON_UNUSED PyObject *cause) {
33471     __Pyx_PyThreadState_declare
33472     Py_XINCREF(type);
33473     if (!value || value == Py_None)
33474         value = NULL;
33475     else
33476         Py_INCREF(value);
33477     if (!tb || tb == Py_None)
33478         tb = NULL;
33479     else {
33480         Py_INCREF(tb);
33481         if (!PyTraceBack_Check(tb)) {
33482             PyErr_SetString(PyExc_TypeError,
33483                 "raise: arg 3 must be a traceback or None");
33484             goto raise_error;
33485         }
33486     }
33487     if (PyType_Check(type)) {
33488 #if CYTHON_COMPILING_IN_PYPY
33489         if (!value) {
33490             Py_INCREF(Py_None);
33491             value = Py_None;
33492         }
33493 #endif
33494         PyErr_NormalizeException(&type, &value, &tb);
33495     } else {
33496         if (value) {
33497             PyErr_SetString(PyExc_TypeError,
33498                 "instance exception may not have a separate value");
33499             goto raise_error;
33500         }
33501         value = type;
33502         type = (PyObject*) Py_TYPE(type);
33503         Py_INCREF(type);
33504         if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
33505             PyErr_SetString(PyExc_TypeError,
33506                 "raise: exception class must be a subclass of BaseException");
33507             goto raise_error;
33508         }
33509     }
33510     __Pyx_PyThreadState_assign
33511     __Pyx_ErrRestore(type, value, tb);
33512     return;
33513 raise_error:
33514     Py_XDECREF(value);
33515     Py_XDECREF(type);
33516     Py_XDECREF(tb);
33517     return;
33518 }
33519 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)33520 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
33521     PyObject* owned_instance = NULL;
33522     if (tb == Py_None) {
33523         tb = 0;
33524     } else if (tb && !PyTraceBack_Check(tb)) {
33525         PyErr_SetString(PyExc_TypeError,
33526             "raise: arg 3 must be a traceback or None");
33527         goto bad;
33528     }
33529     if (value == Py_None)
33530         value = 0;
33531     if (PyExceptionInstance_Check(type)) {
33532         if (value) {
33533             PyErr_SetString(PyExc_TypeError,
33534                 "instance exception may not have a separate value");
33535             goto bad;
33536         }
33537         value = type;
33538         type = (PyObject*) Py_TYPE(value);
33539     } else if (PyExceptionClass_Check(type)) {
33540         PyObject *instance_class = NULL;
33541         if (value && PyExceptionInstance_Check(value)) {
33542             instance_class = (PyObject*) Py_TYPE(value);
33543             if (instance_class != type) {
33544                 int is_subclass = PyObject_IsSubclass(instance_class, type);
33545                 if (!is_subclass) {
33546                     instance_class = NULL;
33547                 } else if (unlikely(is_subclass == -1)) {
33548                     goto bad;
33549                 } else {
33550                     type = instance_class;
33551                 }
33552             }
33553         }
33554         if (!instance_class) {
33555             PyObject *args;
33556             if (!value)
33557                 args = PyTuple_New(0);
33558             else if (PyTuple_Check(value)) {
33559                 Py_INCREF(value);
33560                 args = value;
33561             } else
33562                 args = PyTuple_Pack(1, value);
33563             if (!args)
33564                 goto bad;
33565             owned_instance = PyObject_Call(type, args, NULL);
33566             Py_DECREF(args);
33567             if (!owned_instance)
33568                 goto bad;
33569             value = owned_instance;
33570             if (!PyExceptionInstance_Check(value)) {
33571                 PyErr_Format(PyExc_TypeError,
33572                              "calling %R should have returned an instance of "
33573                              "BaseException, not %R",
33574                              type, Py_TYPE(value));
33575                 goto bad;
33576             }
33577         }
33578     } else {
33579         PyErr_SetString(PyExc_TypeError,
33580             "raise: exception class must be a subclass of BaseException");
33581         goto bad;
33582     }
33583     if (cause) {
33584         PyObject *fixed_cause;
33585         if (cause == Py_None) {
33586             fixed_cause = NULL;
33587         } else if (PyExceptionClass_Check(cause)) {
33588             fixed_cause = PyObject_CallObject(cause, NULL);
33589             if (fixed_cause == NULL)
33590                 goto bad;
33591         } else if (PyExceptionInstance_Check(cause)) {
33592             fixed_cause = cause;
33593             Py_INCREF(fixed_cause);
33594         } else {
33595             PyErr_SetString(PyExc_TypeError,
33596                             "exception causes must derive from "
33597                             "BaseException");
33598             goto bad;
33599         }
33600         PyException_SetCause(value, fixed_cause);
33601     }
33602     PyErr_SetObject(type, value);
33603     if (tb) {
33604 #if CYTHON_COMPILING_IN_PYPY
33605         PyObject *tmp_type, *tmp_value, *tmp_tb;
33606         PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
33607         Py_INCREF(tb);
33608         PyErr_Restore(tmp_type, tmp_value, tb);
33609         Py_XDECREF(tmp_tb);
33610 #else
33611         PyThreadState *tstate = __Pyx_PyThreadState_Current;
33612         PyObject* tmp_tb = tstate->curexc_traceback;
33613         if (tb != tmp_tb) {
33614             Py_INCREF(tb);
33615             tstate->curexc_traceback = tb;
33616             Py_XDECREF(tmp_tb);
33617         }
33618 #endif
33619     }
33620 bad:
33621     Py_XDECREF(owned_instance);
33622     return;
33623 }
33624 #endif
33625 
33626 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)33627   static void __Pyx_RaiseArgtupleInvalid(
33628     const char* func_name,
33629     int exact,
33630     Py_ssize_t num_min,
33631     Py_ssize_t num_max,
33632     Py_ssize_t num_found)
33633 {
33634     Py_ssize_t num_expected;
33635     const char *more_or_less;
33636     if (num_found < num_min) {
33637         num_expected = num_min;
33638         more_or_less = "at least";
33639     } else {
33640         num_expected = num_max;
33641         more_or_less = "at most";
33642     }
33643     if (exact) {
33644         more_or_less = "exactly";
33645     }
33646     PyErr_Format(PyExc_TypeError,
33647                  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
33648                  func_name, more_or_less, num_expected,
33649                  (num_expected == 1) ? "" : "s", num_found);
33650 }
33651 
33652 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)33653   static void __Pyx_RaiseDoubleKeywordsError(
33654     const char* func_name,
33655     PyObject* kw_name)
33656 {
33657     PyErr_Format(PyExc_TypeError,
33658         #if PY_MAJOR_VERSION >= 3
33659         "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
33660         #else
33661         "%s() got multiple values for keyword argument '%s'", func_name,
33662         PyString_AsString(kw_name));
33663         #endif
33664 }
33665 
33666 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)33667   static int __Pyx_ParseOptionalKeywords(
33668     PyObject *kwds,
33669     PyObject **argnames[],
33670     PyObject *kwds2,
33671     PyObject *values[],
33672     Py_ssize_t num_pos_args,
33673     const char* function_name)
33674 {
33675     PyObject *key = 0, *value = 0;
33676     Py_ssize_t pos = 0;
33677     PyObject*** name;
33678     PyObject*** first_kw_arg = argnames + num_pos_args;
33679     while (PyDict_Next(kwds, &pos, &key, &value)) {
33680         name = first_kw_arg;
33681         while (*name && (**name != key)) name++;
33682         if (*name) {
33683             values[name-argnames] = value;
33684             continue;
33685         }
33686         name = first_kw_arg;
33687         #if PY_MAJOR_VERSION < 3
33688         if (likely(PyString_Check(key))) {
33689             while (*name) {
33690                 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
33691                         && _PyString_Eq(**name, key)) {
33692                     values[name-argnames] = value;
33693                     break;
33694                 }
33695                 name++;
33696             }
33697             if (*name) continue;
33698             else {
33699                 PyObject*** argname = argnames;
33700                 while (argname != first_kw_arg) {
33701                     if ((**argname == key) || (
33702                             (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
33703                              && _PyString_Eq(**argname, key))) {
33704                         goto arg_passed_twice;
33705                     }
33706                     argname++;
33707                 }
33708             }
33709         } else
33710         #endif
33711         if (likely(PyUnicode_Check(key))) {
33712             while (*name) {
33713                 int cmp = (**name == key) ? 0 :
33714                 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33715                     (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
33716                 #endif
33717                     PyUnicode_Compare(**name, key);
33718                 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33719                 if (cmp == 0) {
33720                     values[name-argnames] = value;
33721                     break;
33722                 }
33723                 name++;
33724             }
33725             if (*name) continue;
33726             else {
33727                 PyObject*** argname = argnames;
33728                 while (argname != first_kw_arg) {
33729                     int cmp = (**argname == key) ? 0 :
33730                     #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
33731                         (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
33732                     #endif
33733                         PyUnicode_Compare(**argname, key);
33734                     if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
33735                     if (cmp == 0) goto arg_passed_twice;
33736                     argname++;
33737                 }
33738             }
33739         } else
33740             goto invalid_keyword_type;
33741         if (kwds2) {
33742             if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
33743         } else {
33744             goto invalid_keyword;
33745         }
33746     }
33747     return 0;
33748 arg_passed_twice:
33749     __Pyx_RaiseDoubleKeywordsError(function_name, key);
33750     goto bad;
33751 invalid_keyword_type:
33752     PyErr_Format(PyExc_TypeError,
33753         "%.200s() keywords must be strings", function_name);
33754     goto bad;
33755 invalid_keyword:
33756     PyErr_Format(PyExc_TypeError,
33757     #if PY_MAJOR_VERSION < 3
33758         "%.200s() got an unexpected keyword argument '%.200s'",
33759         function_name, PyString_AsString(key));
33760     #else
33761         "%s() got an unexpected keyword argument '%U'",
33762         function_name, key);
33763     #endif
33764 bad:
33765     return -1;
33766 }
33767 
33768 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)33769   static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
33770 {
33771     if (unlikely(!type)) {
33772         PyErr_SetString(PyExc_SystemError, "Missing type object");
33773         return 0;
33774     }
33775     else if (exact) {
33776         #if PY_MAJOR_VERSION == 2
33777         if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
33778         #endif
33779     }
33780     else {
33781         if (likely(__Pyx_TypeCheck(obj, type))) return 1;
33782     }
33783     PyErr_Format(PyExc_TypeError,
33784         "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
33785         name, type->tp_name, Py_TYPE(obj)->tp_name);
33786     return 0;
33787 }
33788 
33789 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)33790   static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
33791     PyObject *args, *result = NULL;
33792     #if CYTHON_FAST_PYCALL
33793     if (PyFunction_Check(function)) {
33794         PyObject *args[2] = {arg1, arg2};
33795         return __Pyx_PyFunction_FastCall(function, args, 2);
33796     }
33797     #endif
33798     #if CYTHON_FAST_PYCCALL
33799     if (__Pyx_PyFastCFunction_Check(function)) {
33800         PyObject *args[2] = {arg1, arg2};
33801         return __Pyx_PyCFunction_FastCall(function, args, 2);
33802     }
33803     #endif
33804     args = PyTuple_New(2);
33805     if (unlikely(!args)) goto done;
33806     Py_INCREF(arg1);
33807     PyTuple_SET_ITEM(args, 0, arg1);
33808     Py_INCREF(arg2);
33809     PyTuple_SET_ITEM(args, 1, arg2);
33810     Py_INCREF(function);
33811     result = __Pyx_PyObject_Call(function, args, NULL);
33812     Py_DECREF(args);
33813     Py_DECREF(function);
33814 done:
33815     return result;
33816 }
33817 
33818 /* PyObjectCallMethO */
33819   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)33820 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
33821     PyObject *self, *result;
33822     PyCFunction cfunc;
33823     cfunc = PyCFunction_GET_FUNCTION(func);
33824     self = PyCFunction_GET_SELF(func);
33825     if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
33826         return NULL;
33827     result = cfunc(self, arg);
33828     Py_LeaveRecursiveCall();
33829     if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
33830         PyErr_SetString(
33831             PyExc_SystemError,
33832             "NULL result without error in PyObject_Call");
33833     }
33834     return result;
33835 }
33836 #endif
33837 
33838 /* PyObjectCallOneArg */
33839   #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)33840 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33841     PyObject *result;
33842     PyObject *args = PyTuple_New(1);
33843     if (unlikely(!args)) return NULL;
33844     Py_INCREF(arg);
33845     PyTuple_SET_ITEM(args, 0, arg);
33846     result = __Pyx_PyObject_Call(func, args, NULL);
33847     Py_DECREF(args);
33848     return result;
33849 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)33850 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33851 #if CYTHON_FAST_PYCALL
33852     if (PyFunction_Check(func)) {
33853         return __Pyx_PyFunction_FastCall(func, &arg, 1);
33854     }
33855 #endif
33856     if (likely(PyCFunction_Check(func))) {
33857         if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
33858             return __Pyx_PyObject_CallMethO(func, arg);
33859 #if CYTHON_FAST_PYCCALL
33860         } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
33861             return __Pyx_PyCFunction_FastCall(func, &arg, 1);
33862 #endif
33863         }
33864     }
33865     return __Pyx__PyObject_CallOneArg(func, arg);
33866 }
33867 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)33868 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
33869     PyObject *result;
33870     PyObject *args = PyTuple_Pack(1, arg);
33871     if (unlikely(!args)) return NULL;
33872     result = __Pyx_PyObject_Call(func, args, NULL);
33873     Py_DECREF(args);
33874     return result;
33875 }
33876 #endif
33877 
33878 /* PyErrExceptionMatches */
33879   #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)33880 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
33881     Py_ssize_t i, n;
33882     n = PyTuple_GET_SIZE(tuple);
33883 #if PY_MAJOR_VERSION >= 3
33884     for (i=0; i<n; i++) {
33885         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
33886     }
33887 #endif
33888     for (i=0; i<n; i++) {
33889         if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
33890     }
33891     return 0;
33892 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)33893 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
33894     PyObject *exc_type = tstate->curexc_type;
33895     if (exc_type == err) return 1;
33896     if (unlikely(!exc_type)) return 0;
33897     if (unlikely(PyTuple_Check(err)))
33898         return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
33899     return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
33900 }
33901 #endif
33902 
33903 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)33904   static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
33905 #if CYTHON_USE_TYPE_SLOTS
33906 #if PY_MAJOR_VERSION >= 3
33907     if (likely(PyUnicode_Check(n)))
33908 #else
33909     if (likely(PyString_Check(n)))
33910 #endif
33911         return __Pyx_PyObject_GetAttrStr(o, n);
33912 #endif
33913     return PyObject_GetAttr(o, n);
33914 }
33915 
33916 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)33917   static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
33918     __Pyx_PyThreadState_declare
33919     __Pyx_PyThreadState_assign
33920     if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
33921         return NULL;
33922     __Pyx_PyErr_Clear();
33923     Py_INCREF(d);
33924     return d;
33925 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)33926 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
33927     PyObject *r = __Pyx_GetAttr(o, n);
33928     return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
33929 }
33930 
33931 /* GetModuleGlobalName */
33932   #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)33933 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
33934 #else
33935 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
33936 #endif
33937 {
33938     PyObject *result;
33939 #if !CYTHON_AVOID_BORROWED_REFS
33940 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
33941     result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
33942     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33943     if (likely(result)) {
33944         return __Pyx_NewRef(result);
33945     } else if (unlikely(PyErr_Occurred())) {
33946         return NULL;
33947     }
33948 #else
33949     result = PyDict_GetItem(__pyx_d, name);
33950     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33951     if (likely(result)) {
33952         return __Pyx_NewRef(result);
33953     }
33954 #endif
33955 #else
33956     result = PyObject_GetItem(__pyx_d, name);
33957     __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
33958     if (likely(result)) {
33959         return __Pyx_NewRef(result);
33960     }
33961     PyErr_Clear();
33962 #endif
33963     return __Pyx_GetBuiltinName(name);
33964 }
33965 
33966 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)33967   static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
33968     PyObject *r;
33969     if (!j) return NULL;
33970     r = PyObject_GetItem(o, j);
33971     Py_DECREF(j);
33972     return r;
33973 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)33974 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
33975                                                               CYTHON_NCP_UNUSED int wraparound,
33976                                                               CYTHON_NCP_UNUSED int boundscheck) {
33977 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33978     Py_ssize_t wrapped_i = i;
33979     if (wraparound & unlikely(i < 0)) {
33980         wrapped_i += PyList_GET_SIZE(o);
33981     }
33982     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
33983         PyObject *r = PyList_GET_ITEM(o, wrapped_i);
33984         Py_INCREF(r);
33985         return r;
33986     }
33987     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
33988 #else
33989     return PySequence_GetItem(o, i);
33990 #endif
33991 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)33992 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
33993                                                               CYTHON_NCP_UNUSED int wraparound,
33994                                                               CYTHON_NCP_UNUSED int boundscheck) {
33995 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
33996     Py_ssize_t wrapped_i = i;
33997     if (wraparound & unlikely(i < 0)) {
33998         wrapped_i += PyTuple_GET_SIZE(o);
33999     }
34000     if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
34001         PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
34002         Py_INCREF(r);
34003         return r;
34004     }
34005     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
34006 #else
34007     return PySequence_GetItem(o, i);
34008 #endif
34009 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)34010 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
34011                                                      CYTHON_NCP_UNUSED int wraparound,
34012                                                      CYTHON_NCP_UNUSED int boundscheck) {
34013 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
34014     if (is_list || PyList_CheckExact(o)) {
34015         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
34016         if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
34017             PyObject *r = PyList_GET_ITEM(o, n);
34018             Py_INCREF(r);
34019             return r;
34020         }
34021     }
34022     else if (PyTuple_CheckExact(o)) {
34023         Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
34024         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
34025             PyObject *r = PyTuple_GET_ITEM(o, n);
34026             Py_INCREF(r);
34027             return r;
34028         }
34029     } else {
34030         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
34031         if (likely(m && m->sq_item)) {
34032             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
34033                 Py_ssize_t l = m->sq_length(o);
34034                 if (likely(l >= 0)) {
34035                     i += l;
34036                 } else {
34037                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34038                         return NULL;
34039                     PyErr_Clear();
34040                 }
34041             }
34042             return m->sq_item(o, i);
34043         }
34044     }
34045 #else
34046     if (is_list || PySequence_Check(o)) {
34047         return PySequence_GetItem(o, i);
34048     }
34049 #endif
34050     return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
34051 }
34052 
34053 /* ObjectGetItem */
34054   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)34055 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
34056     PyObject *runerr;
34057     Py_ssize_t key_value;
34058     PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
34059     if (unlikely(!(m && m->sq_item))) {
34060         PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
34061         return NULL;
34062     }
34063     key_value = __Pyx_PyIndex_AsSsize_t(index);
34064     if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
34065         return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
34066     }
34067     if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
34068         PyErr_Clear();
34069         PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
34070     }
34071     return NULL;
34072 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)34073 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
34074     PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
34075     if (likely(m && m->mp_subscript)) {
34076         return m->mp_subscript(obj, key);
34077     }
34078     return __Pyx_PyObject_GetIndex(obj, key);
34079 }
34080 #endif
34081 
34082 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)34083   static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
34084     if (unlikely(!type)) {
34085         PyErr_SetString(PyExc_SystemError, "Missing type object");
34086         return 0;
34087     }
34088     if (likely(__Pyx_TypeCheck(obj, type)))
34089         return 1;
34090     PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
34091                  Py_TYPE(obj)->tp_name, type->tp_name);
34092     return 0;
34093 }
34094 
34095 /* BufferFallbackError */
__Pyx_RaiseBufferFallbackError(void)34096   static void __Pyx_RaiseBufferFallbackError(void) {
34097   PyErr_SetString(PyExc_ValueError,
34098      "Buffer acquisition failed on assignment; and then reacquiring the old buffer failed too!");
34099 }
34100 
34101 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)34102   static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
34103     PyErr_Format(PyExc_ValueError,
34104                  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
34105 }
34106 
34107 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)34108   static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
34109     PyErr_Format(PyExc_ValueError,
34110                  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
34111                  index, (index == 1) ? "" : "s");
34112 }
34113 
34114 /* IterFinish */
__Pyx_IterFinish(void)34115   static CYTHON_INLINE int __Pyx_IterFinish(void) {
34116 #if CYTHON_FAST_THREAD_STATE
34117     PyThreadState *tstate = __Pyx_PyThreadState_Current;
34118     PyObject* exc_type = tstate->curexc_type;
34119     if (unlikely(exc_type)) {
34120         if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
34121             PyObject *exc_value, *exc_tb;
34122             exc_value = tstate->curexc_value;
34123             exc_tb = tstate->curexc_traceback;
34124             tstate->curexc_type = 0;
34125             tstate->curexc_value = 0;
34126             tstate->curexc_traceback = 0;
34127             Py_DECREF(exc_type);
34128             Py_XDECREF(exc_value);
34129             Py_XDECREF(exc_tb);
34130             return 0;
34131         } else {
34132             return -1;
34133         }
34134     }
34135     return 0;
34136 #else
34137     if (unlikely(PyErr_Occurred())) {
34138         if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
34139             PyErr_Clear();
34140             return 0;
34141         } else {
34142             return -1;
34143         }
34144     }
34145     return 0;
34146 #endif
34147 }
34148 
34149 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)34150   static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
34151     if (unlikely(retval)) {
34152         Py_DECREF(retval);
34153         __Pyx_RaiseTooManyValuesError(expected);
34154         return -1;
34155     } else {
34156         return __Pyx_IterFinish();
34157     }
34158     return 0;
34159 }
34160 
34161 /* DictGetItem */
34162   #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
__Pyx_PyDict_GetItem(PyObject * d,PyObject * key)34163 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
34164     PyObject *value;
34165     value = PyDict_GetItemWithError(d, key);
34166     if (unlikely(!value)) {
34167         if (!PyErr_Occurred()) {
34168             if (unlikely(PyTuple_Check(key))) {
34169                 PyObject* args = PyTuple_Pack(1, key);
34170                 if (likely(args)) {
34171                     PyErr_SetObject(PyExc_KeyError, args);
34172                     Py_DECREF(args);
34173                 }
34174             } else {
34175                 PyErr_SetObject(PyExc_KeyError, key);
34176             }
34177         }
34178         return NULL;
34179     }
34180     Py_INCREF(value);
34181     return value;
34182 }
34183 #endif
34184 
34185 /* PyObjectSetAttrStr */
34186   #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)34187 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
34188     PyTypeObject* tp = Py_TYPE(obj);
34189     if (likely(tp->tp_setattro))
34190         return tp->tp_setattro(obj, attr_name, value);
34191 #if PY_MAJOR_VERSION < 3
34192     if (likely(tp->tp_setattr))
34193         return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
34194 #endif
34195     return PyObject_SetAttr(obj, attr_name, value);
34196 }
34197 #endif
34198 
34199 /* SetItemInt */
__Pyx_SetItemInt_Generic(PyObject * o,PyObject * j,PyObject * v)34200   static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
34201     int r;
34202     if (!j) return -1;
34203     r = PyObject_SetItem(o, j, v);
34204     Py_DECREF(j);
34205     return r;
34206 }
__Pyx_SetItemInt_Fast(PyObject * o,Py_ssize_t i,PyObject * v,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)34207 static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
34208                                                CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
34209 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
34210     if (is_list || PyList_CheckExact(o)) {
34211         Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
34212         if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o)))) {
34213             PyObject* old = PyList_GET_ITEM(o, n);
34214             Py_INCREF(v);
34215             PyList_SET_ITEM(o, n, v);
34216             Py_DECREF(old);
34217             return 1;
34218         }
34219     } else {
34220         PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
34221         if (likely(m && m->sq_ass_item)) {
34222             if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
34223                 Py_ssize_t l = m->sq_length(o);
34224                 if (likely(l >= 0)) {
34225                     i += l;
34226                 } else {
34227                     if (!PyErr_ExceptionMatches(PyExc_OverflowError))
34228                         return -1;
34229                     PyErr_Clear();
34230                 }
34231             }
34232             return m->sq_ass_item(o, i, v);
34233         }
34234     }
34235 #else
34236 #if CYTHON_COMPILING_IN_PYPY
34237     if (is_list || (PySequence_Check(o) && !PyDict_Check(o)))
34238 #else
34239     if (is_list || PySequence_Check(o))
34240 #endif
34241     {
34242         return PySequence_SetItem(o, i, v);
34243     }
34244 #endif
34245     return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
34246 }
34247 
34248 /* PyFloatBinop */
34249   #if !CYTHON_COMPILING_IN_PYPY
34250 #define __Pyx_PyFloat_DivideCObj_ZeroDivisionError(operand) if (unlikely(zerodivision_check && ((operand) == 0))) {\
34251     PyErr_SetString(PyExc_ZeroDivisionError, "float division by zero");\
34252     return NULL;\
34253 }
__Pyx_PyFloat_DivideCObj(PyObject * op1,PyObject * op2,double floatval,int inplace,int zerodivision_check)34254 static PyObject* __Pyx_PyFloat_DivideCObj(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
34255     const double a = floatval;
34256     double b, result;
34257     (void)inplace;
34258     (void)zerodivision_check;
34259     if (likely(PyFloat_CheckExact(op2))) {
34260         b = PyFloat_AS_DOUBLE(op2);
34261         __Pyx_PyFloat_DivideCObj_ZeroDivisionError(b)
34262     } else
34263     #if PY_MAJOR_VERSION < 3
34264     if (likely(PyInt_CheckExact(op2))) {
34265         b = (double) PyInt_AS_LONG(op2);
34266         __Pyx_PyFloat_DivideCObj_ZeroDivisionError(b)
34267     } else
34268     #endif
34269     if (likely(PyLong_CheckExact(op2))) {
34270         #if CYTHON_USE_PYLONG_INTERNALS
34271         const digit* digits = ((PyLongObject*)op2)->ob_digit;
34272         const Py_ssize_t size = Py_SIZE(op2);
34273         switch (size) {
34274             case  0: __Pyx_PyFloat_DivideCObj_ZeroDivisionError(0) break;
34275             case -1: b = -(double) digits[0]; break;
34276             case  1: b = (double) digits[0]; break;
34277             case -2:
34278             case 2:
34279                 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
34280                     b = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34281                     if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
34282                         if (size == -2)
34283                             b = -b;
34284                         break;
34285                     }
34286                 }
34287                 CYTHON_FALLTHROUGH;
34288             case -3:
34289             case 3:
34290                 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
34291                     b = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34292                     if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
34293                         if (size == -3)
34294                             b = -b;
34295                         break;
34296                     }
34297                 }
34298                 CYTHON_FALLTHROUGH;
34299             case -4:
34300             case 4:
34301                 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
34302                     b = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
34303                     if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (b < (double) ((PY_LONG_LONG)1 << 53))) {
34304                         if (size == -4)
34305                             b = -b;
34306                         break;
34307                     }
34308                 }
34309                 CYTHON_FALLTHROUGH;
34310             default:
34311         #else
34312         {
34313         #endif
34314             b = PyLong_AsDouble(op2);
34315             if (unlikely(b == -1.0 && PyErr_Occurred())) return NULL;
34316             __Pyx_PyFloat_DivideCObj_ZeroDivisionError(b)
34317         }
34318     } else {
34319         return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
34320     }
34321         __Pyx_PyFloat_DivideCObj_ZeroDivisionError(b)
34322         PyFPE_START_PROTECT("divide", return NULL)
34323         result = a / b;
34324         PyFPE_END_PROTECT(result)
34325         return PyFloat_FromDouble(result);
34326 }
34327 #endif
34328 
34329 /* Import */
34330     static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
34331     PyObject *empty_list = 0;
34332     PyObject *module = 0;
34333     PyObject *global_dict = 0;
34334     PyObject *empty_dict = 0;
34335     PyObject *list;
34336     #if PY_MAJOR_VERSION < 3
34337     PyObject *py_import;
34338     py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
34339     if (!py_import)
34340         goto bad;
34341     #endif
34342     if (from_list)
34343         list = from_list;
34344     else {
34345         empty_list = PyList_New(0);
34346         if (!empty_list)
34347             goto bad;
34348         list = empty_list;
34349     }
34350     global_dict = PyModule_GetDict(__pyx_m);
34351     if (!global_dict)
34352         goto bad;
34353     empty_dict = PyDict_New();
34354     if (!empty_dict)
34355         goto bad;
34356     {
34357         #if PY_MAJOR_VERSION >= 3
34358         if (level == -1) {
34359             if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
34360                 module = PyImport_ImportModuleLevelObject(
34361                     name, global_dict, empty_dict, list, 1);
34362                 if (!module) {
34363                     if (!PyErr_ExceptionMatches(PyExc_ImportError))
34364                         goto bad;
34365                     PyErr_Clear();
34366                 }
34367             }
34368             level = 0;
34369         }
34370         #endif
34371         if (!module) {
34372             #if PY_MAJOR_VERSION < 3
34373             PyObject *py_level = PyInt_FromLong(level);
34374             if (!py_level)
34375                 goto bad;
34376             module = PyObject_CallFunctionObjArgs(py_import,
34377                 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
34378             Py_DECREF(py_level);
34379             #else
34380             module = PyImport_ImportModuleLevelObject(
34381                 name, global_dict, empty_dict, list, level);
34382             #endif
34383         }
34384     }
34385 bad:
34386     #if PY_MAJOR_VERSION < 3
34387     Py_XDECREF(py_import);
34388     #endif
34389     Py_XDECREF(empty_list);
34390     Py_XDECREF(empty_dict);
34391     return module;
34392 }
34393 
34394 /* ImportFrom */
34395     static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
34396     PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
34397     if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
34398         PyErr_Format(PyExc_ImportError,
34399         #if PY_MAJOR_VERSION < 3
34400             "cannot import name %.230s", PyString_AS_STRING(name));
34401         #else
34402             "cannot import name %S", name);
34403         #endif
34404     }
34405     return value;
34406 }
34407 
34408 /* HasAttr */
34409     static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
34410     PyObject *r;
34411     if (unlikely(!__Pyx_PyBaseString_Check(n))) {
34412         PyErr_SetString(PyExc_TypeError,
34413                         "hasattr(): attribute name must be string");
34414         return -1;
34415     }
34416     r = __Pyx_GetAttr(o, n);
34417     if (unlikely(!r)) {
34418         PyErr_Clear();
34419         return 0;
34420     } else {
34421         Py_DECREF(r);
34422         return 1;
34423     }
34424 }
34425 
34426 /* GetTopmostException */
34427     #if CYTHON_USE_EXC_INFO_STACK
34428 static _PyErr_StackItem *
34429 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
34430 {
34431     _PyErr_StackItem *exc_info = tstate->exc_info;
34432     while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
34433            exc_info->previous_item != NULL)
34434     {
34435         exc_info = exc_info->previous_item;
34436     }
34437     return exc_info;
34438 }
34439 #endif
34440 
34441 /* SaveResetException */
34442     #if CYTHON_FAST_THREAD_STATE
34443 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
34444     #if CYTHON_USE_EXC_INFO_STACK
34445     _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
34446     *type = exc_info->exc_type;
34447     *value = exc_info->exc_value;
34448     *tb = exc_info->exc_traceback;
34449     #else
34450     *type = tstate->exc_type;
34451     *value = tstate->exc_value;
34452     *tb = tstate->exc_traceback;
34453     #endif
34454     Py_XINCREF(*type);
34455     Py_XINCREF(*value);
34456     Py_XINCREF(*tb);
34457 }
34458 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
34459     PyObject *tmp_type, *tmp_value, *tmp_tb;
34460     #if CYTHON_USE_EXC_INFO_STACK
34461     _PyErr_StackItem *exc_info = tstate->exc_info;
34462     tmp_type = exc_info->exc_type;
34463     tmp_value = exc_info->exc_value;
34464     tmp_tb = exc_info->exc_traceback;
34465     exc_info->exc_type = type;
34466     exc_info->exc_value = value;
34467     exc_info->exc_traceback = tb;
34468     #else
34469     tmp_type = tstate->exc_type;
34470     tmp_value = tstate->exc_value;
34471     tmp_tb = tstate->exc_traceback;
34472     tstate->exc_type = type;
34473     tstate->exc_value = value;
34474     tstate->exc_traceback = tb;
34475     #endif
34476     Py_XDECREF(tmp_type);
34477     Py_XDECREF(tmp_value);
34478     Py_XDECREF(tmp_tb);
34479 }
34480 #endif
34481 
34482 /* GetException */
34483     #if CYTHON_FAST_THREAD_STATE
34484 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
34485 #else
34486 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
34487 #endif
34488 {
34489     PyObject *local_type, *local_value, *local_tb;
34490 #if CYTHON_FAST_THREAD_STATE
34491     PyObject *tmp_type, *tmp_value, *tmp_tb;
34492     local_type = tstate->curexc_type;
34493     local_value = tstate->curexc_value;
34494     local_tb = tstate->curexc_traceback;
34495     tstate->curexc_type = 0;
34496     tstate->curexc_value = 0;
34497     tstate->curexc_traceback = 0;
34498 #else
34499     PyErr_Fetch(&local_type, &local_value, &local_tb);
34500 #endif
34501     PyErr_NormalizeException(&local_type, &local_value, &local_tb);
34502 #if CYTHON_FAST_THREAD_STATE
34503     if (unlikely(tstate->curexc_type))
34504 #else
34505     if (unlikely(PyErr_Occurred()))
34506 #endif
34507         goto bad;
34508     #if PY_MAJOR_VERSION >= 3
34509     if (local_tb) {
34510         if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
34511             goto bad;
34512     }
34513     #endif
34514     Py_XINCREF(local_tb);
34515     Py_XINCREF(local_type);
34516     Py_XINCREF(local_value);
34517     *type = local_type;
34518     *value = local_value;
34519     *tb = local_tb;
34520 #if CYTHON_FAST_THREAD_STATE
34521     #if CYTHON_USE_EXC_INFO_STACK
34522     {
34523         _PyErr_StackItem *exc_info = tstate->exc_info;
34524         tmp_type = exc_info->exc_type;
34525         tmp_value = exc_info->exc_value;
34526         tmp_tb = exc_info->exc_traceback;
34527         exc_info->exc_type = local_type;
34528         exc_info->exc_value = local_value;
34529         exc_info->exc_traceback = local_tb;
34530     }
34531     #else
34532     tmp_type = tstate->exc_type;
34533     tmp_value = tstate->exc_value;
34534     tmp_tb = tstate->exc_traceback;
34535     tstate->exc_type = local_type;
34536     tstate->exc_value = local_value;
34537     tstate->exc_traceback = local_tb;
34538     #endif
34539     Py_XDECREF(tmp_type);
34540     Py_XDECREF(tmp_value);
34541     Py_XDECREF(tmp_tb);
34542 #else
34543     PyErr_SetExcInfo(local_type, local_value, local_tb);
34544 #endif
34545     return 0;
34546 bad:
34547     *type = 0;
34548     *value = 0;
34549     *tb = 0;
34550     Py_XDECREF(local_type);
34551     Py_XDECREF(local_value);
34552     Py_XDECREF(local_tb);
34553     return -1;
34554 }
34555 
34556 /* CallNextTpTraverse */
34557     static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
34558     PyTypeObject* type = Py_TYPE(obj);
34559     while (type && type->tp_traverse != current_tp_traverse)
34560         type = type->tp_base;
34561     while (type && type->tp_traverse == current_tp_traverse)
34562         type = type->tp_base;
34563     if (type && type->tp_traverse)
34564         return type->tp_traverse(obj, v, a);
34565     return 0;
34566 }
34567 
34568 /* CallNextTpClear */
34569     static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
34570     PyTypeObject* type = Py_TYPE(obj);
34571     while (type && type->tp_clear != current_tp_clear)
34572         type = type->tp_base;
34573     while (type && type->tp_clear == current_tp_clear)
34574         type = type->tp_base;
34575     if (type && type->tp_clear)
34576         type->tp_clear(obj);
34577 }
34578 
34579 /* PyObject_GenericGetAttrNoDict */
34580     #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
34581 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
34582     PyErr_Format(PyExc_AttributeError,
34583 #if PY_MAJOR_VERSION >= 3
34584                  "'%.50s' object has no attribute '%U'",
34585                  tp->tp_name, attr_name);
34586 #else
34587                  "'%.50s' object has no attribute '%.400s'",
34588                  tp->tp_name, PyString_AS_STRING(attr_name));
34589 #endif
34590     return NULL;
34591 }
34592 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
34593     PyObject *descr;
34594     PyTypeObject *tp = Py_TYPE(obj);
34595     if (unlikely(!PyString_Check(attr_name))) {
34596         return PyObject_GenericGetAttr(obj, attr_name);
34597     }
34598     assert(!tp->tp_dictoffset);
34599     descr = _PyType_Lookup(tp, attr_name);
34600     if (unlikely(!descr)) {
34601         return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
34602     }
34603     Py_INCREF(descr);
34604     #if PY_MAJOR_VERSION < 3
34605     if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
34606     #endif
34607     {
34608         descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
34609         if (unlikely(f)) {
34610             PyObject *res = f(descr, obj, (PyObject *)tp);
34611             Py_DECREF(descr);
34612             return res;
34613         }
34614     }
34615     return descr;
34616 }
34617 #endif
34618 
34619 /* PyObject_GenericGetAttr */
34620     #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
34621 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
34622     if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
34623         return PyObject_GenericGetAttr(obj, attr_name);
34624     }
34625     return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
34626 }
34627 #endif
34628 
34629 /* SetVTable */
34630     static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
34631 #if PY_VERSION_HEX >= 0x02070000
34632     PyObject *ob = PyCapsule_New(vtable, 0, 0);
34633 #else
34634     PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
34635 #endif
34636     if (!ob)
34637         goto bad;
34638     if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
34639         goto bad;
34640     Py_DECREF(ob);
34641     return 0;
34642 bad:
34643     Py_XDECREF(ob);
34644     return -1;
34645 }
34646 
34647 /* PyObjectGetAttrStrNoError */
34648     static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
34649     __Pyx_PyThreadState_declare
34650     __Pyx_PyThreadState_assign
34651     if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
34652         __Pyx_PyErr_Clear();
34653 }
34654 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
34655     PyObject *result;
34656 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
34657     PyTypeObject* tp = Py_TYPE(obj);
34658     if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
34659         return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
34660     }
34661 #endif
34662     result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
34663     if (unlikely(!result)) {
34664         __Pyx_PyObject_GetAttrStr_ClearAttributeError();
34665     }
34666     return result;
34667 }
34668 
34669 /* SetupReduce */
34670     static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
34671   int ret;
34672   PyObject *name_attr;
34673   name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
34674   if (likely(name_attr)) {
34675       ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
34676   } else {
34677       ret = -1;
34678   }
34679   if (unlikely(ret < 0)) {
34680       PyErr_Clear();
34681       ret = 0;
34682   }
34683   Py_XDECREF(name_attr);
34684   return ret;
34685 }
34686 static int __Pyx_setup_reduce(PyObject* type_obj) {
34687     int ret = 0;
34688     PyObject *object_reduce = NULL;
34689     PyObject *object_reduce_ex = NULL;
34690     PyObject *reduce = NULL;
34691     PyObject *reduce_ex = NULL;
34692     PyObject *reduce_cython = NULL;
34693     PyObject *setstate = NULL;
34694     PyObject *setstate_cython = NULL;
34695 #if CYTHON_USE_PYTYPE_LOOKUP
34696     if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
34697 #else
34698     if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
34699 #endif
34700 #if CYTHON_USE_PYTYPE_LOOKUP
34701     object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
34702 #else
34703     object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
34704 #endif
34705     reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
34706     if (reduce_ex == object_reduce_ex) {
34707 #if CYTHON_USE_PYTYPE_LOOKUP
34708         object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
34709 #else
34710         object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
34711 #endif
34712         reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
34713         if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
34714             reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
34715             if (likely(reduce_cython)) {
34716                 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34717                 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34718             } else if (reduce == object_reduce || PyErr_Occurred()) {
34719                 goto __PYX_BAD;
34720             }
34721             setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
34722             if (!setstate) PyErr_Clear();
34723             if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
34724                 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
34725                 if (likely(setstate_cython)) {
34726                     ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34727                     ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
34728                 } else if (!setstate || PyErr_Occurred()) {
34729                     goto __PYX_BAD;
34730                 }
34731             }
34732             PyType_Modified((PyTypeObject*)type_obj);
34733         }
34734     }
34735     goto __PYX_GOOD;
34736 __PYX_BAD:
34737     if (!PyErr_Occurred())
34738         PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
34739     ret = -1;
34740 __PYX_GOOD:
34741 #if !CYTHON_USE_PYTYPE_LOOKUP
34742     Py_XDECREF(object_reduce);
34743     Py_XDECREF(object_reduce_ex);
34744 #endif
34745     Py_XDECREF(reduce);
34746     Py_XDECREF(reduce_ex);
34747     Py_XDECREF(reduce_cython);
34748     Py_XDECREF(setstate);
34749     Py_XDECREF(setstate_cython);
34750     return ret;
34751 }
34752 
34753 /* TypeImport */
34754     #ifndef __PYX_HAVE_RT_ImportType
34755 #define __PYX_HAVE_RT_ImportType
34756 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
34757     size_t size, enum __Pyx_ImportType_CheckSize check_size)
34758 {
34759     PyObject *result = 0;
34760     char warning[200];
34761     Py_ssize_t basicsize;
34762 #ifdef Py_LIMITED_API
34763     PyObject *py_basicsize;
34764 #endif
34765     result = PyObject_GetAttrString(module, class_name);
34766     if (!result)
34767         goto bad;
34768     if (!PyType_Check(result)) {
34769         PyErr_Format(PyExc_TypeError,
34770             "%.200s.%.200s is not a type object",
34771             module_name, class_name);
34772         goto bad;
34773     }
34774 #ifndef Py_LIMITED_API
34775     basicsize = ((PyTypeObject *)result)->tp_basicsize;
34776 #else
34777     py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
34778     if (!py_basicsize)
34779         goto bad;
34780     basicsize = PyLong_AsSsize_t(py_basicsize);
34781     Py_DECREF(py_basicsize);
34782     py_basicsize = 0;
34783     if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
34784         goto bad;
34785 #endif
34786     if ((size_t)basicsize < size) {
34787         PyErr_Format(PyExc_ValueError,
34788             "%.200s.%.200s size changed, may indicate binary incompatibility. "
34789             "Expected %zd from C header, got %zd from PyObject",
34790             module_name, class_name, size, basicsize);
34791         goto bad;
34792     }
34793     if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
34794         PyErr_Format(PyExc_ValueError,
34795             "%.200s.%.200s size changed, may indicate binary incompatibility. "
34796             "Expected %zd from C header, got %zd from PyObject",
34797             module_name, class_name, size, basicsize);
34798         goto bad;
34799     }
34800     else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
34801         PyOS_snprintf(warning, sizeof(warning),
34802             "%s.%s size changed, may indicate binary incompatibility. "
34803             "Expected %zd from C header, got %zd from PyObject",
34804             module_name, class_name, size, basicsize);
34805         if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
34806     }
34807     return (PyTypeObject *)result;
34808 bad:
34809     Py_XDECREF(result);
34810     return NULL;
34811 }
34812 #endif
34813 
34814 /* CLineInTraceback */
34815     #ifndef CYTHON_CLINE_IN_TRACEBACK
34816 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
34817     PyObject *use_cline;
34818     PyObject *ptype, *pvalue, *ptraceback;
34819 #if CYTHON_COMPILING_IN_CPYTHON
34820     PyObject **cython_runtime_dict;
34821 #endif
34822     if (unlikely(!__pyx_cython_runtime)) {
34823         return c_line;
34824     }
34825     __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
34826 #if CYTHON_COMPILING_IN_CPYTHON
34827     cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
34828     if (likely(cython_runtime_dict)) {
34829         __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
34830             use_cline, *cython_runtime_dict,
34831             __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
34832     } else
34833 #endif
34834     {
34835       PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
34836       if (use_cline_obj) {
34837         use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
34838         Py_DECREF(use_cline_obj);
34839       } else {
34840         PyErr_Clear();
34841         use_cline = NULL;
34842       }
34843     }
34844     if (!use_cline) {
34845         c_line = 0;
34846         PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
34847     }
34848     else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
34849         c_line = 0;
34850     }
34851     __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
34852     return c_line;
34853 }
34854 #endif
34855 
34856 /* CodeObjectCache */
34857     static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
34858     int start = 0, mid = 0, end = count - 1;
34859     if (end >= 0 && code_line > entries[end].code_line) {
34860         return count;
34861     }
34862     while (start < end) {
34863         mid = start + (end - start) / 2;
34864         if (code_line < entries[mid].code_line) {
34865             end = mid;
34866         } else if (code_line > entries[mid].code_line) {
34867              start = mid + 1;
34868         } else {
34869             return mid;
34870         }
34871     }
34872     if (code_line <= entries[mid].code_line) {
34873         return mid;
34874     } else {
34875         return mid + 1;
34876     }
34877 }
34878 static PyCodeObject *__pyx_find_code_object(int code_line) {
34879     PyCodeObject* code_object;
34880     int pos;
34881     if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
34882         return NULL;
34883     }
34884     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
34885     if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
34886         return NULL;
34887     }
34888     code_object = __pyx_code_cache.entries[pos].code_object;
34889     Py_INCREF(code_object);
34890     return code_object;
34891 }
34892 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
34893     int pos, i;
34894     __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
34895     if (unlikely(!code_line)) {
34896         return;
34897     }
34898     if (unlikely(!entries)) {
34899         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
34900         if (likely(entries)) {
34901             __pyx_code_cache.entries = entries;
34902             __pyx_code_cache.max_count = 64;
34903             __pyx_code_cache.count = 1;
34904             entries[0].code_line = code_line;
34905             entries[0].code_object = code_object;
34906             Py_INCREF(code_object);
34907         }
34908         return;
34909     }
34910     pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
34911     if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
34912         PyCodeObject* tmp = entries[pos].code_object;
34913         entries[pos].code_object = code_object;
34914         Py_DECREF(tmp);
34915         return;
34916     }
34917     if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
34918         int new_max = __pyx_code_cache.max_count + 64;
34919         entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
34920             __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
34921         if (unlikely(!entries)) {
34922             return;
34923         }
34924         __pyx_code_cache.entries = entries;
34925         __pyx_code_cache.max_count = new_max;
34926     }
34927     for (i=__pyx_code_cache.count; i>pos; i--) {
34928         entries[i] = entries[i-1];
34929     }
34930     entries[pos].code_line = code_line;
34931     entries[pos].code_object = code_object;
34932     __pyx_code_cache.count++;
34933     Py_INCREF(code_object);
34934 }
34935 
34936 /* AddTraceback */
34937     #include "compile.h"
34938 #include "frameobject.h"
34939 #include "traceback.h"
34940 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
34941             const char *funcname, int c_line,
34942             int py_line, const char *filename) {
34943     PyCodeObject *py_code = 0;
34944     PyObject *py_srcfile = 0;
34945     PyObject *py_funcname = 0;
34946     #if PY_MAJOR_VERSION < 3
34947     py_srcfile = PyString_FromString(filename);
34948     #else
34949     py_srcfile = PyUnicode_FromString(filename);
34950     #endif
34951     if (!py_srcfile) goto bad;
34952     if (c_line) {
34953         #if PY_MAJOR_VERSION < 3
34954         py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
34955         #else
34956         py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
34957         #endif
34958     }
34959     else {
34960         #if PY_MAJOR_VERSION < 3
34961         py_funcname = PyString_FromString(funcname);
34962         #else
34963         py_funcname = PyUnicode_FromString(funcname);
34964         #endif
34965     }
34966     if (!py_funcname) goto bad;
34967     py_code = __Pyx_PyCode_New(
34968         0,
34969         0,
34970         0,
34971         0,
34972         0,
34973         __pyx_empty_bytes, /*PyObject *code,*/
34974         __pyx_empty_tuple, /*PyObject *consts,*/
34975         __pyx_empty_tuple, /*PyObject *names,*/
34976         __pyx_empty_tuple, /*PyObject *varnames,*/
34977         __pyx_empty_tuple, /*PyObject *freevars,*/
34978         __pyx_empty_tuple, /*PyObject *cellvars,*/
34979         py_srcfile,   /*PyObject *filename,*/
34980         py_funcname,  /*PyObject *name,*/
34981         py_line,
34982         __pyx_empty_bytes  /*PyObject *lnotab*/
34983     );
34984     Py_DECREF(py_srcfile);
34985     Py_DECREF(py_funcname);
34986     return py_code;
34987 bad:
34988     Py_XDECREF(py_srcfile);
34989     Py_XDECREF(py_funcname);
34990     return NULL;
34991 }
34992 static void __Pyx_AddTraceback(const char *funcname, int c_line,
34993                                int py_line, const char *filename) {
34994     PyCodeObject *py_code = 0;
34995     PyFrameObject *py_frame = 0;
34996     PyThreadState *tstate = __Pyx_PyThreadState_Current;
34997     if (c_line) {
34998         c_line = __Pyx_CLineForTraceback(tstate, c_line);
34999     }
35000     py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
35001     if (!py_code) {
35002         py_code = __Pyx_CreateCodeObjectForTraceback(
35003             funcname, c_line, py_line, filename);
35004         if (!py_code) goto bad;
35005         __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
35006     }
35007     py_frame = PyFrame_New(
35008         tstate,            /*PyThreadState *tstate,*/
35009         py_code,           /*PyCodeObject *code,*/
35010         __pyx_d,    /*PyObject *globals,*/
35011         0                  /*PyObject *locals*/
35012     );
35013     if (!py_frame) goto bad;
35014     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
35015     PyTraceBack_Here(py_frame);
35016 bad:
35017     Py_XDECREF(py_code);
35018     Py_XDECREF(py_frame);
35019 }
35020 
35021 /* CIntToPy */
35022     static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
35023     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
35024     const int is_unsigned = neg_one > const_zero;
35025     if (is_unsigned) {
35026         if (sizeof(int) < sizeof(long)) {
35027             return PyInt_FromLong((long) value);
35028         } else if (sizeof(int) <= sizeof(unsigned long)) {
35029             return PyLong_FromUnsignedLong((unsigned long) value);
35030 #ifdef HAVE_LONG_LONG
35031         } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35032             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35033 #endif
35034         }
35035     } else {
35036         if (sizeof(int) <= sizeof(long)) {
35037             return PyInt_FromLong((long) value);
35038 #ifdef HAVE_LONG_LONG
35039         } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
35040             return PyLong_FromLongLong((PY_LONG_LONG) value);
35041 #endif
35042         }
35043     }
35044     {
35045         int one = 1; int little = (int)*(unsigned char *)&one;
35046         unsigned char *bytes = (unsigned char *)&value;
35047         return _PyLong_FromByteArray(bytes, sizeof(int),
35048                                      little, !is_unsigned);
35049     }
35050 }
35051 
35052 /* CIntFromPyVerify */
35053     #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
35054     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
35055 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
35056     __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
35057 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
35058     {\
35059         func_type value = func_value;\
35060         if (sizeof(target_type) < sizeof(func_type)) {\
35061             if (unlikely(value != (func_type) (target_type) value)) {\
35062                 func_type zero = 0;\
35063                 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
35064                     return (target_type) -1;\
35065                 if (is_unsigned && unlikely(value < zero))\
35066                     goto raise_neg_overflow;\
35067                 else\
35068                     goto raise_overflow;\
35069             }\
35070         }\
35071         return (target_type) value;\
35072     }
35073 
35074 #if PY_MAJOR_VERSION < 3
35075 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
35076     if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
35077     PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
35078     return -1;
35079 }
35080 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
35081     PyObject *obj = view->obj;
35082     if (!obj) return;
35083     if (PyObject_CheckBuffer(obj)) {
35084         PyBuffer_Release(view);
35085         return;
35086     }
35087     if ((0)) {}
35088     view->obj = NULL;
35089     Py_DECREF(obj);
35090 }
35091 #endif
35092 
35093 
35094     /* CIntToPy */
35095     static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
35096     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
35097     const int is_unsigned = neg_one > const_zero;
35098     if (is_unsigned) {
35099         if (sizeof(long) < sizeof(long)) {
35100             return PyInt_FromLong((long) value);
35101         } else if (sizeof(long) <= sizeof(unsigned long)) {
35102             return PyLong_FromUnsignedLong((unsigned long) value);
35103 #ifdef HAVE_LONG_LONG
35104         } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35105             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35106 #endif
35107         }
35108     } else {
35109         if (sizeof(long) <= sizeof(long)) {
35110             return PyInt_FromLong((long) value);
35111 #ifdef HAVE_LONG_LONG
35112         } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35113             return PyLong_FromLongLong((PY_LONG_LONG) value);
35114 #endif
35115         }
35116     }
35117     {
35118         int one = 1; int little = (int)*(unsigned char *)&one;
35119         unsigned char *bytes = (unsigned char *)&value;
35120         return _PyLong_FromByteArray(bytes, sizeof(long),
35121                                      little, !is_unsigned);
35122     }
35123 }
35124 
35125 /* CIntToPy */
35126     static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
35127     const Py_intptr_t neg_one = (Py_intptr_t) ((Py_intptr_t) 0 - (Py_intptr_t) 1), const_zero = (Py_intptr_t) 0;
35128     const int is_unsigned = neg_one > const_zero;
35129     if (is_unsigned) {
35130         if (sizeof(Py_intptr_t) < sizeof(long)) {
35131             return PyInt_FromLong((long) value);
35132         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned long)) {
35133             return PyLong_FromUnsignedLong((unsigned long) value);
35134 #ifdef HAVE_LONG_LONG
35135         } else if (sizeof(Py_intptr_t) <= sizeof(unsigned PY_LONG_LONG)) {
35136             return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
35137 #endif
35138         }
35139     } else {
35140         if (sizeof(Py_intptr_t) <= sizeof(long)) {
35141             return PyInt_FromLong((long) value);
35142 #ifdef HAVE_LONG_LONG
35143         } else if (sizeof(Py_intptr_t) <= sizeof(PY_LONG_LONG)) {
35144             return PyLong_FromLongLong((PY_LONG_LONG) value);
35145 #endif
35146         }
35147     }
35148     {
35149         int one = 1; int little = (int)*(unsigned char *)&one;
35150         unsigned char *bytes = (unsigned char *)&value;
35151         return _PyLong_FromByteArray(bytes, sizeof(Py_intptr_t),
35152                                      little, !is_unsigned);
35153     }
35154 }
35155 
35156 /* Declarations */
35157     #if CYTHON_CCOMPLEX
35158   #ifdef __cplusplus
35159     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35160       return ::std::complex< float >(x, y);
35161     }
35162   #else
35163     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35164       return x + y*(__pyx_t_float_complex)_Complex_I;
35165     }
35166   #endif
35167 #else
35168     static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
35169       __pyx_t_float_complex z;
35170       z.real = x;
35171       z.imag = y;
35172       return z;
35173     }
35174 #endif
35175 
35176 /* Arithmetic */
35177     #if CYTHON_CCOMPLEX
35178 #else
35179     static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35180        return (a.real == b.real) && (a.imag == b.imag);
35181     }
35182     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35183         __pyx_t_float_complex z;
35184         z.real = a.real + b.real;
35185         z.imag = a.imag + b.imag;
35186         return z;
35187     }
35188     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35189         __pyx_t_float_complex z;
35190         z.real = a.real - b.real;
35191         z.imag = a.imag - b.imag;
35192         return z;
35193     }
35194     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35195         __pyx_t_float_complex z;
35196         z.real = a.real * b.real - a.imag * b.imag;
35197         z.imag = a.real * b.imag + a.imag * b.real;
35198         return z;
35199     }
35200     #if 1
35201     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35202         if (b.imag == 0) {
35203             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35204         } else if (fabsf(b.real) >= fabsf(b.imag)) {
35205             if (b.real == 0 && b.imag == 0) {
35206                 return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
35207             } else {
35208                 float r = b.imag / b.real;
35209                 float s = (float)(1.0) / (b.real + b.imag * r);
35210                 return __pyx_t_float_complex_from_parts(
35211                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35212             }
35213         } else {
35214             float r = b.real / b.imag;
35215             float s = (float)(1.0) / (b.imag + b.real * r);
35216             return __pyx_t_float_complex_from_parts(
35217                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35218         }
35219     }
35220     #else
35221     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35222         if (b.imag == 0) {
35223             return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
35224         } else {
35225             float denom = b.real * b.real + b.imag * b.imag;
35226             return __pyx_t_float_complex_from_parts(
35227                 (a.real * b.real + a.imag * b.imag) / denom,
35228                 (a.imag * b.real - a.real * b.imag) / denom);
35229         }
35230     }
35231     #endif
35232     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
35233         __pyx_t_float_complex z;
35234         z.real = -a.real;
35235         z.imag = -a.imag;
35236         return z;
35237     }
35238     static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
35239        return (a.real == 0) && (a.imag == 0);
35240     }
35241     static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
35242         __pyx_t_float_complex z;
35243         z.real =  a.real;
35244         z.imag = -a.imag;
35245         return z;
35246     }
35247     #if 1
35248         static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
35249           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35250             return sqrtf(z.real*z.real + z.imag*z.imag);
35251           #else
35252             return hypotf(z.real, z.imag);
35253           #endif
35254         }
35255         static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
35256             __pyx_t_float_complex z;
35257             float r, lnr, theta, z_r, z_theta;
35258             if (b.imag == 0 && b.real == (int)b.real) {
35259                 if (b.real < 0) {
35260                     float denom = a.real * a.real + a.imag * a.imag;
35261                     a.real = a.real / denom;
35262                     a.imag = -a.imag / denom;
35263                     b.real = -b.real;
35264                 }
35265                 switch ((int)b.real) {
35266                     case 0:
35267                         z.real = 1;
35268                         z.imag = 0;
35269                         return z;
35270                     case 1:
35271                         return a;
35272                     case 2:
35273                         return __Pyx_c_prod_float(a, a);
35274                     case 3:
35275                         z = __Pyx_c_prod_float(a, a);
35276                         return __Pyx_c_prod_float(z, a);
35277                     case 4:
35278                         z = __Pyx_c_prod_float(a, a);
35279                         return __Pyx_c_prod_float(z, z);
35280                 }
35281             }
35282             if (a.imag == 0) {
35283                 if (a.real == 0) {
35284                     return a;
35285                 } else if (b.imag == 0) {
35286                     z.real = powf(a.real, b.real);
35287                     z.imag = 0;
35288                     return z;
35289                 } else if (a.real > 0) {
35290                     r = a.real;
35291                     theta = 0;
35292                 } else {
35293                     r = -a.real;
35294                     theta = atan2f(0.0, -1.0);
35295                 }
35296             } else {
35297                 r = __Pyx_c_abs_float(a);
35298                 theta = atan2f(a.imag, a.real);
35299             }
35300             lnr = logf(r);
35301             z_r = expf(lnr * b.real - theta * b.imag);
35302             z_theta = theta * b.real + lnr * b.imag;
35303             z.real = z_r * cosf(z_theta);
35304             z.imag = z_r * sinf(z_theta);
35305             return z;
35306         }
35307     #endif
35308 #endif
35309 
35310 /* Declarations */
35311     #if CYTHON_CCOMPLEX
35312   #ifdef __cplusplus
35313     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35314       return ::std::complex< double >(x, y);
35315     }
35316   #else
35317     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35318       return x + y*(__pyx_t_double_complex)_Complex_I;
35319     }
35320   #endif
35321 #else
35322     static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
35323       __pyx_t_double_complex z;
35324       z.real = x;
35325       z.imag = y;
35326       return z;
35327     }
35328 #endif
35329 
35330 /* Arithmetic */
35331     #if CYTHON_CCOMPLEX
35332 #else
35333     static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35334        return (a.real == b.real) && (a.imag == b.imag);
35335     }
35336     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35337         __pyx_t_double_complex z;
35338         z.real = a.real + b.real;
35339         z.imag = a.imag + b.imag;
35340         return z;
35341     }
35342     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35343         __pyx_t_double_complex z;
35344         z.real = a.real - b.real;
35345         z.imag = a.imag - b.imag;
35346         return z;
35347     }
35348     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35349         __pyx_t_double_complex z;
35350         z.real = a.real * b.real - a.imag * b.imag;
35351         z.imag = a.real * b.imag + a.imag * b.real;
35352         return z;
35353     }
35354     #if 1
35355     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35356         if (b.imag == 0) {
35357             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35358         } else if (fabs(b.real) >= fabs(b.imag)) {
35359             if (b.real == 0 && b.imag == 0) {
35360                 return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
35361             } else {
35362                 double r = b.imag / b.real;
35363                 double s = (double)(1.0) / (b.real + b.imag * r);
35364                 return __pyx_t_double_complex_from_parts(
35365                     (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
35366             }
35367         } else {
35368             double r = b.real / b.imag;
35369             double s = (double)(1.0) / (b.imag + b.real * r);
35370             return __pyx_t_double_complex_from_parts(
35371                 (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
35372         }
35373     }
35374     #else
35375     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35376         if (b.imag == 0) {
35377             return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
35378         } else {
35379             double denom = b.real * b.real + b.imag * b.imag;
35380             return __pyx_t_double_complex_from_parts(
35381                 (a.real * b.real + a.imag * b.imag) / denom,
35382                 (a.imag * b.real - a.real * b.imag) / denom);
35383         }
35384     }
35385     #endif
35386     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
35387         __pyx_t_double_complex z;
35388         z.real = -a.real;
35389         z.imag = -a.imag;
35390         return z;
35391     }
35392     static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
35393        return (a.real == 0) && (a.imag == 0);
35394     }
35395     static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
35396         __pyx_t_double_complex z;
35397         z.real =  a.real;
35398         z.imag = -a.imag;
35399         return z;
35400     }
35401     #if 1
35402         static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
35403           #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
35404             return sqrt(z.real*z.real + z.imag*z.imag);
35405           #else
35406             return hypot(z.real, z.imag);
35407           #endif
35408         }
35409         static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
35410             __pyx_t_double_complex z;
35411             double r, lnr, theta, z_r, z_theta;
35412             if (b.imag == 0 && b.real == (int)b.real) {
35413                 if (b.real < 0) {
35414                     double denom = a.real * a.real + a.imag * a.imag;
35415                     a.real = a.real / denom;
35416                     a.imag = -a.imag / denom;
35417                     b.real = -b.real;
35418                 }
35419                 switch ((int)b.real) {
35420                     case 0:
35421                         z.real = 1;
35422                         z.imag = 0;
35423                         return z;
35424                     case 1:
35425                         return a;
35426                     case 2:
35427                         return __Pyx_c_prod_double(a, a);
35428                     case 3:
35429                         z = __Pyx_c_prod_double(a, a);
35430                         return __Pyx_c_prod_double(z, a);
35431                     case 4:
35432                         z = __Pyx_c_prod_double(a, a);
35433                         return __Pyx_c_prod_double(z, z);
35434                 }
35435             }
35436             if (a.imag == 0) {
35437                 if (a.real == 0) {
35438                     return a;
35439                 } else if (b.imag == 0) {
35440                     z.real = pow(a.real, b.real);
35441                     z.imag = 0;
35442                     return z;
35443                 } else if (a.real > 0) {
35444                     r = a.real;
35445                     theta = 0;
35446                 } else {
35447                     r = -a.real;
35448                     theta = atan2(0.0, -1.0);
35449                 }
35450             } else {
35451                 r = __Pyx_c_abs_double(a);
35452                 theta = atan2(a.imag, a.real);
35453             }
35454             lnr = log(r);
35455             z_r = exp(lnr * b.real - theta * b.imag);
35456             z_theta = theta * b.real + lnr * b.imag;
35457             z.real = z_r * cos(z_theta);
35458             z.imag = z_r * sin(z_theta);
35459             return z;
35460         }
35461     #endif
35462 #endif
35463 
35464 /* CIntFromPy */
35465     static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
35466     const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
35467     const int is_unsigned = neg_one > const_zero;
35468 #if PY_MAJOR_VERSION < 3
35469     if (likely(PyInt_Check(x))) {
35470         if (sizeof(int) < sizeof(long)) {
35471             __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
35472         } else {
35473             long val = PyInt_AS_LONG(x);
35474             if (is_unsigned && unlikely(val < 0)) {
35475                 goto raise_neg_overflow;
35476             }
35477             return (int) val;
35478         }
35479     } else
35480 #endif
35481     if (likely(PyLong_Check(x))) {
35482         if (is_unsigned) {
35483 #if CYTHON_USE_PYLONG_INTERNALS
35484             const digit* digits = ((PyLongObject*)x)->ob_digit;
35485             switch (Py_SIZE(x)) {
35486                 case  0: return (int) 0;
35487                 case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
35488                 case 2:
35489                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
35490                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35491                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35492                         } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
35493                             return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35494                         }
35495                     }
35496                     break;
35497                 case 3:
35498                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
35499                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35500                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35501                         } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
35502                             return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35503                         }
35504                     }
35505                     break;
35506                 case 4:
35507                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
35508                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35509                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35510                         } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
35511                             return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
35512                         }
35513                     }
35514                     break;
35515             }
35516 #endif
35517 #if CYTHON_COMPILING_IN_CPYTHON
35518             if (unlikely(Py_SIZE(x) < 0)) {
35519                 goto raise_neg_overflow;
35520             }
35521 #else
35522             {
35523                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35524                 if (unlikely(result < 0))
35525                     return (int) -1;
35526                 if (unlikely(result == 1))
35527                     goto raise_neg_overflow;
35528             }
35529 #endif
35530             if (sizeof(int) <= sizeof(unsigned long)) {
35531                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
35532 #ifdef HAVE_LONG_LONG
35533             } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
35534                 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35535 #endif
35536             }
35537         } else {
35538 #if CYTHON_USE_PYLONG_INTERNALS
35539             const digit* digits = ((PyLongObject*)x)->ob_digit;
35540             switch (Py_SIZE(x)) {
35541                 case  0: return (int) 0;
35542                 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
35543                 case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
35544                 case -2:
35545                     if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
35546                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35547                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35548                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35549                             return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35550                         }
35551                     }
35552                     break;
35553                 case 2:
35554                     if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
35555                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35556                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35557                         } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35558                             return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35559                         }
35560                     }
35561                     break;
35562                 case -3:
35563                     if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
35564                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35565                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35566                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35567                             return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35568                         }
35569                     }
35570                     break;
35571                 case 3:
35572                     if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
35573                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35574                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35575                         } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35576                             return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35577                         }
35578                     }
35579                     break;
35580                 case -4:
35581                     if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
35582                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35583                             __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35584                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
35585                             return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35586                         }
35587                     }
35588                     break;
35589                 case 4:
35590                     if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
35591                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35592                             __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35593                         } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
35594                             return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
35595                         }
35596                     }
35597                     break;
35598             }
35599 #endif
35600             if (sizeof(int) <= sizeof(long)) {
35601                 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
35602 #ifdef HAVE_LONG_LONG
35603             } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
35604                 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
35605 #endif
35606             }
35607         }
35608         {
35609 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35610             PyErr_SetString(PyExc_RuntimeError,
35611                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35612 #else
35613             int val;
35614             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35615  #if PY_MAJOR_VERSION < 3
35616             if (likely(v) && !PyLong_Check(v)) {
35617                 PyObject *tmp = v;
35618                 v = PyNumber_Long(tmp);
35619                 Py_DECREF(tmp);
35620             }
35621  #endif
35622             if (likely(v)) {
35623                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35624                 unsigned char *bytes = (unsigned char *)&val;
35625                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35626                                               bytes, sizeof(val),
35627                                               is_little, !is_unsigned);
35628                 Py_DECREF(v);
35629                 if (likely(!ret))
35630                     return val;
35631             }
35632 #endif
35633             return (int) -1;
35634         }
35635     } else {
35636         int val;
35637         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35638         if (!tmp) return (int) -1;
35639         val = __Pyx_PyInt_As_int(tmp);
35640         Py_DECREF(tmp);
35641         return val;
35642     }
35643 raise_overflow:
35644     PyErr_SetString(PyExc_OverflowError,
35645         "value too large to convert to int");
35646     return (int) -1;
35647 raise_neg_overflow:
35648     PyErr_SetString(PyExc_OverflowError,
35649         "can't convert negative value to int");
35650     return (int) -1;
35651 }
35652 
35653 /* CIntFromPy */
35654     static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
35655     const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
35656     const int is_unsigned = neg_one > const_zero;
35657 #if PY_MAJOR_VERSION < 3
35658     if (likely(PyInt_Check(x))) {
35659         if (sizeof(long) < sizeof(long)) {
35660             __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
35661         } else {
35662             long val = PyInt_AS_LONG(x);
35663             if (is_unsigned && unlikely(val < 0)) {
35664                 goto raise_neg_overflow;
35665             }
35666             return (long) val;
35667         }
35668     } else
35669 #endif
35670     if (likely(PyLong_Check(x))) {
35671         if (is_unsigned) {
35672 #if CYTHON_USE_PYLONG_INTERNALS
35673             const digit* digits = ((PyLongObject*)x)->ob_digit;
35674             switch (Py_SIZE(x)) {
35675                 case  0: return (long) 0;
35676                 case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
35677                 case 2:
35678                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
35679                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35680                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35681                         } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
35682                             return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35683                         }
35684                     }
35685                     break;
35686                 case 3:
35687                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
35688                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35689                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35690                         } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
35691                             return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35692                         }
35693                     }
35694                     break;
35695                 case 4:
35696                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
35697                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35698                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35699                         } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
35700                             return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
35701                         }
35702                     }
35703                     break;
35704             }
35705 #endif
35706 #if CYTHON_COMPILING_IN_CPYTHON
35707             if (unlikely(Py_SIZE(x) < 0)) {
35708                 goto raise_neg_overflow;
35709             }
35710 #else
35711             {
35712                 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
35713                 if (unlikely(result < 0))
35714                     return (long) -1;
35715                 if (unlikely(result == 1))
35716                     goto raise_neg_overflow;
35717             }
35718 #endif
35719             if (sizeof(long) <= sizeof(unsigned long)) {
35720                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
35721 #ifdef HAVE_LONG_LONG
35722             } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
35723                 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
35724 #endif
35725             }
35726         } else {
35727 #if CYTHON_USE_PYLONG_INTERNALS
35728             const digit* digits = ((PyLongObject*)x)->ob_digit;
35729             switch (Py_SIZE(x)) {
35730                 case  0: return (long) 0;
35731                 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
35732                 case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
35733                 case -2:
35734                     if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
35735                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35736                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35737                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35738                             return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35739                         }
35740                     }
35741                     break;
35742                 case 2:
35743                     if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
35744                         if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
35745                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35746                         } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35747                             return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35748                         }
35749                     }
35750                     break;
35751                 case -3:
35752                     if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
35753                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35754                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35755                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35756                             return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35757                         }
35758                     }
35759                     break;
35760                 case 3:
35761                     if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
35762                         if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
35763                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35764                         } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35765                             return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35766                         }
35767                     }
35768                     break;
35769                 case -4:
35770                     if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
35771                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35772                             __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35773                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35774                             return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35775                         }
35776                     }
35777                     break;
35778                 case 4:
35779                     if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
35780                         if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
35781                             __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
35782                         } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
35783                             return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
35784                         }
35785                     }
35786                     break;
35787             }
35788 #endif
35789             if (sizeof(long) <= sizeof(long)) {
35790                 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
35791 #ifdef HAVE_LONG_LONG
35792             } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
35793                 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
35794 #endif
35795             }
35796         }
35797         {
35798 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
35799             PyErr_SetString(PyExc_RuntimeError,
35800                             "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
35801 #else
35802             long val;
35803             PyObject *v = __Pyx_PyNumber_IntOrLong(x);
35804  #if PY_MAJOR_VERSION < 3
35805             if (likely(v) && !PyLong_Check(v)) {
35806                 PyObject *tmp = v;
35807                 v = PyNumber_Long(tmp);
35808                 Py_DECREF(tmp);
35809             }
35810  #endif
35811             if (likely(v)) {
35812                 int one = 1; int is_little = (int)*(unsigned char *)&one;
35813                 unsigned char *bytes = (unsigned char *)&val;
35814                 int ret = _PyLong_AsByteArray((PyLongObject *)v,
35815                                               bytes, sizeof(val),
35816                                               is_little, !is_unsigned);
35817                 Py_DECREF(v);
35818                 if (likely(!ret))
35819                     return val;
35820             }
35821 #endif
35822             return (long) -1;
35823         }
35824     } else {
35825         long val;
35826         PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
35827         if (!tmp) return (long) -1;
35828         val = __Pyx_PyInt_As_long(tmp);
35829         Py_DECREF(tmp);
35830         return val;
35831     }
35832 raise_overflow:
35833     PyErr_SetString(PyExc_OverflowError,
35834         "value too large to convert to long");
35835     return (long) -1;
35836 raise_neg_overflow:
35837     PyErr_SetString(PyExc_OverflowError,
35838         "can't convert negative value to long");
35839     return (long) -1;
35840 }
35841 
35842 /* FastTypeChecks */
35843     #if CYTHON_COMPILING_IN_CPYTHON
35844 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
35845     while (a) {
35846         a = a->tp_base;
35847         if (a == b)
35848             return 1;
35849     }
35850     return b == &PyBaseObject_Type;
35851 }
35852 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
35853     PyObject *mro;
35854     if (a == b) return 1;
35855     mro = a->tp_mro;
35856     if (likely(mro)) {
35857         Py_ssize_t i, n;
35858         n = PyTuple_GET_SIZE(mro);
35859         for (i = 0; i < n; i++) {
35860             if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
35861                 return 1;
35862         }
35863         return 0;
35864     }
35865     return __Pyx_InBases(a, b);
35866 }
35867 #if PY_MAJOR_VERSION == 2
35868 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
35869     PyObject *exception, *value, *tb;
35870     int res;
35871     __Pyx_PyThreadState_declare
35872     __Pyx_PyThreadState_assign
35873     __Pyx_ErrFetch(&exception, &value, &tb);
35874     res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
35875     if (unlikely(res == -1)) {
35876         PyErr_WriteUnraisable(err);
35877         res = 0;
35878     }
35879     if (!res) {
35880         res = PyObject_IsSubclass(err, exc_type2);
35881         if (unlikely(res == -1)) {
35882             PyErr_WriteUnraisable(err);
35883             res = 0;
35884         }
35885     }
35886     __Pyx_ErrRestore(exception, value, tb);
35887     return res;
35888 }
35889 #else
35890 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
35891     int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
35892     if (!res) {
35893         res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
35894     }
35895     return res;
35896 }
35897 #endif
35898 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
35899     Py_ssize_t i, n;
35900     assert(PyExceptionClass_Check(exc_type));
35901     n = PyTuple_GET_SIZE(tuple);
35902 #if PY_MAJOR_VERSION >= 3
35903     for (i=0; i<n; i++) {
35904         if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
35905     }
35906 #endif
35907     for (i=0; i<n; i++) {
35908         PyObject *t = PyTuple_GET_ITEM(tuple, i);
35909         #if PY_MAJOR_VERSION < 3
35910         if (likely(exc_type == t)) return 1;
35911         #endif
35912         if (likely(PyExceptionClass_Check(t))) {
35913             if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
35914         } else {
35915         }
35916     }
35917     return 0;
35918 }
35919 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
35920     if (likely(err == exc_type)) return 1;
35921     if (likely(PyExceptionClass_Check(err))) {
35922         if (likely(PyExceptionClass_Check(exc_type))) {
35923             return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
35924         } else if (likely(PyTuple_Check(exc_type))) {
35925             return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
35926         } else {
35927         }
35928     }
35929     return PyErr_GivenExceptionMatches(err, exc_type);
35930 }
35931 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
35932     assert(PyExceptionClass_Check(exc_type1));
35933     assert(PyExceptionClass_Check(exc_type2));
35934     if (likely(err == exc_type1 || err == exc_type2)) return 1;
35935     if (likely(PyExceptionClass_Check(err))) {
35936         return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
35937     }
35938     return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
35939 }
35940 #endif
35941 
35942 /* CheckBinaryVersion */
35943     static int __Pyx_check_binary_version(void) {
35944     char ctversion[4], rtversion[4];
35945     PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
35946     PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
35947     if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
35948         char message[200];
35949         PyOS_snprintf(message, sizeof(message),
35950                       "compiletime version %s of module '%.100s' "
35951                       "does not match runtime version %s",
35952                       ctversion, __Pyx_MODULE_NAME, rtversion);
35953         return PyErr_WarnEx(NULL, message, 1);
35954     }
35955     return 0;
35956 }
35957 
35958 /* InitStrings */
35959     static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
35960     while (t->p) {
35961         #if PY_MAJOR_VERSION < 3
35962         if (t->is_unicode) {
35963             *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
35964         } else if (t->intern) {
35965             *t->p = PyString_InternFromString(t->s);
35966         } else {
35967             *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
35968         }
35969         #else
35970         if (t->is_unicode | t->is_str) {
35971             if (t->intern) {
35972                 *t->p = PyUnicode_InternFromString(t->s);
35973             } else if (t->encoding) {
35974                 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
35975             } else {
35976                 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
35977             }
35978         } else {
35979             *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
35980         }
35981         #endif
35982         if (!*t->p)
35983             return -1;
35984         if (PyObject_Hash(*t->p) == -1)
35985             return -1;
35986         ++t;
35987     }
35988     return 0;
35989 }
35990 
35991 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
35992     return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
35993 }
35994 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
35995     Py_ssize_t ignore;
35996     return __Pyx_PyObject_AsStringAndSize(o, &ignore);
35997 }
35998 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
35999 #if !CYTHON_PEP393_ENABLED
36000 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36001     char* defenc_c;
36002     PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
36003     if (!defenc) return NULL;
36004     defenc_c = PyBytes_AS_STRING(defenc);
36005 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36006     {
36007         char* end = defenc_c + PyBytes_GET_SIZE(defenc);
36008         char* c;
36009         for (c = defenc_c; c < end; c++) {
36010             if ((unsigned char) (*c) >= 128) {
36011                 PyUnicode_AsASCIIString(o);
36012                 return NULL;
36013             }
36014         }
36015     }
36016 #endif
36017     *length = PyBytes_GET_SIZE(defenc);
36018     return defenc_c;
36019 }
36020 #else
36021 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36022     if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
36023 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36024     if (likely(PyUnicode_IS_ASCII(o))) {
36025         *length = PyUnicode_GET_LENGTH(o);
36026         return PyUnicode_AsUTF8(o);
36027     } else {
36028         PyUnicode_AsASCIIString(o);
36029         return NULL;
36030     }
36031 #else
36032     return PyUnicode_AsUTF8AndSize(o, length);
36033 #endif
36034 }
36035 #endif
36036 #endif
36037 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
36038 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
36039     if (
36040 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
36041             __Pyx_sys_getdefaultencoding_not_ascii &&
36042 #endif
36043             PyUnicode_Check(o)) {
36044         return __Pyx_PyUnicode_AsStringAndSize(o, length);
36045     } else
36046 #endif
36047 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
36048     if (PyByteArray_Check(o)) {
36049         *length = PyByteArray_GET_SIZE(o);
36050         return PyByteArray_AS_STRING(o);
36051     } else
36052 #endif
36053     {
36054         char* result;
36055         int r = PyBytes_AsStringAndSize(o, &result, length);
36056         if (unlikely(r < 0)) {
36057             return NULL;
36058         } else {
36059             return result;
36060         }
36061     }
36062 }
36063 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
36064    int is_true = x == Py_True;
36065    if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
36066    else return PyObject_IsTrue(x);
36067 }
36068 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
36069     int retval;
36070     if (unlikely(!x)) return -1;
36071     retval = __Pyx_PyObject_IsTrue(x);
36072     Py_DECREF(x);
36073     return retval;
36074 }
36075 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
36076 #if PY_MAJOR_VERSION >= 3
36077     if (PyLong_Check(result)) {
36078         if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
36079                 "__int__ returned non-int (type %.200s).  "
36080                 "The ability to return an instance of a strict subclass of int "
36081                 "is deprecated, and may be removed in a future version of Python.",
36082                 Py_TYPE(result)->tp_name)) {
36083             Py_DECREF(result);
36084             return NULL;
36085         }
36086         return result;
36087     }
36088 #endif
36089     PyErr_Format(PyExc_TypeError,
36090                  "__%.4s__ returned non-%.4s (type %.200s)",
36091                  type_name, type_name, Py_TYPE(result)->tp_name);
36092     Py_DECREF(result);
36093     return NULL;
36094 }
36095 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
36096 #if CYTHON_USE_TYPE_SLOTS
36097   PyNumberMethods *m;
36098 #endif
36099   const char *name = NULL;
36100   PyObject *res = NULL;
36101 #if PY_MAJOR_VERSION < 3
36102   if (likely(PyInt_Check(x) || PyLong_Check(x)))
36103 #else
36104   if (likely(PyLong_Check(x)))
36105 #endif
36106     return __Pyx_NewRef(x);
36107 #if CYTHON_USE_TYPE_SLOTS
36108   m = Py_TYPE(x)->tp_as_number;
36109   #if PY_MAJOR_VERSION < 3
36110   if (m && m->nb_int) {
36111     name = "int";
36112     res = m->nb_int(x);
36113   }
36114   else if (m && m->nb_long) {
36115     name = "long";
36116     res = m->nb_long(x);
36117   }
36118   #else
36119   if (likely(m && m->nb_int)) {
36120     name = "int";
36121     res = m->nb_int(x);
36122   }
36123   #endif
36124 #else
36125   if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
36126     res = PyNumber_Int(x);
36127   }
36128 #endif
36129   if (likely(res)) {
36130 #if PY_MAJOR_VERSION < 3
36131     if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
36132 #else
36133     if (unlikely(!PyLong_CheckExact(res))) {
36134 #endif
36135         return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
36136     }
36137   }
36138   else if (!PyErr_Occurred()) {
36139     PyErr_SetString(PyExc_TypeError,
36140                     "an integer is required");
36141   }
36142   return res;
36143 }
36144 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
36145   Py_ssize_t ival;
36146   PyObject *x;
36147 #if PY_MAJOR_VERSION < 3
36148   if (likely(PyInt_CheckExact(b))) {
36149     if (sizeof(Py_ssize_t) >= sizeof(long))
36150         return PyInt_AS_LONG(b);
36151     else
36152         return PyInt_AsSsize_t(b);
36153   }
36154 #endif
36155   if (likely(PyLong_CheckExact(b))) {
36156     #if CYTHON_USE_PYLONG_INTERNALS
36157     const digit* digits = ((PyLongObject*)b)->ob_digit;
36158     const Py_ssize_t size = Py_SIZE(b);
36159     if (likely(__Pyx_sst_abs(size) <= 1)) {
36160         ival = likely(size) ? digits[0] : 0;
36161         if (size == -1) ival = -ival;
36162         return ival;
36163     } else {
36164       switch (size) {
36165          case 2:
36166            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36167              return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36168            }
36169            break;
36170          case -2:
36171            if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
36172              return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36173            }
36174            break;
36175          case 3:
36176            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36177              return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36178            }
36179            break;
36180          case -3:
36181            if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
36182              return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36183            }
36184            break;
36185          case 4:
36186            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36187              return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36188            }
36189            break;
36190          case -4:
36191            if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
36192              return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
36193            }
36194            break;
36195       }
36196     }
36197     #endif
36198     return PyLong_AsSsize_t(b);
36199   }
36200   x = PyNumber_Index(b);
36201   if (!x) return -1;
36202   ival = PyInt_AsSsize_t(x);
36203   Py_DECREF(x);
36204   return ival;
36205 }
36206 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
36207   return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
36208 }
36209 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
36210     return PyInt_FromSize_t(ival);
36211 }
36212 
36213 
36214 #endif /* Py_PYTHON_H */
36215